Committing the CodeScanner Core tool default tip
authornoe\swadi
Thu, 18 Feb 2010 12:29:02 +0530
changeset 1 22878952f6e2
parent 0 509e4801c378
Committing the CodeScanner Core tool This component has been moved from the StaticAnaApps package. BUG : 5889 (http://developer.symbian.org/webbugs/show_bug.cgi?id=5889).
srcanamdw/codescanner/.project
srcanamdw/codescanner/.pydevproject
srcanamdw/codescanner/BuildParser.py
srcanamdw/codescanner/BuildParserdoc/BuildParser.doc
srcanamdw/codescanner/MIT license.doc
srcanamdw/codescanner/MIT_license.txt
srcanamdw/codescanner/Readme.txt
srcanamdw/codescanner/buildcodescanner/codescanner.exe
srcanamdw/codescanner/buildcodescanner/out0.toc
srcanamdw/codescanner/buildcodescanner/out1.pyz
srcanamdw/codescanner/buildcodescanner/out1.toc
srcanamdw/codescanner/buildcodescanner/out2.toc
srcanamdw/codescanner/buildcodescanner/out3.pkg
srcanamdw/codescanner/buildcodescanner/out3.toc
srcanamdw/codescanner/buildcodescanner/out4.toc
srcanamdw/codescanner/buildtools.bat
srcanamdw/codescanner/codescanner.py
srcanamdw/codescanner/codescanner.spec
srcanamdw/codescanner/config.bat
srcanamdw/codescanner/cs_config.xml
srcanamdw/codescanner/cs_version.rc
srcanamdw/codescanner/cs_version.res
srcanamdw/codescanner/distcodescanner/MIT_license.txt
srcanamdw/codescanner/distcodescanner/MSVCR71.dll
srcanamdw/codescanner/distcodescanner/_hashlib.pyd
srcanamdw/codescanner/distcodescanner/_socket.pyd
srcanamdw/codescanner/distcodescanner/_ssl.pyd
srcanamdw/codescanner/distcodescanner/bz2.pyd
srcanamdw/codescanner/distcodescanner/codescanner.exe
srcanamdw/codescanner/distcodescanner/psyco._psyco.pyd
srcanamdw/codescanner/distcodescanner/pyexpat.pyd
srcanamdw/codescanner/distcodescanner/python 2_5_1 licenses.txt
srcanamdw/codescanner/distcodescanner/python25.dll
srcanamdw/codescanner/distcodescanner/pywintypes25.dll
srcanamdw/codescanner/distcodescanner/release_notes.txt
srcanamdw/codescanner/distcodescanner/unicodedata.pyd
srcanamdw/codescanner/distcodescanner/win32api.pyd
srcanamdw/codescanner/makeGraphics/EncodedFile.py
srcanamdw/codescanner/makeGraphics/extractor.py
srcanamdw/codescanner/makeGraphics/makeGraphicsScriptFile.py
srcanamdw/codescanner/makeGraphics/mi_codescanner.jpg
srcanamdw/codescanner/makeGraphics/mi_logo.jpg
srcanamdw/codescanner/makeGraphics/test.bat
srcanamdw/codescanner/new_cs_config.xml
srcanamdw/codescanner/pyinstaller/ArchiveViewer.py
srcanamdw/codescanner/pyinstaller/Build.py
srcanamdw/codescanner/pyinstaller/Build.pyc
srcanamdw/codescanner/pyinstaller/Configure.py
srcanamdw/codescanner/pyinstaller/GrabVersion.py
srcanamdw/codescanner/pyinstaller/MakeCOMServer_old.py
srcanamdw/codescanner/pyinstaller/MakeComServer.py
srcanamdw/codescanner/pyinstaller/Makespec.py
srcanamdw/codescanner/pyinstaller/McGUI.py
srcanamdw/codescanner/pyinstaller/README.txt
srcanamdw/codescanner/pyinstaller/Sconstruct
srcanamdw/codescanner/pyinstaller/archive.py
srcanamdw/codescanner/pyinstaller/archive.pyc
srcanamdw/codescanner/pyinstaller/bindepend.py
srcanamdw/codescanner/pyinstaller/bindepend.pyc
srcanamdw/codescanner/pyinstaller/buildtests/hooks1/hook-pkg1.py
srcanamdw/codescanner/pyinstaller/buildtests/pkg1/__init__.py
srcanamdw/codescanner/pyinstaller/buildtests/pkg1/a.py
srcanamdw/codescanner/pyinstaller/buildtests/pkg2/__init__.py
srcanamdw/codescanner/pyinstaller/buildtests/pkg2/a.py
srcanamdw/codescanner/pyinstaller/buildtests/pkg2/a/readme.txt
srcanamdw/codescanner/pyinstaller/buildtests/pkg2/extra/b.py
srcanamdw/codescanner/pyinstaller/buildtests/runtests.py
srcanamdw/codescanner/pyinstaller/buildtests/test1.py
srcanamdw/codescanner/pyinstaller/buildtests/test1.spec
srcanamdw/codescanner/pyinstaller/buildtests/test2-version.txt
srcanamdw/codescanner/pyinstaller/buildtests/test2.ico
srcanamdw/codescanner/pyinstaller/buildtests/test2.py
srcanamdw/codescanner/pyinstaller/buildtests/test2.spec
srcanamdw/codescanner/pyinstaller/buildtests/test3.py
srcanamdw/codescanner/pyinstaller/buildtests/test3.spec
srcanamdw/codescanner/pyinstaller/buildtests/test4.py
srcanamdw/codescanner/pyinstaller/buildtests/test4.spec
srcanamdw/codescanner/pyinstaller/buildtests/test5.py
srcanamdw/codescanner/pyinstaller/buildtests/test5.spec
srcanamdw/codescanner/pyinstaller/buildtests/test6.py
srcanamdw/codescanner/pyinstaller/buildtests/test6.spec
srcanamdw/codescanner/pyinstaller/buildtests/test6x.py
srcanamdw/codescanner/pyinstaller/buildtests/test7.py
srcanamdw/codescanner/pyinstaller/buildtests/test7.spec
srcanamdw/codescanner/pyinstaller/buildtests/test7x.py
srcanamdw/codescanner/pyinstaller/buildtests/test8.py
srcanamdw/codescanner/pyinstaller/buildtests/test8.spec
srcanamdw/codescanner/pyinstaller/buildtests/test9.py
srcanamdw/codescanner/pyinstaller/buildtests/test9.spec
srcanamdw/codescanner/pyinstaller/carchive.py
srcanamdw/codescanner/pyinstaller/carchive.pyc
srcanamdw/codescanner/pyinstaller/config.dat
srcanamdw/codescanner/pyinstaller/doc/CHANGES.txt
srcanamdw/codescanner/pyinstaller/doc/KNOWNBUGS.txt
srcanamdw/codescanner/pyinstaller/doc/LICENSE.GPL
srcanamdw/codescanner/pyinstaller/doc/Manual.html
srcanamdw/codescanner/pyinstaller/doc/images/CArchive.png
srcanamdw/codescanner/pyinstaller/doc/images/SE_exe.png
srcanamdw/codescanner/pyinstaller/doc/images/ZlibArchive.png
srcanamdw/codescanner/pyinstaller/doc/source/Makefile
srcanamdw/codescanner/pyinstaller/doc/source/Manual.rst
srcanamdw/codescanner/pyinstaller/doc/source/docutils.conf
srcanamdw/codescanner/pyinstaller/doc/source/tools/README
srcanamdw/codescanner/pyinstaller/doc/source/tools/buildrecursive.py
srcanamdw/codescanner/pyinstaller/doc/source/tools/rst2newlatex.py
srcanamdw/codescanner/pyinstaller/doc/source/tools/rst2xml.py
srcanamdw/codescanner/pyinstaller/doc/stylesheets/default.css
srcanamdw/codescanner/pyinstaller/doc/stylesheets/docutils.conf
srcanamdw/codescanner/pyinstaller/doc/stylesheets/latex.tex
srcanamdw/codescanner/pyinstaller/doc/stylesheets/style.tex
srcanamdw/codescanner/pyinstaller/e2etests/common/hanoi.py
srcanamdw/codescanner/pyinstaller/e2etests/common/maketests.py
srcanamdw/codescanner/pyinstaller/e2etests/win32/NextID.py
srcanamdw/codescanner/pyinstaller/e2etests/win32/readme.txt
srcanamdw/codescanner/pyinstaller/e2etests/win32/testEnsureDispatch.py
srcanamdw/codescanner/pyinstaller/e2etests/win32/testMSOffice.py
srcanamdw/codescanner/pyinstaller/e2etests/win32/testNextID.vbs
srcanamdw/codescanner/pyinstaller/e2etests/win32/testcomext.py
srcanamdw/codescanner/pyinstaller/hooks/__init__.py
srcanamdw/codescanner/pyinstaller/hooks/__init__.pyc
srcanamdw/codescanner/pyinstaller/hooks/hook-DateTime.mxDateTime.py
srcanamdw/codescanner/pyinstaller/hooks/hook-DateTime.py
srcanamdw/codescanner/pyinstaller/hooks/hook-Image.py
srcanamdw/codescanner/pyinstaller/hooks/hook-PIL.Image.py
srcanamdw/codescanner/pyinstaller/hooks/hook-PIL.SpiderImagePlugin.py
srcanamdw/codescanner/pyinstaller/hooks/hook-_sre.py
srcanamdw/codescanner/pyinstaller/hooks/hook-_sre.pyc
srcanamdw/codescanner/pyinstaller/hooks/hook-anydbm.py
srcanamdw/codescanner/pyinstaller/hooks/hook-cPickle.py
srcanamdw/codescanner/pyinstaller/hooks/hook-cStringIO.py
srcanamdw/codescanner/pyinstaller/hooks/hook-cStringIO.pyc
srcanamdw/codescanner/pyinstaller/hooks/hook-carchive.py
srcanamdw/codescanner/pyinstaller/hooks/hook-codecs.py
srcanamdw/codescanner/pyinstaller/hooks/hook-codecs.pyc
srcanamdw/codescanner/pyinstaller/hooks/hook-dns.rdata.py
srcanamdw/codescanner/pyinstaller/hooks/hook-encodings.py
srcanamdw/codescanner/pyinstaller/hooks/hook-encodings.pyc
srcanamdw/codescanner/pyinstaller/hooks/hook-gtk.py
srcanamdw/codescanner/pyinstaller/hooks/hook-iu.py
srcanamdw/codescanner/pyinstaller/hooks/hook-iu.pyc
srcanamdw/codescanner/pyinstaller/hooks/hook-kinterbasdb.py
srcanamdw/codescanner/pyinstaller/hooks/hook-os.py
srcanamdw/codescanner/pyinstaller/hooks/hook-os.pyc
srcanamdw/codescanner/pyinstaller/hooks/hook-parser.py
srcanamdw/codescanner/pyinstaller/hooks/hook-pyexpat.py
srcanamdw/codescanner/pyinstaller/hooks/hook-pyexpat.pyc
srcanamdw/codescanner/pyinstaller/hooks/hook-pythoncom.py
srcanamdw/codescanner/pyinstaller/hooks/hook-pywintypes.py
srcanamdw/codescanner/pyinstaller/hooks/hook-qt.py
srcanamdw/codescanner/pyinstaller/hooks/hook-regex.py
srcanamdw/codescanner/pyinstaller/hooks/hook-time.py
srcanamdw/codescanner/pyinstaller/hooks/hook-time.pyc
srcanamdw/codescanner/pyinstaller/hooks/hook-vtkpython.py
srcanamdw/codescanner/pyinstaller/hooks/hook-win32com.client.py
srcanamdw/codescanner/pyinstaller/hooks/hook-win32com.py
srcanamdw/codescanner/pyinstaller/hooks/hook-win32ui.py
srcanamdw/codescanner/pyinstaller/hooks/hook-xml.dom.domreg.py
srcanamdw/codescanner/pyinstaller/hooks/hook-xml.dom.domreg.pyc
srcanamdw/codescanner/pyinstaller/hooks/hook-xml.dom.ext.py
srcanamdw/codescanner/pyinstaller/hooks/hook-xml.dom.ext.reader.py
srcanamdw/codescanner/pyinstaller/hooks/hook-xml.dom.html.HTMLDocument.py
srcanamdw/codescanner/pyinstaller/hooks/hook-xml.dom.html.py
srcanamdw/codescanner/pyinstaller/hooks/hook-xml.dom.py
srcanamdw/codescanner/pyinstaller/hooks/hook-xml.dom.pyc
srcanamdw/codescanner/pyinstaller/hooks/hook-xml.py
srcanamdw/codescanner/pyinstaller/hooks/hook-xml.pyc
srcanamdw/codescanner/pyinstaller/hooks/hook-xml.sax.py
srcanamdw/codescanner/pyinstaller/hooks/hook-xml.sax.pyc
srcanamdw/codescanner/pyinstaller/hooks/hook-xml.sax.saxexts.py
srcanamdw/codescanner/pyinstaller/icon.py
srcanamdw/codescanner/pyinstaller/icon.pyc
srcanamdw/codescanner/pyinstaller/iu.py
srcanamdw/codescanner/pyinstaller/iu.pyc
srcanamdw/codescanner/pyinstaller/mf.py
srcanamdw/codescanner/pyinstaller/mf.pyc
srcanamdw/codescanner/pyinstaller/optik/__init__.py
srcanamdw/codescanner/pyinstaller/optik/__init__.pyc
srcanamdw/codescanner/pyinstaller/optik/errors.py
srcanamdw/codescanner/pyinstaller/optik/errors.pyc
srcanamdw/codescanner/pyinstaller/optik/help.py
srcanamdw/codescanner/pyinstaller/optik/help.pyc
srcanamdw/codescanner/pyinstaller/optik/option.py
srcanamdw/codescanner/pyinstaller/optik/option.pyc
srcanamdw/codescanner/pyinstaller/optik/option_parser.py
srcanamdw/codescanner/pyinstaller/optik/option_parser.pyc
srcanamdw/codescanner/pyinstaller/optik/textwrap.py
srcanamdw/codescanner/pyinstaller/optik/textwrap.pyc
srcanamdw/codescanner/pyinstaller/optparse.py
srcanamdw/codescanner/pyinstaller/optparse.pyc
srcanamdw/codescanner/pyinstaller/rthooks.dat
srcanamdw/codescanner/pyinstaller/source/Sconscript
srcanamdw/codescanner/pyinstaller/source/common/launch.c
srcanamdw/codescanner/pyinstaller/source/common/launch.h
srcanamdw/codescanner/pyinstaller/source/linux/Make.py
srcanamdw/codescanner/pyinstaller/source/linux/bkfile.py
srcanamdw/codescanner/pyinstaller/source/linux/getpath.c
srcanamdw/codescanner/pyinstaller/source/linux/main.c
srcanamdw/codescanner/pyinstaller/source/linux/makemakefile.py
srcanamdw/codescanner/pyinstaller/source/windows/dllmain.c
srcanamdw/codescanner/pyinstaller/source/windows/dllmain.def
srcanamdw/codescanner/pyinstaller/source/windows/icon1.ico
srcanamdw/codescanner/pyinstaller/source/windows/iconw.ico
srcanamdw/codescanner/pyinstaller/source/windows/manifest.xml
srcanamdw/codescanner/pyinstaller/source/windows/resource.h
srcanamdw/codescanner/pyinstaller/source/windows/run.rc
srcanamdw/codescanner/pyinstaller/source/windows/runw.rc
srcanamdw/codescanner/pyinstaller/source/windows/winmain.c
srcanamdw/codescanner/pyinstaller/source/zlib/README
srcanamdw/codescanner/pyinstaller/source/zlib/adler32.c
srcanamdw/codescanner/pyinstaller/source/zlib/crc32.c
srcanamdw/codescanner/pyinstaller/source/zlib/crc32.h
srcanamdw/codescanner/pyinstaller/source/zlib/crypt.h
srcanamdw/codescanner/pyinstaller/source/zlib/inffast.c
srcanamdw/codescanner/pyinstaller/source/zlib/inffast.h
srcanamdw/codescanner/pyinstaller/source/zlib/inffixed.h
srcanamdw/codescanner/pyinstaller/source/zlib/inflate.c
srcanamdw/codescanner/pyinstaller/source/zlib/inflate.h
srcanamdw/codescanner/pyinstaller/source/zlib/inftrees.c
srcanamdw/codescanner/pyinstaller/source/zlib/inftrees.h
srcanamdw/codescanner/pyinstaller/source/zlib/ioapi.c
srcanamdw/codescanner/pyinstaller/source/zlib/ioapi.h
srcanamdw/codescanner/pyinstaller/source/zlib/unzip.c
srcanamdw/codescanner/pyinstaller/source/zlib/unzip.h
srcanamdw/codescanner/pyinstaller/source/zlib/zconf.h
srcanamdw/codescanner/pyinstaller/source/zlib/zlib.h
srcanamdw/codescanner/pyinstaller/source/zlib/zutil.c
srcanamdw/codescanner/pyinstaller/source/zlib/zutil.h
srcanamdw/codescanner/pyinstaller/support/_mountzlib.py
srcanamdw/codescanner/pyinstaller/support/loader/inprocsrvr_6dc.dll
srcanamdw/codescanner/pyinstaller/support/loader/inprocsrvr_6dw.dll
srcanamdw/codescanner/pyinstaller/support/loader/inprocsrvr_6rc.dll
srcanamdw/codescanner/pyinstaller/support/loader/inprocsrvr_6rw.dll
srcanamdw/codescanner/pyinstaller/support/loader/inprocsrvr_7dc.dll
srcanamdw/codescanner/pyinstaller/support/loader/inprocsrvr_7dw.dll
srcanamdw/codescanner/pyinstaller/support/loader/inprocsrvr_7rc.dll
srcanamdw/codescanner/pyinstaller/support/loader/inprocsrvr_7rw.dll
srcanamdw/codescanner/pyinstaller/support/loader/run_6dc.exe
srcanamdw/codescanner/pyinstaller/support/loader/run_6dw.exe
srcanamdw/codescanner/pyinstaller/support/loader/run_6rc.exe
srcanamdw/codescanner/pyinstaller/support/loader/run_6rw.exe
srcanamdw/codescanner/pyinstaller/support/loader/run_7dc.exe
srcanamdw/codescanner/pyinstaller/support/loader/run_7dw.exe
srcanamdw/codescanner/pyinstaller/support/loader/run_7rc.exe
srcanamdw/codescanner/pyinstaller/support/loader/run_7rw.exe
srcanamdw/codescanner/pyinstaller/support/removeTK.py
srcanamdw/codescanner/pyinstaller/support/rthooks/opengl.py
srcanamdw/codescanner/pyinstaller/support/rthooks/versioneddll.py
srcanamdw/codescanner/pyinstaller/support/rthooks/win32comgenpy.py
srcanamdw/codescanner/pyinstaller/support/unpackTK.py
srcanamdw/codescanner/pyinstaller/support/useTK.py
srcanamdw/codescanner/pyinstaller/support/useUnicode.py
srcanamdw/codescanner/pyinstaller/versionInfo.py
srcanamdw/codescanner/pyinstaller/versionInfo.pyc
srcanamdw/codescanner/python 2_5_1 licenses.txt
srcanamdw/codescanner/release_notes.txt
srcanamdw/codescanner/renderers_poc/renderer.py
srcanamdw/codescanner/scripts/CommonFunctions.py
srcanamdw/codescanner/scripts/ConnectAndDontCloseMemberVariable.py
srcanamdw/codescanner/scripts/LFunctionCantLeave.py
srcanamdw/codescanner/scripts/LeaveNoError.py
srcanamdw/codescanner/scripts/accessArrayElementWithoutCheck.py
srcanamdw/codescanner/scripts/accessArrayElementWithoutCheck2.py
srcanamdw/codescanner/scripts/activestart.py
srcanamdw/codescanner/scripts/activestop.py
srcanamdw/codescanner/scripts/arraypassing.py
srcanamdw/codescanner/scripts/arrayptrcleanup.py
srcanamdw/codescanner/scripts/assertdebuginvariant.py
srcanamdw/codescanner/scripts/baddefines.py
srcanamdw/codescanner/scripts/baseconstruct.py
srcanamdw/codescanner/scripts/callActiveObjectWithoutCheckingOrStopping.py
srcanamdw/codescanner/scripts/changenotification.py
srcanamdw/codescanner/scripts/cleanup.py
srcanamdw/codescanner/scripts/commentcode.py
srcanamdw/codescanner/scripts/connect.py
srcanamdw/codescanner/scripts/constnames.py
srcanamdw/codescanner/scripts/consttdescptr.py
srcanamdw/codescanner/scripts/controlornull.py
srcanamdw/codescanner/scripts/crepository.py
srcanamdw/codescanner/scripts/ctltargettype.py
srcanamdw/codescanner/scripts/customizableicons.py
srcanamdw/codescanner/scripts/debugrom.py
srcanamdw/codescanner/scripts/declarename.py
srcanamdw/codescanner/scripts/deleteMemberVariable.py
srcanamdw/codescanner/scripts/destructor.py
srcanamdw/codescanner/scripts/doubleSemiColon.py
srcanamdw/codescanner/scripts/driveletters.py
srcanamdw/codescanner/scripts/eikbuttons.py
srcanamdw/codescanner/scripts/eikonenvstatic.py
srcanamdw/codescanner/scripts/enummembers.py
srcanamdw/codescanner/scripts/enumnames.py
srcanamdw/codescanner/scripts/exportinline.py
srcanamdw/codescanner/scripts/exportpurevirtual.py
srcanamdw/codescanner/scripts/externaldriveletters.py
srcanamdw/codescanner/scripts/flags.py
srcanamdw/codescanner/scripts/foff.py
srcanamdw/codescanner/scripts/forbiddenwords.py
srcanamdw/codescanner/scripts/forgottoputptroncleanupstack.py
srcanamdw/codescanner/scripts/friend.py
srcanamdw/codescanner/scripts/goto.py
srcanamdw/codescanner/scripts/ifassignments.py
srcanamdw/codescanner/scripts/ifpreprocessor.py
srcanamdw/codescanner/scripts/inheritanceorder.py
srcanamdw/codescanner/scripts/intleaves.py
srcanamdw/codescanner/scripts/jmp.py
srcanamdw/codescanner/scripts/leave.py
srcanamdw/codescanner/scripts/leavingoperators.py
srcanamdw/codescanner/scripts/linescanner.py
srcanamdw/codescanner/scripts/longlines.py
srcanamdw/codescanner/scripts/magicnumbers.py
srcanamdw/codescanner/scripts/mclassdestructor.py
srcanamdw/codescanner/scripts/memberlc.py
srcanamdw/codescanner/scripts/membervariablecallld.py
srcanamdw/codescanner/scripts/missingcancel.py
srcanamdw/codescanner/scripts/missingcclass.py
srcanamdw/codescanner/scripts/mmpsourcepath.py
srcanamdw/codescanner/scripts/multilangrsc.py
srcanamdw/codescanner/scripts/multipledeclarations.py
srcanamdw/codescanner/scripts/multipleinheritance.py
srcanamdw/codescanner/scripts/mydocs.py
srcanamdw/codescanner/scripts/namespace.py
srcanamdw/codescanner/scripts/newlreferences.py
srcanamdw/codescanner/scripts/noleavetrap.py
srcanamdw/codescanner/scripts/nonconsthbufc.py
srcanamdw/codescanner/scripts/nonconsttdesc.py
srcanamdw/codescanner/scripts/nonleavenew.py
srcanamdw/codescanner/scripts/nonunicodeskins.py
srcanamdw/codescanner/scripts/null.py
srcanamdw/codescanner/scripts/open.py
srcanamdw/codescanner/scripts/pointertoarrays.py
srcanamdw/codescanner/scripts/pragmadisable.py
srcanamdw/codescanner/scripts/pragmamessage.py
srcanamdw/codescanner/scripts/pragmaother.py
srcanamdw/codescanner/scripts/privateinheritance.py
srcanamdw/codescanner/scripts/pushaddrvar.py
srcanamdw/codescanner/scripts/pushmember.py
srcanamdw/codescanner/scripts/readresource.py
srcanamdw/codescanner/scripts/resourcenotoncleanupstack.py
srcanamdw/codescanner/scripts/resources/English.loc
srcanamdw/codescanner/scripts/resources/doit.bat
srcanamdw/codescanner/scripts/resources/parsescripts.pl
srcanamdw/codescanner/scripts/resourcesonheap.py
srcanamdw/codescanner/scripts/returndescriptoroutofscope.py
srcanamdw/codescanner/scripts/rfs.py
srcanamdw/codescanner/scripts/rssnames.py
srcanamdw/codescanner/scripts/stringliterals.py
srcanamdw/codescanner/scripts/stringsinresourcefiles.py
srcanamdw/codescanner/scripts/struct.py
srcanamdw/codescanner/scripts/tcclasses.py
srcanamdw/codescanner/scripts/tclassdestructor.py
srcanamdw/codescanner/scripts/todocomments.py
srcanamdw/codescanner/scripts/trapcleanup.py
srcanamdw/codescanner/scripts/trapeleave.py
srcanamdw/codescanner/scripts/traprunl.py
srcanamdw/codescanner/scripts/trspassing.py
srcanamdw/codescanner/scripts/uids.py
srcanamdw/codescanner/scripts/uncompressedaif.py
srcanamdw/codescanner/scripts/uncompressedbmp.py
srcanamdw/codescanner/scripts/unicodesource.py
srcanamdw/codescanner/scripts/userWaitForRequest.py
srcanamdw/codescanner/scripts/userafter.py
srcanamdw/codescanner/scripts/userfree.py
srcanamdw/codescanner/scripts/variablenames.py
srcanamdw/codescanner/scripts/voidparameter.py
srcanamdw/codescanner/scripts/worryingcomments.py
srcanamdw/codescanner/setup.py
srcanamdw/codescanner/warncodescanner.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/.project	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>codescanner</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.python.pydev.PyDevBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.python.pydev.pythonNature</nature>
+	</natures>
+</projectDescription>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/.pydevproject	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?eclipse-pydev version="1.0"?>
+
+<pydev_project>
+<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.4</pydev_property>
+</pydev_project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/BuildParser.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,172 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# #################################################################
+
+import os
+import getopt
+import string
+import sys
+import re
+
+def usage(code, msg=""):
+    print msg
+    print "Usage: Buildparser.py -h -s <script dir> -m <main file> -o <output dir/file> -v <version text>"
+    print 
+    print "options:"
+    print "     -h  command help"
+    print "     -s  script dir is the directory containing python subscripts"
+    print "     -m  main file is the file which contains main() function"
+    print "     -o  output dir/file is the directory (and file) for output result"
+    print "     -v  version text indicates within scripts which fractions to copy"
+    print "         into resultant script"
+    print "     -l  localised filename"
+    print
+    sys.exit(code)
+
+class CFileScanner:
+
+    # Main scan file
+    def startscan(self):
+        # Default output file name is Resultant.py
+        if os.path.isdir(output):
+            resultantfile = open(output+"\Resultant.py", "w")
+        else:
+            resultantfile = open(output, "w")
+
+        # Parse main file from begin to '#!PARSE' tag (copy appropriate lines to resultant file)
+        # and store/parse remaining lines (lines after '#!Parse') into an array
+        # scanfile is in use to scan script files. Here is in use to scan main file! (exception)
+        storelines=self.scanfile(mainfile,resultantfile)
+        # Parse other script files(copy appropriate lines to resultant file)
+        self.traverse(scriptdir,resultantfile)
+        # Flush remaining lines from main file (array) to resultant file
+        self.FlushMainFile(resultantfile,storelines)
+
+        resultantfile.close()
+    # Flush
+    def FlushMainFile(self,resultantfile,storelines):
+        for line in storelines:
+            resultantfile.write(line)
+
+    def InsertFile( self, aResultantfile, aFilename ):
+        # inserts a file without preparsing - for example localised text
+        fileToInsert = open( aFilename, "r" )
+        fileToInsertContent = fileToInsert.readlines()
+
+        for fileToInsertLine in fileToInsertContent:
+            aResultantfile.write( fileToInsertLine )
+        
+        fileToInsert.close()
+
+
+    def scanfile(self,fullfilename,resultantfile):
+        storelines=""
+        ParseDelimiter=False
+        # Copy by default (All lines will be copied which are not within tags)
+        CopyIndicator=True
+        sourcefile = open(fullfilename,"r")
+        filelines = sourcefile.readlines()
+        for line in filelines:
+            delimiter=line.find("#!PARSE")
+            # Parse to delimiter (#!PARSE)
+            if (delimiter<>-1):
+                ParseDelimiter=True
+
+            if( -1 <> line.find( "#!LOCALISEHERE" ) ):
+                self.InsertFile( resultantfile, localiseFilename )
+                
+            
+                
+            # Find begining tag
+            delimiter=line.find("#<<")
+            if (delimiter<>-1):
+                # Version (tag) text not found. Don't copy additional lines
+                if (line.find(version,delimiter+3,delimiter+3+len(version))==-1):
+                    CopyIndicator=False
+                else:
+                    # Found given version, copy lines
+                    CopyIndicator=True
+
+            # Find ending tag
+            reMethod = re.compile("#.*>>")
+            delimiter = reMethod.search(line)
+            if (delimiter):
+                # End of previous version block declaration
+                if (not CopyIndicator):
+                    # If previous version block was not copied, skip '# >>' (don't write this tag to resultant file)
+                    CopyIndicator=True
+                    continue
+                else:
+                    CopyIndicator=True
+
+            # Haven't reached '#!Parse' delimiter so copy current line to resultant file
+            if (not ParseDelimiter):
+                # Copy indicator is still working
+                if (CopyIndicator):
+                    resultantfile.write(line)
+            else:
+                if (CopyIndicator):
+                    # Store lines after '#!PARSE'
+                    storelines=storelines+line
+
+        resultantfile.write("\n")                
+        sourcefile.close()
+        return storelines
+
+    # Searching subdirectories and files
+    def traverse(self, currentdir,resultantfile):
+        contents = os.listdir(currentdir)
+        for entry in contents:
+            fullfilename = os.path.normpath(os.path.join(currentdir, entry))
+            if os.path.isdir(fullfilename):
+                self.traverse(fullfilename,resultantfile)
+            else:
+                # Scan file if it is not the main file and it is python file
+                if (fullfilename.upper().find((mainfile[mainfile.rfind("\\")+1:]).upper())==-1 and fullfilename.upper()[-3:]==".PY"):
+                    self.scanfile(fullfilename,resultantfile)
+
+#
+# main
+#
+opts, args = getopt.getopt(sys.argv[1:], "hs:m:o:v:l:", ["help", "scriptdir=", "mainfile=", "output=","version=","localisefile="])
+
+storelines=""
+scriptdir=""
+mainfile=""
+output=""
+version=0
+localiseFilename=""
+
+for o, a in opts:
+    if o in ("-h", "--help"):
+        usage(0)
+    if o in ("-s", "--scriptdir"):
+        scriptdir = a
+    if o in ("-m", "--mainfile"):
+        mainfile = a
+    if o in ("-o", "--output"):
+        output = a
+    if o in ("-v", "--version"):
+        version = a
+    if o in ("-l", "--localisefile"):
+        localiseFilename = a
+
+if (scriptdir=="" or mainfile=="" or output=="" or version==0 or localiseFilename=="" ):
+    usage(1)
+
+scanner = CFileScanner()
+scanner.startscan()
\ No newline at end of file
Binary file srcanamdw/codescanner/BuildParserdoc/BuildParser.doc has changed
Binary file srcanamdw/codescanner/MIT license.doc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/MIT_license.txt	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,13 @@
+
+Copyright 1991 by the Massachusetts Institute of Technology
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation, and that the name of M.I.T. not be used in advertising or
+publicity pertaining to distribution of the software without specific,
+written prior permission.  M.I.T. makes no representations about the
+suitability of this software for any purpose.  It is provided "as is"
+without express or implied warranty.
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/Readme.txt	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,69 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# #################################################################
+
+CodeScanner is primarily made up of 2 parts :
+
+-- The main body, found in /scripts/linescanner.py, handles the scanning of 
+source file, importing rules from individual python scripts, creating and 
+formatting output HTML files, and other misc functions.
+
+-- Individual Python scripts, found in other files in /scripts. Each of these 
+scripts correspond to a unique problem checked by CodeScanner. To extend 
+CodeScanner, simply add new scripts for problems to be checked.
+
+
+Some other files/directories found in the CodeScanner tree:
+
+-- The script Buildparser.py is used to collect and combine all the Python scripts 
+found in /script with the main body and any localized strings. The result is a 
+single script that can be executed by the Python interpreter. Documentation for
+BuildParser can be found in /BuildParserdoc.
+
+-- The batch file buildtools.bat uses Buildparser.py to generate a single Python
+script, which is then converted into a stand alone executable. 
+
+-- /script/resource contains the string resource files that are used for storing 
+localized strings for CodeScanner.
+
+====================
+Building CodeScanner
+====================
+
+Because CodeScanner is written as Python scripts, one needs the Python interpretor 
+to compile these scripts. Besides from the standard Python installation, one also 
+needs the pywin32 package and the Psyco extension module. 
+Go to <http://python.org/> for the latest version of Python and pywin32 package.
+Go to <http://psyco.sourceforge.net/> for the latest version of Psyco.
+
+To build CodeScanner do the following :
+
+1) open a console window and set current directory to :
+
+..../codescanner
+
+2) type the following command in the console window :
+
+python pyinstaller/configure.py
+
+This will configure pyinstaller, a 3rd party utility responsible for making CodeScanner
+a stand-alone command line tool.
+
+3) execute the batch file "buildtools.bat".
+
+4) at this point you should have the file CodeScanner.exe and other runtime modules in
+the directory /discodescanner.
Binary file srcanamdw/codescanner/buildcodescanner/codescanner.exe has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/buildcodescanner/out0.toc	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,9 @@
+(['pyinstaller\\support\\_mountzlib.py',
+  'pyinstaller\\support\\useUnicode.py',
+  'codescanner.py'],
+ ['S:\\codescanner'],
+ None,
+ None,
+ [('_mountzlib', 'pyinstaller\\support\\_mountzlib.py', 'PYSOURCE'), ('useUnicode', 'pyinstaller\\support\\useUnicode.py', 'PYSOURCE'), ('codescanner', 'codescanner.py', 'PYSOURCE')],
+ [('encodings.cp932', 'c:\\apps\\actpython\\lib\\encodings\\cp932.pyc', 'PYMODULE'), ('xml.sax.expatreader', 'c:\\apps\\actpython\\lib\\xml\\sax\\expatreader.pyc', 'PYMODULE'), ('encodings.big5', 'c:\\apps\\actpython\\lib\\encodings\\big5.pyc', 'PYMODULE'), ('encodings.cp1140', 'c:\\apps\\actpython\\lib\\encodings\\cp1140.pyc', 'PYMODULE'), ('base64', 'c:\\apps\\actpython\\lib\\base64.pyc', 'PYMODULE'), ('encodings.euc_jis_2004', 'c:\\apps\\actpython\\lib\\encodings\\euc_jis_2004.pyc', 'PYMODULE'), ('encodings.utf_7', 'c:\\apps\\actpython\\lib\\encodings\\utf_7.pyc', 'PYMODULE'), ('string', 'c:\\apps\\actpython\\lib\\string.pyc', 'PYMODULE'), ('encodings.utf_8', 'c:\\apps\\actpython\\lib\\encodings\\utf_8.pyc', 'PYMODULE'), ('email.quoprimime', 'c:\\apps\\actpython\\lib\\email\\quoprimime.pyc', 'PYMODULE'), ('os2emxpath', 'c:\\apps\\actpython\\lib\\os2emxpath.pyc', 'PYMODULE'), ('encodings.iso8859_9', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_9.pyc', 'PYMODULE'), ('encodings.iso8859_8', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_8.pyc', 'PYMODULE'), ('encodings.iso8859_3', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_3.pyc', 'PYMODULE'), ('encodings.iso8859_2', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_2.pyc', 'PYMODULE'), ('encodings.iso8859_1', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_1.pyc', 'PYMODULE'), ('encodings.iso8859_7', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_7.pyc', 'PYMODULE'), ('encodings.iso8859_6', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_6.pyc', 'PYMODULE'), ('encodings.iso8859_5', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_5.pyc', 'PYMODULE'), ('encodings.iso8859_4', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_4.pyc', 'PYMODULE'), ('encodings.gbk', 'c:\\apps\\actpython\\lib\\encodings\\gbk.pyc', 'PYMODULE'), ('encodings.palmos', 'c:\\apps\\actpython\\lib\\encodings\\palmos.pyc', 'PYMODULE'), ('ntpath', 'c:\\apps\\actpython\\lib\\ntpath.pyc', 'PYMODULE'), ('optparse', 'S:\\codescanner\\pyinstaller\\optparse.pyc', 'PYMODULE'), ('encodings.iso2022_jp_1', 'c:\\apps\\actpython\\lib\\encodings\\iso2022_jp_1.pyc', 'PYMODULE'), ('encodings.iso2022_jp_3', 'c:\\apps\\actpython\\lib\\encodings\\iso2022_jp_3.pyc', 'PYMODULE'), ('encodings.iso2022_jp_2', 'c:\\apps\\actpython\\lib\\encodings\\iso2022_jp_2.pyc', 'PYMODULE'), ('codecs', 'c:\\apps\\actpython\\lib\\codecs.pyc', 'PYMODULE'), ('StringIO', 'c:\\apps\\actpython\\lib\\StringIO.pyc', 'PYMODULE'), ('weakref', 'c:\\apps\\actpython\\lib\\weakref.pyc', 'PYMODULE'), ('xml.dom.xmlbuilder', 'c:\\apps\\actpython\\lib\\xml\\dom\\xmlbuilder.pyc', 'PYMODULE'), ('xml.dom.expatbuilder', 'c:\\apps\\actpython\\lib\\xml\\dom\\expatbuilder.pyc', 'PYMODULE'), ('encodings.cp875', 'c:\\apps\\actpython\\lib\\encodings\\cp875.pyc', 'PYMODULE'), ('encodings.cp874', 'c:\\apps\\actpython\\lib\\encodings\\cp874.pyc', 'PYMODULE'), ('email.charset', 'c:\\apps\\actpython\\lib\\email\\charset.pyc', 'PYMODULE'), ('encodings.punycode', 'c:\\apps\\actpython\\lib\\encodings\\punycode.pyc', 'PYMODULE'), ('encodings.cp1258', 'c:\\apps\\actpython\\lib\\encodings\\cp1258.pyc', 'PYMODULE'), ('email._parseaddr', 'c:\\apps\\actpython\\lib\\email\\_parseaddr.pyc', 'PYMODULE'), ('tokenize', 'c:\\apps\\actpython\\lib\\tokenize.pyc', 'PYMODULE'), ('encodings.charmap', 'c:\\apps\\actpython\\lib\\encodings\\charmap.pyc', 'PYMODULE'), ('encodings.cp1006', 'c:\\apps\\actpython\\lib\\encodings\\cp1006.pyc', 'PYMODULE'), ('encodings.cp424', 'c:\\apps\\actpython\\lib\\encodings\\cp424.pyc', 'PYMODULE'), ('encodings.iso2022_kr', 'c:\\apps\\actpython\\lib\\encodings\\iso2022_kr.pyc', 'PYMODULE'), ('encodings.aliases', 'c:\\apps\\actpython\\lib\\encodings\\aliases.pyc', 'PYMODULE'), ('xml.sax._exceptions', 'c:\\apps\\actpython\\lib\\xml\\sax\\_exceptions.pyc', 'PYMODULE'), ('encodings.hz', 'c:\\apps\\actpython\\lib\\encodings\\hz.pyc', 'PYMODULE'), ('encodings.utf_16', 'c:\\apps\\actpython\\lib\\encodings\\utf_16.pyc', 'PYMODULE'), ('encodings.cp1257', 'c:\\apps\\actpython\\lib\\encodings\\cp1257.pyc', 'PYMODULE'), ('encodings.cp1256', 'c:\\apps\\actpython\\lib\\encodings\\cp1256.pyc', 'PYMODULE'), ('encodings.cp1255', 'c:\\apps\\actpython\\lib\\encodings\\cp1255.pyc', 'PYMODULE'), ('encodings.cp1254', 'c:\\apps\\actpython\\lib\\encodings\\cp1254.pyc', 'PYMODULE'), ('encodings.cp1253', 'c:\\apps\\actpython\\lib\\encodings\\cp1253.pyc', 'PYMODULE'), ('encodings.cp1252', 'c:\\apps\\actpython\\lib\\encodings\\cp1252.pyc', 'PYMODULE'), ('encodings.cp1251', 'c:\\apps\\actpython\\lib\\encodings\\cp1251.pyc', 'PYMODULE'), ('encodings.cp1250', 'c:\\apps\\actpython\\lib\\encodings\\cp1250.pyc', 'PYMODULE'), ('email.message', 'c:\\apps\\actpython\\lib\\email\\message.pyc', 'PYMODULE'), ('encodings.shift_jis', 'c:\\apps\\actpython\\lib\\encodings\\shift_jis.pyc', 'PYMODULE'), ('optik.help', 'S:\\codescanner\\pyinstaller\\optik\\help.pyc', 'PYMODULE'), ('encodings.shift_jisx0213', 'c:\\apps\\actpython\\lib\\encodings\\shift_jisx0213.pyc', 'PYMODULE'), ('email.parser', 'c:\\apps\\actpython\\lib\\email\\parser.pyc', 'PYMODULE'), ('types', 'c:\\apps\\actpython\\lib\\types.pyc', 'PYMODULE'), ('email.base64mime', 'c:\\apps\\actpython\\lib\\email\\base64mime.pyc', 'PYMODULE'), ('_strptime', 'c:\\apps\\actpython\\lib\\_strptime.pyc', 'PYMODULE'), ('encodings.cp950', 'c:\\apps\\actpython\\lib\\encodings\\cp950.pyc', 'PYMODULE'), ('tempfile', 'c:\\apps\\actpython\\lib\\tempfile.pyc', 'PYMODULE'), ('gopherlib', 'c:\\apps\\actpython\\lib\\gopherlib.pyc', 'PYMODULE'), ('encodings.base64_codec', 'c:\\apps\\actpython\\lib\\encodings\\base64_codec.pyc', 'PYMODULE'), ('httplib', 'c:\\apps\\actpython\\lib\\httplib.pyc', 'PYMODULE'), ('email.header', 'c:\\apps\\actpython\\lib\\email\\header.pyc', 'PYMODULE'), ('token', 'c:\\apps\\actpython\\lib\\token.pyc', 'PYMODULE'), ('email.encoders', 'c:\\apps\\actpython\\lib\\email\\encoders.pyc', 'PYMODULE'), ('encodings', 'c:\\apps\\actpython\\lib\\encodings\\__init__.pyc', 'PYMODULE'), ('threading', 'c:\\apps\\actpython\\lib\\threading.pyc', 'PYMODULE'), ('re', 'c:\\apps\\actpython\\lib\\re.pyc', 'PYMODULE'), ('encodings.utf_8_sig', 'c:\\apps\\actpython\\lib\\encodings\\utf_8_sig.pyc', 'PYMODULE'), ('encodings.uu_codec', 'c:\\apps\\actpython\\lib\\encodings\\uu_codec.pyc', 'PYMODULE'), ('logging', 'c:\\apps\\actpython\\lib\\logging\\__init__.pyc', 'PYMODULE'), ('encodings.euc_jisx0213', 'c:\\apps\\actpython\\lib\\encodings\\euc_jisx0213.pyc', 'PYMODULE'), ('traceback', 'c:\\apps\\actpython\\lib\\traceback.pyc', 'PYMODULE'), ('encodings.iso2022_jp_2004', 'c:\\apps\\actpython\\lib\\encodings\\iso2022_jp_2004.pyc', 'PYMODULE'), ('encodings.zlib_codec', 'c:\\apps\\actpython\\lib\\encodings\\zlib_codec.pyc', 'PYMODULE'), ('dummy_threading', 'c:\\apps\\actpython\\lib\\dummy_threading.pyc', 'PYMODULE'), ('email.Utils', 'c:\\apps\\actpython\\lib\\email\\Utils.pyc', 'PYMODULE'), ('encodings.mac_centeuro', 'c:\\apps\\actpython\\lib\\encodings\\mac_centeuro.pyc', 'PYMODULE'), ('_LWPCookieJar', 'c:\\apps\\actpython\\lib\\_LWPCookieJar.pyc', 'PYMODULE'), ('posixpath', 'c:\\apps\\actpython\\lib\\posixpath.pyc', 'PYMODULE'), ('encodings.cp737', 'c:\\apps\\actpython\\lib\\encodings\\cp737.pyc', 'PYMODULE'), ('encodings.utf_16_be', 'c:\\apps\\actpython\\lib\\encodings\\utf_16_be.pyc', 'PYMODULE'), ('email.feedparser', 'c:\\apps\\actpython\\lib\\email\\feedparser.pyc', 'PYMODULE'), ('hashlib', 'c:\\apps\\actpython\\lib\\hashlib.pyc', 'PYMODULE'), ('stringprep', 'c:\\apps\\actpython\\lib\\stringprep.pyc', 'PYMODULE'), ('encodings.unicode_internal', 'c:\\apps\\actpython\\lib\\encodings\\unicode_internal.pyc', 'PYMODULE'), ('encodings.mac_turkish', 'c:\\apps\\actpython\\lib\\encodings\\mac_turkish.pyc', 'PYMODULE'), ('encodings.mac_cyrillic', 'c:\\apps\\actpython\\lib\\encodings\\mac_cyrillic.pyc', 'PYMODULE'), ('encodings.euc_jp', 'c:\\apps\\actpython\\lib\\encodings\\euc_jp.pyc', 'PYMODULE'), ('sre_compile', 'c:\\apps\\actpython\\lib\\sre_compile.pyc', 'PYMODULE'), ('getpass', 'c:\\apps\\actpython\\lib\\getpass.pyc', 'PYMODULE'), ('encodings.string_escape', 'c:\\apps\\actpython\\lib\\encodings\\string_escape.pyc', 'PYMODULE'), ('encodings.quopri_codec', 'c:\\apps\\actpython\\lib\\encodings\\quopri_codec.pyc', 'PYMODULE'), ('xml.dom.minicompat', 'c:\\apps\\actpython\\lib\\xml\\dom\\minicompat.pyc', 'PYMODULE'), ('encodings.cp869', 'c:\\apps\\actpython\\lib\\encodings\\cp869.pyc', 'PYMODULE'), ('encodings.cp866', 'c:\\apps\\actpython\\lib\\encodings\\cp866.pyc', 'PYMODULE'), ('encodings.big5hkscs', 'c:\\apps\\actpython\\lib\\encodings\\big5hkscs.pyc', 'PYMODULE'), ('encodings.cp865', 'c:\\apps\\actpython\\lib\\encodings\\cp865.pyc', 'PYMODULE'), ('encodings.cp862', 'c:\\apps\\actpython\\lib\\encodings\\cp862.pyc', 'PYMODULE'), ('encodings.cp863', 'c:\\apps\\actpython\\lib\\encodings\\cp863.pyc', 'PYMODULE'), ('encodings.cp860', 'c:\\apps\\actpython\\lib\\encodings\\cp860.pyc', 'PYMODULE'), ('encodings.cp861', 'c:\\apps\\actpython\\lib\\encodings\\cp861.pyc', 'PYMODULE'), ('warnings', 'c:\\apps\\actpython\\lib\\warnings.pyc', 'PYMODULE'), ('encodings.ascii', 'c:\\apps\\actpython\\lib\\encodings\\ascii.pyc', 'PYMODULE'), ('optik.textwrap', 'S:\\codescanner\\pyinstaller\\optik\\textwrap.pyc', 'PYMODULE'), ('macurl2path', 'c:\\apps\\actpython\\lib\\macurl2path.pyc', 'PYMODULE'), ('linecache', 'c:\\apps\\actpython\\lib\\linecache.pyc', 'PYMODULE'), ('encodings.rot_13', 'c:\\apps\\actpython\\lib\\encodings\\rot_13.pyc', 'PYMODULE'), ('random', 'c:\\apps\\actpython\\lib\\random.pyc', 'PYMODULE'), ('encodings.iso2022_jp_ext', 'c:\\apps\\actpython\\lib\\encodings\\iso2022_jp_ext.pyc', 'PYMODULE'), ('xml', 'c:\\apps\\actpython\\lib\\xml\\__init__.pyc', 'PYMODULE'), ('copy', 'c:\\apps\\actpython\\lib\\copy.pyc', 'PYMODULE'), ('encodings.cp775', 'c:\\apps\\actpython\\lib\\encodings\\cp775.pyc', 'PYMODULE'), ('encodings.mac_arabic', 'c:\\apps\\actpython\\lib\\encodings\\mac_arabic.pyc', 'PYMODULE'), ('repr', 'c:\\apps\\actpython\\lib\\repr.pyc', 'PYMODULE'), ('cookielib', 'c:\\apps\\actpython\\lib\\cookielib.pyc', 'PYMODULE'), ('bisect', 'c:\\apps\\actpython\\lib\\bisect.pyc', 'PYMODULE'), ('encodings.koi8_u', 'c:\\apps\\actpython\\lib\\encodings\\koi8_u.pyc', 'PYMODULE'), ('optik.option', 'S:\\codescanner\\pyinstaller\\optik\\option.pyc', 'PYMODULE'), ('encodings.gb2312', 'c:\\apps\\actpython\\lib\\encodings\\gb2312.pyc', 'PYMODULE'), ('encodings.cp857', 'c:\\apps\\actpython\\lib\\encodings\\cp857.pyc', 'PYMODULE'), ('encodings.cp856', 'c:\\apps\\actpython\\lib\\encodings\\cp856.pyc', 'PYMODULE'), ('encodings.cp855', 'c:\\apps\\actpython\\lib\\encodings\\cp855.pyc', 'PYMODULE'), ('encodings.cp852', 'c:\\apps\\actpython\\lib\\encodings\\cp852.pyc', 'PYMODULE'), ('encodings.cp850', 'c:\\apps\\actpython\\lib\\encodings\\cp850.pyc', 'PYMODULE'), ('locale', 'c:\\apps\\actpython\\lib\\locale.pyc', 'PYMODULE'), ('popen2', 'c:\\apps\\actpython\\lib\\popen2.pyc', 'PYMODULE'), ('atexit', 'c:\\apps\\actpython\\lib\\atexit.pyc', 'PYMODULE'), ('xml.sax.saxutils', 'c:\\apps\\actpython\\lib\\xml\\sax\\saxutils.pyc', 'PYMODULE'), ('calendar', 'c:\\apps\\actpython\\lib\\calendar.pyc', 'PYMODULE'), ('encodings.shift_jis_2004', 'c:\\apps\\actpython\\lib\\encodings\\shift_jis_2004.pyc', 'PYMODULE'), ('encodings.mac_greek', 'c:\\apps\\actpython\\lib\\encodings\\mac_greek.pyc', 'PYMODULE'), ('urllib', 'c:\\apps\\actpython\\lib\\urllib.pyc', 'PYMODULE'), ('encodings.koi8_r', 'c:\\apps\\actpython\\lib\\encodings\\koi8_r.pyc', 'PYMODULE'), ('_MozillaCookieJar', 'c:\\apps\\actpython\\lib\\_MozillaCookieJar.pyc', 'PYMODULE'), ('email', 'c:\\apps\\actpython\\lib\\email\\__init__.pyc', 'PYMODULE'), ('ftplib', 'c:\\apps\\actpython\\lib\\ftplib.pyc', 'PYMODULE'), ('encodings.cp1026', 'c:\\apps\\actpython\\lib\\encodings\\cp1026.pyc', 'PYMODULE'), ('encodings.undefined', 'c:\\apps\\actpython\\lib\\encodings\\undefined.pyc', 'PYMODULE'), ('encodings.utf_16_le', 'c:\\apps\\actpython\\lib\\encodings\\utf_16_le.pyc', 'PYMODULE'), ('xml.dom.domreg', 'c:\\apps\\actpython\\lib\\xml\\dom\\domreg.pyc', 'PYMODULE'), ('encodings.ptcp154', 'c:\\apps\\actpython\\lib\\encodings\\ptcp154.pyc', 'PYMODULE'), ('xml.parsers', 'c:\\apps\\actpython\\lib\\xml\\parsers\\__init__.pyc', 'PYMODULE'), ('dummy_thread', 'c:\\apps\\actpython\\lib\\dummy_thread.pyc', 'PYMODULE'), ('encodings.unicode_escape', 'c:\\apps\\actpython\\lib\\encodings\\unicode_escape.pyc', 'PYMODULE'), ('sre_constants', 'c:\\apps\\actpython\\lib\\sre_constants.pyc', 'PYMODULE'), ('xml.dom.NodeFilter', 'c:\\apps\\actpython\\lib\\xml\\dom\\NodeFilter.pyc', 'PYMODULE'), ('encodings.hp_roman8', 'c:\\apps\\actpython\\lib\\encodings\\hp_roman8.pyc', 'PYMODULE'), ('email.utils', 'c:\\apps\\actpython\\lib\\email\\utils.pyc', 'PYMODULE'), ('nturl2path', 'c:\\apps\\actpython\\lib\\nturl2path.pyc', 'PYMODULE'), ('encodings.iso8859_16', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_16.pyc', 'PYMODULE'), ('encodings.iso8859_15', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_15.pyc', 'PYMODULE'), ('encodings.iso8859_14', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_14.pyc', 'PYMODULE'), ('encodings.iso8859_13', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_13.pyc', 'PYMODULE'), ('encodings.iso8859_11', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_11.pyc', 'PYMODULE'), ('encodings.iso8859_10', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_10.pyc', 'PYMODULE'), ('copy_reg', 'c:\\apps\\actpython\\lib\\copy_reg.pyc', 'PYMODULE'), ('iu', 'S:\\codescanner\\pyinstaller\\iu.pyc', 'PYMODULE'), ('encodings.hex_codec', 'c:\\apps\\actpython\\lib\\encodings\\hex_codec.pyc', 'PYMODULE'), ('optik.option_parser', 'S:\\codescanner\\pyinstaller\\optik\\option_parser.pyc', 'PYMODULE'), ('rfc822', 'c:\\apps\\actpython\\lib\\rfc822.pyc', 'PYMODULE'), ('optik', 'S:\\codescanner\\pyinstaller\\optik\\__init__.pyc', 'PYMODULE'), ('urlparse', 'c:\\apps\\actpython\\lib\\urlparse.pyc', 'PYMODULE'), ('encodings.idna', 'c:\\apps\\actpython\\lib\\encodings\\idna.pyc', 'PYMODULE'), ('encodings.johab', 'c:\\apps\\actpython\\lib\\encodings\\johab.pyc', 'PYMODULE'), ('email.mime', 'c:\\apps\\actpython\\lib\\email\\mime\\__init__.pyc', 'PYMODULE'), ('struct', 'c:\\apps\\actpython\\lib\\struct.pyc', 'PYMODULE'), ('encodings.mac_latin2', 'c:\\apps\\actpython\\lib\\encodings\\mac_latin2.pyc', 'PYMODULE'), ('encodings.euc_kr', 'c:\\apps\\actpython\\lib\\encodings\\euc_kr.pyc', 'PYMODULE'), ('encodings.cp037', 'c:\\apps\\actpython\\lib\\encodings\\cp037.pyc', 'PYMODULE'), ('encodings.cp864', 'c:\\apps\\actpython\\lib\\encodings\\cp864.pyc', 'PYMODULE'), ('encodings.cp949', 'c:\\apps\\actpython\\lib\\encodings\\cp949.pyc', 'PYMODULE'), ('encodings.bz2_codec', 'c:\\apps\\actpython\\lib\\encodings\\bz2_codec.pyc', 'PYMODULE'), ('encodings.mac_romanian', 'c:\\apps\\actpython\\lib\\encodings\\mac_romanian.pyc', 'PYMODULE'), ('quopri', 'c:\\apps\\actpython\\lib\\quopri.pyc', 'PYMODULE'), ('optik.errors', 'S:\\codescanner\\pyinstaller\\optik\\errors.pyc', 'PYMODULE'), ('stat', 'c:\\apps\\actpython\\lib\\stat.pyc', 'PYMODULE'), ('xml.parsers.expat', 'c:\\apps\\actpython\\lib\\xml\\parsers\\expat.pyc', 'PYMODULE'), ('email.Generator', 'c:\\apps\\actpython\\lib\\email\\Generator.pyc', 'PYMODULE'), ('encodings.mac_iceland', 'c:\\apps\\actpython\\lib\\encodings\\mac_iceland.pyc', 'PYMODULE'), ('encodings.iso2022_jp', 'c:\\apps\\actpython\\lib\\encodings\\iso2022_jp.pyc', 'PYMODULE'), ('email.errors', 'c:\\apps\\actpython\\lib\\email\\errors.pyc', 'PYMODULE'), ('encodings.mac_croatian', 'c:\\apps\\actpython\\lib\\encodings\\mac_croatian.pyc', 'PYMODULE'), ('UserDict', 'c:\\apps\\actpython\\lib\\UserDict.pyc', 'PYMODULE'), ('encodings.mac_farsi', 'c:\\apps\\actpython\\lib\\encodings\\mac_farsi.pyc', 'PYMODULE'), ('email.Iterators', 'c:\\apps\\actpython\\lib\\email\\Iterators.pyc', 'PYMODULE'), ('socket', 'c:\\apps\\actpython\\lib\\socket.pyc', 'PYMODULE'), ('encodings.tis_620', 'c:\\apps\\actpython\\lib\\encodings\\tis_620.pyc', 'PYMODULE'), ('os', 'c:\\apps\\actpython\\lib\\os.pyc', 'PYMODULE'), ('__future__', 'c:\\apps\\actpython\\lib\\__future__.pyc', 'PYMODULE'), ('sre_parse', 'c:\\apps\\actpython\\lib\\sre_parse.pyc', 'PYMODULE'), ('xml.sax.xmlreader', 'c:\\apps\\actpython\\lib\\xml\\sax\\xmlreader.pyc', 'PYMODULE'), ('xml.dom.pulldom', 'c:\\apps\\actpython\\lib\\xml\\dom\\pulldom.pyc', 'PYMODULE'), ('_threading_local', 'c:\\apps\\actpython\\lib\\_threading_local.pyc', 'PYMODULE'), ('encodings.mac_roman', 'c:\\apps\\actpython\\lib\\encodings\\mac_roman.pyc', 'PYMODULE'), ('encodings.cp437', 'c:\\apps\\actpython\\lib\\encodings\\cp437.pyc', 'PYMODULE'), ('encodings.latin_1', 'c:\\apps\\actpython\\lib\\encodings\\latin_1.pyc', 'PYMODULE'), ('xml.sax.handler', 'c:\\apps\\actpython\\lib\\xml\\sax\\handler.pyc', 'PYMODULE'), ('uu', 'c:\\apps\\actpython\\lib\\uu.pyc', 'PYMODULE'), ('xml.dom.minidom', 'c:\\apps\\actpython\\lib\\xml\\dom\\minidom.pyc', 'PYMODULE'), ('encodings.cp500', 'c:\\apps\\actpython\\lib\\encodings\\cp500.pyc', 'PYMODULE'), ('encodings.gb18030', 'c:\\apps\\actpython\\lib\\encodings\\gb18030.pyc', 'PYMODULE'), ('mimetools', 'c:\\apps\\actpython\\lib\\mimetools.pyc', 'PYMODULE'), ('xml.sax', 'c:\\apps\\actpython\\lib\\xml\\sax\\__init__.pyc', 'PYMODULE'), ('archive', 'S:\\codescanner\\pyinstaller\\archive.pyc', 'PYMODULE'), ('gettext', 'c:\\apps\\actpython\\lib\\gettext.pyc', 'PYMODULE'), ('getopt', 'c:\\apps\\actpython\\lib\\getopt.pyc', 'PYMODULE'), ('mimetypes', 'c:\\apps\\actpython\\lib\\mimetypes.pyc', 'PYMODULE'), ('urllib2', 'c:\\apps\\actpython\\lib\\urllib2.pyc', 'PYMODULE'), ('xml.dom', 'c:\\apps\\actpython\\lib\\xml\\dom\\__init__.pyc', 'PYMODULE'), ('encodings.raw_unicode_escape', 'c:\\apps\\actpython\\lib\\encodings\\raw_unicode_escape.pyc', 'PYMODULE'), ('encodings.mbcs', 'c:\\apps\\actpython\\lib\\encodings\\mbcs.pyc', 'PYMODULE')],
+ [('unicodedata', 'c:\\apps\\actpython\\DLLs\\unicodedata.pyd', 'EXTENSION'), ('_hashlib', 'c:\\apps\\actpython\\DLLs\\_hashlib.pyd', 'EXTENSION'), ('bz2', 'c:\\apps\\actpython\\DLLs\\bz2.pyd', 'EXTENSION'), ('_ssl', 'c:\\apps\\actpython\\DLLs\\_ssl.pyd', 'EXTENSION'), ('pyexpat', 'c:\\apps\\actpython\\DLLs\\pyexpat.pyd', 'EXTENSION'), ('win32api', 'c:\\apps\\actpython\\lib\\site-packages\\win32\\win32api.pyd', 'EXTENSION'), ('_socket', 'c:\\apps\\actpython\\DLLs\\_socket.pyd', 'EXTENSION'), ('python25.dll', 'C:\\WINNT\\system32\\python25.dll', 'BINARY'), ('MSVCR71.dll', 'C:\\WINNT\\system32\\MSVCR71.dll', 'BINARY'), ('pywintypes25.dll', 'C:\\WINNT\\system32\\pywintypes25.dll', 'BINARY')])
Binary file srcanamdw/codescanner/buildcodescanner/out1.pyz has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/buildcodescanner/out1.toc	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,3 @@
+('S:\\codescanner\\buildcodescanner\\out1.pyz',
+ 9,
+ [('encodings.cp932', 'c:\\apps\\actpython\\lib\\encodings\\cp932.pyc', 'PYMODULE'), ('xml.sax.expatreader', 'c:\\apps\\actpython\\lib\\xml\\sax\\expatreader.pyc', 'PYMODULE'), ('encodings.big5', 'c:\\apps\\actpython\\lib\\encodings\\big5.pyc', 'PYMODULE'), ('encodings.cp1140', 'c:\\apps\\actpython\\lib\\encodings\\cp1140.pyc', 'PYMODULE'), ('base64', 'c:\\apps\\actpython\\lib\\base64.pyc', 'PYMODULE'), ('encodings.euc_jis_2004', 'c:\\apps\\actpython\\lib\\encodings\\euc_jis_2004.pyc', 'PYMODULE'), ('encodings.utf_7', 'c:\\apps\\actpython\\lib\\encodings\\utf_7.pyc', 'PYMODULE'), ('string', 'c:\\apps\\actpython\\lib\\string.pyc', 'PYMODULE'), ('encodings.utf_8', 'c:\\apps\\actpython\\lib\\encodings\\utf_8.pyc', 'PYMODULE'), ('email.quoprimime', 'c:\\apps\\actpython\\lib\\email\\quoprimime.pyc', 'PYMODULE'), ('os2emxpath', 'c:\\apps\\actpython\\lib\\os2emxpath.pyc', 'PYMODULE'), ('encodings.iso8859_9', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_9.pyc', 'PYMODULE'), ('encodings.iso8859_8', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_8.pyc', 'PYMODULE'), ('encodings.iso8859_3', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_3.pyc', 'PYMODULE'), ('encodings.iso8859_2', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_2.pyc', 'PYMODULE'), ('encodings.iso8859_1', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_1.pyc', 'PYMODULE'), ('encodings.iso8859_7', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_7.pyc', 'PYMODULE'), ('encodings.iso8859_6', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_6.pyc', 'PYMODULE'), ('encodings.iso8859_5', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_5.pyc', 'PYMODULE'), ('encodings.iso8859_4', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_4.pyc', 'PYMODULE'), ('encodings.gbk', 'c:\\apps\\actpython\\lib\\encodings\\gbk.pyc', 'PYMODULE'), ('encodings.palmos', 'c:\\apps\\actpython\\lib\\encodings\\palmos.pyc', 'PYMODULE'), ('ntpath', 'c:\\apps\\actpython\\lib\\ntpath.pyc', 'PYMODULE'), ('optparse', 'S:\\codescanner\\pyinstaller\\optparse.pyc', 'PYMODULE'), ('encodings.iso2022_jp_1', 'c:\\apps\\actpython\\lib\\encodings\\iso2022_jp_1.pyc', 'PYMODULE'), ('encodings.iso2022_jp_3', 'c:\\apps\\actpython\\lib\\encodings\\iso2022_jp_3.pyc', 'PYMODULE'), ('encodings.iso2022_jp_2', 'c:\\apps\\actpython\\lib\\encodings\\iso2022_jp_2.pyc', 'PYMODULE'), ('codecs', 'c:\\apps\\actpython\\lib\\codecs.pyc', 'PYMODULE'), ('StringIO', 'c:\\apps\\actpython\\lib\\StringIO.pyc', 'PYMODULE'), ('weakref', 'c:\\apps\\actpython\\lib\\weakref.pyc', 'PYMODULE'), ('xml.dom.xmlbuilder', 'c:\\apps\\actpython\\lib\\xml\\dom\\xmlbuilder.pyc', 'PYMODULE'), ('xml.dom.expatbuilder', 'c:\\apps\\actpython\\lib\\xml\\dom\\expatbuilder.pyc', 'PYMODULE'), ('encodings.cp875', 'c:\\apps\\actpython\\lib\\encodings\\cp875.pyc', 'PYMODULE'), ('encodings.cp874', 'c:\\apps\\actpython\\lib\\encodings\\cp874.pyc', 'PYMODULE'), ('email.charset', 'c:\\apps\\actpython\\lib\\email\\charset.pyc', 'PYMODULE'), ('encodings.punycode', 'c:\\apps\\actpython\\lib\\encodings\\punycode.pyc', 'PYMODULE'), ('encodings.cp1258', 'c:\\apps\\actpython\\lib\\encodings\\cp1258.pyc', 'PYMODULE'), ('email._parseaddr', 'c:\\apps\\actpython\\lib\\email\\_parseaddr.pyc', 'PYMODULE'), ('tokenize', 'c:\\apps\\actpython\\lib\\tokenize.pyc', 'PYMODULE'), ('encodings.charmap', 'c:\\apps\\actpython\\lib\\encodings\\charmap.pyc', 'PYMODULE'), ('encodings.cp1006', 'c:\\apps\\actpython\\lib\\encodings\\cp1006.pyc', 'PYMODULE'), ('encodings.cp424', 'c:\\apps\\actpython\\lib\\encodings\\cp424.pyc', 'PYMODULE'), ('encodings.iso2022_kr', 'c:\\apps\\actpython\\lib\\encodings\\iso2022_kr.pyc', 'PYMODULE'), ('encodings.aliases', 'c:\\apps\\actpython\\lib\\encodings\\aliases.pyc', 'PYMODULE'), ('xml.sax._exceptions', 'c:\\apps\\actpython\\lib\\xml\\sax\\_exceptions.pyc', 'PYMODULE'), ('encodings.hz', 'c:\\apps\\actpython\\lib\\encodings\\hz.pyc', 'PYMODULE'), ('encodings.utf_16', 'c:\\apps\\actpython\\lib\\encodings\\utf_16.pyc', 'PYMODULE'), ('encodings.cp1257', 'c:\\apps\\actpython\\lib\\encodings\\cp1257.pyc', 'PYMODULE'), ('encodings.cp1256', 'c:\\apps\\actpython\\lib\\encodings\\cp1256.pyc', 'PYMODULE'), ('encodings.cp1255', 'c:\\apps\\actpython\\lib\\encodings\\cp1255.pyc', 'PYMODULE'), ('encodings.cp1254', 'c:\\apps\\actpython\\lib\\encodings\\cp1254.pyc', 'PYMODULE'), ('encodings.cp1253', 'c:\\apps\\actpython\\lib\\encodings\\cp1253.pyc', 'PYMODULE'), ('encodings.cp1252', 'c:\\apps\\actpython\\lib\\encodings\\cp1252.pyc', 'PYMODULE'), ('encodings.cp1251', 'c:\\apps\\actpython\\lib\\encodings\\cp1251.pyc', 'PYMODULE'), ('encodings.cp1250', 'c:\\apps\\actpython\\lib\\encodings\\cp1250.pyc', 'PYMODULE'), ('email.message', 'c:\\apps\\actpython\\lib\\email\\message.pyc', 'PYMODULE'), ('encodings.shift_jis', 'c:\\apps\\actpython\\lib\\encodings\\shift_jis.pyc', 'PYMODULE'), ('optik.help', 'S:\\codescanner\\pyinstaller\\optik\\help.pyc', 'PYMODULE'), ('encodings.shift_jisx0213', 'c:\\apps\\actpython\\lib\\encodings\\shift_jisx0213.pyc', 'PYMODULE'), ('email.parser', 'c:\\apps\\actpython\\lib\\email\\parser.pyc', 'PYMODULE'), ('types', 'c:\\apps\\actpython\\lib\\types.pyc', 'PYMODULE'), ('email.base64mime', 'c:\\apps\\actpython\\lib\\email\\base64mime.pyc', 'PYMODULE'), ('_strptime', 'c:\\apps\\actpython\\lib\\_strptime.pyc', 'PYMODULE'), ('encodings.cp950', 'c:\\apps\\actpython\\lib\\encodings\\cp950.pyc', 'PYMODULE'), ('tempfile', 'c:\\apps\\actpython\\lib\\tempfile.pyc', 'PYMODULE'), ('gopherlib', 'c:\\apps\\actpython\\lib\\gopherlib.pyc', 'PYMODULE'), ('encodings.base64_codec', 'c:\\apps\\actpython\\lib\\encodings\\base64_codec.pyc', 'PYMODULE'), ('httplib', 'c:\\apps\\actpython\\lib\\httplib.pyc', 'PYMODULE'), ('email.header', 'c:\\apps\\actpython\\lib\\email\\header.pyc', 'PYMODULE'), ('token', 'c:\\apps\\actpython\\lib\\token.pyc', 'PYMODULE'), ('email.encoders', 'c:\\apps\\actpython\\lib\\email\\encoders.pyc', 'PYMODULE'), ('encodings', 'c:\\apps\\actpython\\lib\\encodings\\__init__.pyc', 'PYMODULE'), ('threading', 'c:\\apps\\actpython\\lib\\threading.pyc', 'PYMODULE'), ('re', 'c:\\apps\\actpython\\lib\\re.pyc', 'PYMODULE'), ('encodings.utf_8_sig', 'c:\\apps\\actpython\\lib\\encodings\\utf_8_sig.pyc', 'PYMODULE'), ('encodings.uu_codec', 'c:\\apps\\actpython\\lib\\encodings\\uu_codec.pyc', 'PYMODULE'), ('logging', 'c:\\apps\\actpython\\lib\\logging\\__init__.pyc', 'PYMODULE'), ('encodings.euc_jisx0213', 'c:\\apps\\actpython\\lib\\encodings\\euc_jisx0213.pyc', 'PYMODULE'), ('traceback', 'c:\\apps\\actpython\\lib\\traceback.pyc', 'PYMODULE'), ('encodings.iso2022_jp_2004', 'c:\\apps\\actpython\\lib\\encodings\\iso2022_jp_2004.pyc', 'PYMODULE'), ('encodings.zlib_codec', 'c:\\apps\\actpython\\lib\\encodings\\zlib_codec.pyc', 'PYMODULE'), ('dummy_threading', 'c:\\apps\\actpython\\lib\\dummy_threading.pyc', 'PYMODULE'), ('email.Utils', 'c:\\apps\\actpython\\lib\\email\\Utils.pyc', 'PYMODULE'), ('encodings.mac_centeuro', 'c:\\apps\\actpython\\lib\\encodings\\mac_centeuro.pyc', 'PYMODULE'), ('_LWPCookieJar', 'c:\\apps\\actpython\\lib\\_LWPCookieJar.pyc', 'PYMODULE'), ('posixpath', 'c:\\apps\\actpython\\lib\\posixpath.pyc', 'PYMODULE'), ('encodings.cp737', 'c:\\apps\\actpython\\lib\\encodings\\cp737.pyc', 'PYMODULE'), ('encodings.utf_16_be', 'c:\\apps\\actpython\\lib\\encodings\\utf_16_be.pyc', 'PYMODULE'), ('email.feedparser', 'c:\\apps\\actpython\\lib\\email\\feedparser.pyc', 'PYMODULE'), ('hashlib', 'c:\\apps\\actpython\\lib\\hashlib.pyc', 'PYMODULE'), ('stringprep', 'c:\\apps\\actpython\\lib\\stringprep.pyc', 'PYMODULE'), ('encodings.unicode_internal', 'c:\\apps\\actpython\\lib\\encodings\\unicode_internal.pyc', 'PYMODULE'), ('encodings.mac_turkish', 'c:\\apps\\actpython\\lib\\encodings\\mac_turkish.pyc', 'PYMODULE'), ('encodings.mac_cyrillic', 'c:\\apps\\actpython\\lib\\encodings\\mac_cyrillic.pyc', 'PYMODULE'), ('encodings.euc_jp', 'c:\\apps\\actpython\\lib\\encodings\\euc_jp.pyc', 'PYMODULE'), ('sre_compile', 'c:\\apps\\actpython\\lib\\sre_compile.pyc', 'PYMODULE'), ('getpass', 'c:\\apps\\actpython\\lib\\getpass.pyc', 'PYMODULE'), ('encodings.string_escape', 'c:\\apps\\actpython\\lib\\encodings\\string_escape.pyc', 'PYMODULE'), ('encodings.quopri_codec', 'c:\\apps\\actpython\\lib\\encodings\\quopri_codec.pyc', 'PYMODULE'), ('xml.dom.minicompat', 'c:\\apps\\actpython\\lib\\xml\\dom\\minicompat.pyc', 'PYMODULE'), ('encodings.cp869', 'c:\\apps\\actpython\\lib\\encodings\\cp869.pyc', 'PYMODULE'), ('encodings.cp866', 'c:\\apps\\actpython\\lib\\encodings\\cp866.pyc', 'PYMODULE'), ('encodings.big5hkscs', 'c:\\apps\\actpython\\lib\\encodings\\big5hkscs.pyc', 'PYMODULE'), ('encodings.cp865', 'c:\\apps\\actpython\\lib\\encodings\\cp865.pyc', 'PYMODULE'), ('encodings.cp862', 'c:\\apps\\actpython\\lib\\encodings\\cp862.pyc', 'PYMODULE'), ('encodings.cp863', 'c:\\apps\\actpython\\lib\\encodings\\cp863.pyc', 'PYMODULE'), ('encodings.cp860', 'c:\\apps\\actpython\\lib\\encodings\\cp860.pyc', 'PYMODULE'), ('encodings.cp861', 'c:\\apps\\actpython\\lib\\encodings\\cp861.pyc', 'PYMODULE'), ('warnings', 'c:\\apps\\actpython\\lib\\warnings.pyc', 'PYMODULE'), ('encodings.ascii', 'c:\\apps\\actpython\\lib\\encodings\\ascii.pyc', 'PYMODULE'), ('optik.textwrap', 'S:\\codescanner\\pyinstaller\\optik\\textwrap.pyc', 'PYMODULE'), ('macurl2path', 'c:\\apps\\actpython\\lib\\macurl2path.pyc', 'PYMODULE'), ('linecache', 'c:\\apps\\actpython\\lib\\linecache.pyc', 'PYMODULE'), ('encodings.rot_13', 'c:\\apps\\actpython\\lib\\encodings\\rot_13.pyc', 'PYMODULE'), ('random', 'c:\\apps\\actpython\\lib\\random.pyc', 'PYMODULE'), ('encodings.iso2022_jp_ext', 'c:\\apps\\actpython\\lib\\encodings\\iso2022_jp_ext.pyc', 'PYMODULE'), ('xml', 'c:\\apps\\actpython\\lib\\xml\\__init__.pyc', 'PYMODULE'), ('copy', 'c:\\apps\\actpython\\lib\\copy.pyc', 'PYMODULE'), ('encodings.cp775', 'c:\\apps\\actpython\\lib\\encodings\\cp775.pyc', 'PYMODULE'), ('encodings.mac_arabic', 'c:\\apps\\actpython\\lib\\encodings\\mac_arabic.pyc', 'PYMODULE'), ('repr', 'c:\\apps\\actpython\\lib\\repr.pyc', 'PYMODULE'), ('cookielib', 'c:\\apps\\actpython\\lib\\cookielib.pyc', 'PYMODULE'), ('bisect', 'c:\\apps\\actpython\\lib\\bisect.pyc', 'PYMODULE'), ('encodings.koi8_u', 'c:\\apps\\actpython\\lib\\encodings\\koi8_u.pyc', 'PYMODULE'), ('optik.option', 'S:\\codescanner\\pyinstaller\\optik\\option.pyc', 'PYMODULE'), ('encodings.gb2312', 'c:\\apps\\actpython\\lib\\encodings\\gb2312.pyc', 'PYMODULE'), ('encodings.cp857', 'c:\\apps\\actpython\\lib\\encodings\\cp857.pyc', 'PYMODULE'), ('encodings.cp856', 'c:\\apps\\actpython\\lib\\encodings\\cp856.pyc', 'PYMODULE'), ('encodings.cp855', 'c:\\apps\\actpython\\lib\\encodings\\cp855.pyc', 'PYMODULE'), ('encodings.cp852', 'c:\\apps\\actpython\\lib\\encodings\\cp852.pyc', 'PYMODULE'), ('encodings.cp850', 'c:\\apps\\actpython\\lib\\encodings\\cp850.pyc', 'PYMODULE'), ('locale', 'c:\\apps\\actpython\\lib\\locale.pyc', 'PYMODULE'), ('popen2', 'c:\\apps\\actpython\\lib\\popen2.pyc', 'PYMODULE'), ('atexit', 'c:\\apps\\actpython\\lib\\atexit.pyc', 'PYMODULE'), ('xml.sax.saxutils', 'c:\\apps\\actpython\\lib\\xml\\sax\\saxutils.pyc', 'PYMODULE'), ('calendar', 'c:\\apps\\actpython\\lib\\calendar.pyc', 'PYMODULE'), ('encodings.shift_jis_2004', 'c:\\apps\\actpython\\lib\\encodings\\shift_jis_2004.pyc', 'PYMODULE'), ('encodings.mac_greek', 'c:\\apps\\actpython\\lib\\encodings\\mac_greek.pyc', 'PYMODULE'), ('urllib', 'c:\\apps\\actpython\\lib\\urllib.pyc', 'PYMODULE'), ('encodings.koi8_r', 'c:\\apps\\actpython\\lib\\encodings\\koi8_r.pyc', 'PYMODULE'), ('_MozillaCookieJar', 'c:\\apps\\actpython\\lib\\_MozillaCookieJar.pyc', 'PYMODULE'), ('email', 'c:\\apps\\actpython\\lib\\email\\__init__.pyc', 'PYMODULE'), ('ftplib', 'c:\\apps\\actpython\\lib\\ftplib.pyc', 'PYMODULE'), ('encodings.cp1026', 'c:\\apps\\actpython\\lib\\encodings\\cp1026.pyc', 'PYMODULE'), ('encodings.undefined', 'c:\\apps\\actpython\\lib\\encodings\\undefined.pyc', 'PYMODULE'), ('encodings.utf_16_le', 'c:\\apps\\actpython\\lib\\encodings\\utf_16_le.pyc', 'PYMODULE'), ('xml.dom.domreg', 'c:\\apps\\actpython\\lib\\xml\\dom\\domreg.pyc', 'PYMODULE'), ('encodings.ptcp154', 'c:\\apps\\actpython\\lib\\encodings\\ptcp154.pyc', 'PYMODULE'), ('xml.parsers', 'c:\\apps\\actpython\\lib\\xml\\parsers\\__init__.pyc', 'PYMODULE'), ('dummy_thread', 'c:\\apps\\actpython\\lib\\dummy_thread.pyc', 'PYMODULE'), ('encodings.unicode_escape', 'c:\\apps\\actpython\\lib\\encodings\\unicode_escape.pyc', 'PYMODULE'), ('sre_constants', 'c:\\apps\\actpython\\lib\\sre_constants.pyc', 'PYMODULE'), ('xml.dom.NodeFilter', 'c:\\apps\\actpython\\lib\\xml\\dom\\NodeFilter.pyc', 'PYMODULE'), ('encodings.hp_roman8', 'c:\\apps\\actpython\\lib\\encodings\\hp_roman8.pyc', 'PYMODULE'), ('email.utils', 'c:\\apps\\actpython\\lib\\email\\utils.pyc', 'PYMODULE'), ('nturl2path', 'c:\\apps\\actpython\\lib\\nturl2path.pyc', 'PYMODULE'), ('encodings.iso8859_16', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_16.pyc', 'PYMODULE'), ('encodings.iso8859_15', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_15.pyc', 'PYMODULE'), ('encodings.iso8859_14', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_14.pyc', 'PYMODULE'), ('encodings.iso8859_13', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_13.pyc', 'PYMODULE'), ('encodings.iso8859_11', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_11.pyc', 'PYMODULE'), ('encodings.iso8859_10', 'c:\\apps\\actpython\\lib\\encodings\\iso8859_10.pyc', 'PYMODULE'), ('copy_reg', 'c:\\apps\\actpython\\lib\\copy_reg.pyc', 'PYMODULE'), ('iu', 'S:\\codescanner\\pyinstaller\\iu.pyc', 'PYMODULE'), ('encodings.hex_codec', 'c:\\apps\\actpython\\lib\\encodings\\hex_codec.pyc', 'PYMODULE'), ('optik.option_parser', 'S:\\codescanner\\pyinstaller\\optik\\option_parser.pyc', 'PYMODULE'), ('rfc822', 'c:\\apps\\actpython\\lib\\rfc822.pyc', 'PYMODULE'), ('optik', 'S:\\codescanner\\pyinstaller\\optik\\__init__.pyc', 'PYMODULE'), ('urlparse', 'c:\\apps\\actpython\\lib\\urlparse.pyc', 'PYMODULE'), ('encodings.idna', 'c:\\apps\\actpython\\lib\\encodings\\idna.pyc', 'PYMODULE'), ('encodings.johab', 'c:\\apps\\actpython\\lib\\encodings\\johab.pyc', 'PYMODULE'), ('email.mime', 'c:\\apps\\actpython\\lib\\email\\mime\\__init__.pyc', 'PYMODULE'), ('struct', 'c:\\apps\\actpython\\lib\\struct.pyc', 'PYMODULE'), ('encodings.mac_latin2', 'c:\\apps\\actpython\\lib\\encodings\\mac_latin2.pyc', 'PYMODULE'), ('encodings.euc_kr', 'c:\\apps\\actpython\\lib\\encodings\\euc_kr.pyc', 'PYMODULE'), ('encodings.cp037', 'c:\\apps\\actpython\\lib\\encodings\\cp037.pyc', 'PYMODULE'), ('encodings.cp864', 'c:\\apps\\actpython\\lib\\encodings\\cp864.pyc', 'PYMODULE'), ('encodings.cp949', 'c:\\apps\\actpython\\lib\\encodings\\cp949.pyc', 'PYMODULE'), ('encodings.bz2_codec', 'c:\\apps\\actpython\\lib\\encodings\\bz2_codec.pyc', 'PYMODULE'), ('encodings.mac_romanian', 'c:\\apps\\actpython\\lib\\encodings\\mac_romanian.pyc', 'PYMODULE'), ('quopri', 'c:\\apps\\actpython\\lib\\quopri.pyc', 'PYMODULE'), ('optik.errors', 'S:\\codescanner\\pyinstaller\\optik\\errors.pyc', 'PYMODULE'), ('stat', 'c:\\apps\\actpython\\lib\\stat.pyc', 'PYMODULE'), ('xml.parsers.expat', 'c:\\apps\\actpython\\lib\\xml\\parsers\\expat.pyc', 'PYMODULE'), ('email.Generator', 'c:\\apps\\actpython\\lib\\email\\Generator.pyc', 'PYMODULE'), ('encodings.mac_iceland', 'c:\\apps\\actpython\\lib\\encodings\\mac_iceland.pyc', 'PYMODULE'), ('encodings.iso2022_jp', 'c:\\apps\\actpython\\lib\\encodings\\iso2022_jp.pyc', 'PYMODULE'), ('email.errors', 'c:\\apps\\actpython\\lib\\email\\errors.pyc', 'PYMODULE'), ('encodings.mac_croatian', 'c:\\apps\\actpython\\lib\\encodings\\mac_croatian.pyc', 'PYMODULE'), ('UserDict', 'c:\\apps\\actpython\\lib\\UserDict.pyc', 'PYMODULE'), ('encodings.mac_farsi', 'c:\\apps\\actpython\\lib\\encodings\\mac_farsi.pyc', 'PYMODULE'), ('email.Iterators', 'c:\\apps\\actpython\\lib\\email\\Iterators.pyc', 'PYMODULE'), ('socket', 'c:\\apps\\actpython\\lib\\socket.pyc', 'PYMODULE'), ('encodings.tis_620', 'c:\\apps\\actpython\\lib\\encodings\\tis_620.pyc', 'PYMODULE'), ('os', 'c:\\apps\\actpython\\lib\\os.pyc', 'PYMODULE'), ('__future__', 'c:\\apps\\actpython\\lib\\__future__.pyc', 'PYMODULE'), ('sre_parse', 'c:\\apps\\actpython\\lib\\sre_parse.pyc', 'PYMODULE'), ('xml.sax.xmlreader', 'c:\\apps\\actpython\\lib\\xml\\sax\\xmlreader.pyc', 'PYMODULE'), ('xml.dom.pulldom', 'c:\\apps\\actpython\\lib\\xml\\dom\\pulldom.pyc', 'PYMODULE'), ('_threading_local', 'c:\\apps\\actpython\\lib\\_threading_local.pyc', 'PYMODULE'), ('encodings.mac_roman', 'c:\\apps\\actpython\\lib\\encodings\\mac_roman.pyc', 'PYMODULE'), ('encodings.cp437', 'c:\\apps\\actpython\\lib\\encodings\\cp437.pyc', 'PYMODULE'), ('encodings.latin_1', 'c:\\apps\\actpython\\lib\\encodings\\latin_1.pyc', 'PYMODULE'), ('xml.sax.handler', 'c:\\apps\\actpython\\lib\\xml\\sax\\handler.pyc', 'PYMODULE'), ('uu', 'c:\\apps\\actpython\\lib\\uu.pyc', 'PYMODULE'), ('xml.dom.minidom', 'c:\\apps\\actpython\\lib\\xml\\dom\\minidom.pyc', 'PYMODULE'), ('encodings.cp500', 'c:\\apps\\actpython\\lib\\encodings\\cp500.pyc', 'PYMODULE'), ('encodings.gb18030', 'c:\\apps\\actpython\\lib\\encodings\\gb18030.pyc', 'PYMODULE'), ('mimetools', 'c:\\apps\\actpython\\lib\\mimetools.pyc', 'PYMODULE'), ('xml.sax', 'c:\\apps\\actpython\\lib\\xml\\sax\\__init__.pyc', 'PYMODULE'), ('archive', 'S:\\codescanner\\pyinstaller\\archive.pyc', 'PYMODULE'), ('gettext', 'c:\\apps\\actpython\\lib\\gettext.pyc', 'PYMODULE'), ('getopt', 'c:\\apps\\actpython\\lib\\getopt.pyc', 'PYMODULE'), ('mimetypes', 'c:\\apps\\actpython\\lib\\mimetypes.pyc', 'PYMODULE'), ('urllib2', 'c:\\apps\\actpython\\lib\\urllib2.pyc', 'PYMODULE'), ('xml.dom', 'c:\\apps\\actpython\\lib\\xml\\dom\\__init__.pyc', 'PYMODULE'), ('encodings.raw_unicode_escape', 'c:\\apps\\actpython\\lib\\encodings\\raw_unicode_escape.pyc', 'PYMODULE'), ('encodings.mbcs', 'c:\\apps\\actpython\\lib\\encodings\\mbcs.pyc', 'PYMODULE')])
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/buildcodescanner/out2.toc	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,8 @@
+('S:\\codescanner\\buildcodescanner/codescanner.exe',
+ True,
+ False,
+ None,
+ None,
+ False,
+ False,
+ 1259836213)
Binary file srcanamdw/codescanner/buildcodescanner/out3.pkg has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/buildcodescanner/out3.toc	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,11 @@
+('S:\\codescanner\\buildcodescanner\\out3.pkg',
+ {'BINARY': 1,
+  'DATA': 1,
+  'EXECUTABLE': 1,
+  'EXTENSION': 1,
+  'PYMODULE': 1,
+  'PYSOURCE': 1},
+ [('out1.pyz', 'S:\\codescanner\\buildcodescanner\\out1.pyz', 'PYZ'), ('iu', 'S:\\codescanner\\pyinstaller\\iu.pyc', 'PYMODULE'), ('struct', 'c:\\apps\\actpython\\lib\\struct.pyc', 'PYMODULE'), ('archive', 'S:\\codescanner\\pyinstaller\\archive.pyc', 'PYMODULE'), ('_mountzlib', 'pyinstaller\\support\\_mountzlib.py', 'PYSOURCE'), ('useUnicode', 'pyinstaller\\support\\useUnicode.py', 'PYSOURCE'), ('codescanner', 'codescanner.py', 'PYSOURCE'), ('python25.dll', 'c:\\apps\\actpython\\python25.dll', 'BINARY'), ('MSVCR71.dll', 'C:\\WINNT\\system32\\MSVCR71.dll', 'BINARY')],
+ 1,
+ False,
+ False)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/buildcodescanner/out4.toc	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,4 @@
+('S:\\codescanner\\distcodescanner',
+ False,
+ False,
+ [('codescanner.exe', 'S:\\codescanner\\buildcodescanner/codescanner.exe', 'EXECUTABLE'), ('python25.dll', 'c:\\apps\\actpython\\python25.dll', 'BINARY'), ('MSVCR71.dll', 'C:\\WINNT\\system32\\MSVCR71.dll', 'BINARY'), ('unicodedata', 'c:\\apps\\actpython\\DLLs\\unicodedata.pyd', 'EXTENSION'), ('_hashlib', 'c:\\apps\\actpython\\DLLs\\_hashlib.pyd', 'EXTENSION'), ('bz2', 'c:\\apps\\actpython\\DLLs\\bz2.pyd', 'EXTENSION'), ('_ssl', 'c:\\apps\\actpython\\DLLs\\_ssl.pyd', 'EXTENSION'), ('pyexpat', 'c:\\apps\\actpython\\DLLs\\pyexpat.pyd', 'EXTENSION'), ('win32api', 'c:\\apps\\actpython\\lib\\site-packages\\win32\\win32api.pyd', 'EXTENSION'), ('_socket', 'c:\\apps\\actpython\\DLLs\\_socket.pyd', 'EXTENSION'), ('pywintypes25.dll', 'C:\\WINNT\\system32\\pywintypes25.dll', 'BINARY')])
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/buildtools.bat	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,21 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem 
+@rem Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+@rem 
+@rem * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+@rem * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+@rem * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+@rem 
+@rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+@rem THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+@rem BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+@rem SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+@rem CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.@rem
+@rem
+
+BuildParser.py -s scripts -m scripts\linescanner.py -o codescanner.py -v linescanner  -l scripts\resources\English.loc
+
+python pyinstaller/Makespec.py codescanner.py
+python pyinstaller/Build.py codescanner.spec
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/codescanner.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,8785 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# linescanner.py - the main body of CodeScanner
+#
+# #################################################################
+
+import base64
+import datetime
+import encodings
+import getopt
+import os
+import os.path
+import psyco
+import re
+import sys
+import xml.dom.minidom
+import zlib
+
+# Ignore flags
+KIgnoreNothing = 0
+KIgnoreComments = 1
+KIgnoreCommentsAndQuotes = 2
+KIgnoreQuotes = 3
+
+# Severities for the scripts
+KSeverityHigh = 0
+KSeverityMedium = 1
+KSeverityLow = 2
+
+# The names used in the XML configuration file for severity element names.
+KSeverityConfigMap = {
+			KSeverityHigh		: "high",
+			KSeverityMedium		: "medium",
+			KSeverityLow		: "low"}
+
+# The names used in the HTML summary file for severity element names.
+KSeverityHTMLMap = {
+			KSeverityHigh		: "High",
+			KSeverityMedium		: "Medium",
+			KSeverityLow		: "Low"}
+
+# Categories for the scripts
+KCategoryLegal = "Legal Code" 
+KCategoryDefinitePanic = "Always Panic"
+KCategoryCanPanic = "Can Panic"
+KCategoryWrongFunctionality = "Wrong Functionality"
+KCategoryLocalisation = "Localisation"
+KCategoryPerformance = "Performance"
+KCategoryCodingStandards = "Coding Standard"
+KCategoryDocumentation = "Documentation"
+KCategoryCodeReviewGuides = "Code Review Guide"
+KCategoryOther = "Other"
+
+KCategoryHtmlDisplayOrder = [KCategoryLegal,
+	KCategoryDefinitePanic,
+	KCategoryCanPanic,
+	KCategoryWrongFunctionality,
+	KCategoryLocalisation,
+	KCategoryPerformance,
+	KCategoryCodingStandards,
+	KCategoryDocumentation,
+	KCategoryCodeReviewGuides,
+	KCategoryOther]
+
+# The names used in the XML configuration file for category element names.
+KCategoryConfigMap = {
+			KCategoryLegal				:	"legal", 
+			KCategoryDefinitePanic		:	"panic", 
+			KCategoryCanPanic			:	"canpanic", 
+			KCategoryWrongFunctionality	:	"functionality",
+			KCategoryLocalisation		:	"localisation",
+			KCategoryPerformance		:	"performance",
+			KCategoryCodingStandards	:	"codingstandards",
+			KCategoryDocumentation		:	"documentation",
+			KCategoryCodeReviewGuides	:	"codereview",
+			KCategoryOther				:	"other"}
+
+#Custom rule keyword types
+KKeywordBaseClass = "baseclass"
+KKeywordCall = "call"
+KKeywordClassName = "class"
+KKeywordComment = "comment"
+KKeywordGeneric = "generic"
+KKeywordLocal = "local"
+KKeywordMacro = "macro"
+KKeywordMember = "member"
+KKeywordMethod = "method"
+KKeywordParameter = "parameter"
+KKeywordUnknown = "unknown"
+
+#The names used in the XML configuration file for custom rule keyword types.
+KCustomRuleKeywordMap = {
+			KKeywordBaseClass           :   "baseclass",
+			KKeywordCall                :   "call",
+			KKeywordClassName           :   "class",
+			KKeywordComment             :   "comment",
+			KKeywordGeneric             :   "generic",
+			KKeywordLocal               :   "local",
+			KKeywordMacro               :   "macro",
+			KKeywordMember              :   "member",
+			KKeywordMethod              :   "method",
+			KKeywordParameter           :   "parameter",
+			KKeywordUnknown             :   "unknown"}
+
+KVersion = "Nokia CodeScanner version 2.1.4"
+KCopyrightLine1 = "Copyright (c) 2007-2009. Nokia Corporation. All rights reserved."
+KCopyrightLine1Html = "Copyright &copy; 2007-2009. Nokia Corporation. All rights reserved."
+KCopyrightLine2 = "For product and support information, visit www.forum.nokia.com."
+KWww = "www.forum.nokia.com"
+
+stringPool = {}
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+# English.loc
+# localised string for Script accessArrayElementWithoutCheck
+
+stringPool[ "accessArrayElementWithoutCheck!title" ]       = "Array element accessed by At() function without checking index is within array range"
+stringPool[ "accessArrayElementWithoutCheck!description" ] = "Whenever an element in an array is accessed, the index should be checked to ensure that it is less than array.Count(). CodeScanner checks for explicit calls to a Count() function; so if the array index is checked in a different way, it gives false positives. Accessing an invalid index can cause a panic."
+stringPool[ "accessArrayElementWithoutCheck!ideTitle" ]    = "array element accessed by At() function without checking index is within array range"
+
+# localised string for Script accessArrayElementWithoutCheck2
+stringPool[ "accessArrayElementWithoutCheck2!title" ]       = "Array element accessed by [] without checking range"
+stringPool[ "accessArrayElementWithoutCheck2!description" ] = "Whenever an element in an array is accessed, the index should first be checked to ensure that it is within range. CodeScanner checks for explicit calls to a Count() or Length() function; so if the array index is checked in a different way, it gives false positives. Accessing an invalid index can cause a panic."
+stringPool[ "accessArrayElementWithoutCheck2!ideTitle" ]    = "array element accessed by [] without checking range"
+
+# localised string for Script activestart
+stringPool[ "activestart!title" ]       = "Using CActiveScheduler::Start"
+stringPool[ "activestart!description" ] = "Using CActiveScheduler::Start() can mean that something asynchronous is being made synchronous. Instead, use active objects correctly in an asynchronous way."
+stringPool[ "activestart!ideTitle" ]    = "using CActiveScheduler::Start"
+
+# localised string for Script activestop
+stringPool[ "activestop!title" ]       = "Using CActiveScheduler::Stop"
+stringPool[ "activestop!description" ] = "Using CActiveScheduler::Stop() can mean that something asynchronous is being made synchronous. Instead, use active objects correctly in an asynchronous way."
+stringPool[ "activestop!ideTitle" ]    = "using CActiveScheduler::Stop"
+
+# localised string for Script arraypassing
+stringPool[ "arraypassing!title" ]       = "Passing arrays by value rather than reference"
+stringPool[ "arraypassing!description" ] = "Passing arrays by value causes the array to be copied needlessly, which takes up time and memory. For efficiency, references should be used."
+stringPool[ "arraypassing!ideTitle" ]    = "passing arrays by value rather than reference"
+
+# localised string for Script arrayptrcleanup
+stringPool[ "arrayptrcleanup!title" ]       = "Using local CArrayPtr classes without cleanup items"
+stringPool[ "arrayptrcleanup!description" ] = "It is not enough to push a local CArrayPtr class onto the cleanup stack. A TCleanupItem and callback function must be used to avoid leaking the elements."
+stringPool[ "arrayptrcleanup!ideTitle" ]    = "using local CArrayPtr classes without cleanup items"
+
+# localised string for Script assertdebuginvariant
+stringPool[ "assertdebuginvariant!title" ]       = "__ASSERT_DEBUG with User::Invariant"
+stringPool[ "assertdebuginvariant!description" ] = "Replace __ASSERT_DEBUG(<condition>, User::Invariant()) with ASSERT(<condition>), because it is easier to read."
+stringPool[ "assertdebuginvariant!ideTitle" ]    = "__ASSERT_DEBUG with User::Invariant"
+
+# localised string for Script baddefines
+stringPool[ "baddefines!title" ]       = "Lowercase definition names"
+stringPool[ "baddefines!description" ] = "Badly-named definitions makes the code harder to maintain and can lead to defects."
+stringPool[ "baddefines!ideTitle" ]    = "lowercase definition names"
+
+# localised string for Script baseconstruct
+stringPool[ "baseconstruct!title" ]       = "Leaving function called before BaseConstructL()"
+stringPool[ "baseconstruct!description" ] = "If a leave occurs before BaseConstructL() is called, the system can panic because it is trying to clean up an application that has not been fully initialised."
+stringPool[ "baseconstruct!ideTitle" ]    = "leaving method called before BaseConstructL"
+
+# localised string for Script callActiveObjectWithoutCheckingOrStopping
+stringPool[ "callActiveObjectWithoutCheckingOrStopping!title" ]       = "Active object called without checking whether it is active or canceling it first"
+stringPool[ "callActiveObjectWithoutCheckingOrStopping!description" ] = "If an active object is started twice, a panic occurs. CodeScanner picks out places where there is a call to a Start(), Queue(), or After() function on a member variable, without a previous call to IsActive(), Cancel(), or Stop(). In general, if starting a timer, there should at least be a call to IsActive() to ensure that the timer is not already running."
+stringPool[ "callActiveObjectWithoutCheckingOrStopping!ideTitle" ]    = "active object called without checking whether it is active or canceling it first"
+
+# localised string for Script changenotification
+stringPool[ "changenotification!title" ]       = "Using RSAVarChangeNotify to see System Agent changes"
+stringPool[ "changenotification!description" ] = "When watching for System Agent changes, use RSystemAgent rather than RSAVarChangeNotify, which can fail."
+stringPool[ "changenotification!ideTitle" ]    = "using RSAVarChangeNotify to see System Agent changes"
+
+# localised string for Script cleanup
+stringPool[ "cleanup!title" ]       = "CleanupStack::Pop(AndDestroy) parameters"
+stringPool[ "cleanup!description" ] = "These functions should be called with explicit variable parameters to avoid misalignment."
+stringPool[ "cleanup!ideTitle" ]    = "missing CleanupStack::Pop parameter"
+
+# localised string for Script commentcode
+stringPool[ "commentcode!title" ]       = "Commented-out code"
+stringPool[ "commentcode!description" ] = "Instances of code that are commented out make the code hard to maintain and to interpret clearly. The commented out code should be removed. Any requirement to rediscover old code should be made through source control and not by trawling through commented-out code."
+stringPool[ "commentcode!ideTitle" ]    = "commented-out code"
+
+# localised string for Script connect
+stringPool[ "connect!title" ]       = "Ignoring Connect() return value"
+stringPool[ "connect!description" ] = "Ignoring the error returned from Connect() functions means that if the Connect() function fails due to OOM or other problems, the next access to the resource will panic."
+stringPool[ "connect!ideTitle" ]    = "ignoring Connect() return value"
+
+# localised string for Script ConnectAndDontCloseMemberVariable
+stringPool[ "ConnectAndDontCloseMemberVariable!title" ]       = "Calling Connect() or Open() on a member variable without calling Close() in the destructor"
+stringPool[ "ConnectAndDontCloseMemberVariable!description" ] = "If Connect() or Open() is called on any member variable, then Close() must be called in the destructor."
+stringPool[ "ConnectAndDontCloseMemberVariable!ideTitle" ]    = "calling Connect() or Open() on a member variable without calling Close() in the destructor"
+
+# localised string for Script constnames
+stringPool[ "constnames!title" ]       = "Badly-named constants"
+stringPool[ "constnames!description" ] = "Badly-named constant will make the source code harder to maintain and make defects more likely."
+stringPool[ "constnames!ideTitle" ]    = "badly-named constant"
+
+# localised string for Script consttdescptr
+stringPool[ "consttdescptr!title" ]       = "Const descriptor pointer as argument"
+stringPool[ "consttdescptr!description" ] = "Use \"const TDesC&\" instead of \"const TDesC*\"."
+stringPool[ "consttdescptr!ideTitle" ]    = "const descriptor pointer as argument"
+
+# localised string for Script controlornull
+stringPool[ "controlornull!title" ]       = "Accessing return value of ControlOrNull()"
+stringPool[ "controlornull!description" ] = "The return value might be NULL, so it should be checked before access."
+stringPool[ "controlornull!ideTitle" ]    = "accessing return value of ControlOrNull()"
+
+# localised string for Script crepository
+stringPool[ "crepository!title" ]       = "Ignoring CRepository::get() return value"
+stringPool[ "crepository!description" ] = "Independent application cannot assume that the Central Repository is set up fully. This means the return value of CRepository::get() cannot be ignored."
+stringPool[ "crepository!ideTitle" ]    = "ignoring CRepository::get() return value"
+
+# localised string for Script ctltargettype
+stringPool[ "ctltargettype!title" ]       = "Use of targettype ctl"
+stringPool[ "ctltargettype!description" ] = "The ctl target type should not be used. Instead, use DLL and explicitly refer to the Control Panel's DEF file. Note: Code that causes this issue only needs attention if it is found in code developed for Nokia Series 90 code that has extra exports for resetting the Control Panel item's data."
+stringPool[ "ctltargettype!ideTitle" ]    = "use of targettype ctl"
+
+# localised string for Script customizableicons
+stringPool[ "customizableicons!title" ]       = "Use of customizable icons"
+stringPool[ "customizableicons!description" ] = "Due to device customization requirements, independent application must not remove any customization done by the variant team. This means independent application cannot include customizable icons."
+stringPool[ "customizableicons!ideTitle" ]    = "use of customizable icons"
+
+# localised string for Script debugrom
+stringPool[ "debugrom!title" ]       = "Debug components in ROM"
+stringPool[ "debugrom!description" ] = "Debug versions of components in the ROM could mean that ROM space is being taken up with debugging information or that logging is being put out. Release versions should be in the ROM unless there is a good reason why they are not."
+stringPool[ "debugrom!ideTitle" ]    = "debug components in ROM"
+
+# localised string for Script declarename
+stringPool[ "declarename!title" ]       = "Use of __DECLARE_NAME"
+stringPool[ "declarename!description" ] = "The __DECLARE_NAME macro is historical and serves no purpose anymore and should be removed."
+stringPool[ "declarename!ideTitle" ]    = "use of __DECLARE_NAME"
+
+# localised string for Script deleteMemberVariable
+stringPool[ "deleteMemberVariable!title" ]       = "Member variable deleted incorrectly"
+stringPool[ "deleteMemberVariable!description" ] = "When a member variable is deleted, it should be assigned either to NULL or to another value. This prevents accidental access of the deleted object. If a NewL() or other leaving function is called to reassign the member variable, it should first be assigned to NULL in case that function leaves."
+stringPool[ "deleteMemberVariable!ideTitle" ]    = "member variable deleted incorrectly"
+
+# localised string for Script destructor
+stringPool[ "destructor!title" ]       = "Pointer access in destructors"
+stringPool[ "destructor!description" ] = "Accessing pointers to objects in destructors without checking whether they are not NULL could result in a panic because they may not have been constructed. The pointers should be checked to determine whether they are owned objects. If they are not owned, they should really be references rather than pointers."
+stringPool[ "destructor!ideTitle" ]    = "destructor is accessing/dereferencing data member"
+
+# localised string for Script doubleSemiColon
+stringPool[ "doubleSemiColon!title" ]       = "Use of double semicolon"
+stringPool[ "doubleSemiColon!description" ] = "Double semicolons at the end of a line are not necessary and cause a CodeWarrior compiler error."
+stringPool[ "doubleSemiColon!ideTitle" ]    = "use of double semicolon"
+
+# localised string for Script driveletters
+stringPool[ "driveletters!title" ]       = "Hard-coded drive letters"
+stringPool[ "driveletters!description" ] = "Drive letters should not be hard-coded."
+stringPool[ "driveletters!ideTitle" ]    = "hard-coded drive letters"
+
+# localised string for Script eikbuttons
+stringPool[ "eikbuttons!title" ]       = "Checks that the R_EIK_BUTTONS_* resources are not being used"
+stringPool[ "eikbuttons!description" ] = "R_EIK_BUTTONS_* resources will not be internationalised, and should not be used. Instead, create your own button resource. No button resource (or indeed, rls string) should be used in more than one location. Note: This issue is only relevant for development on Nokia platforms."
+stringPool[ "eikbuttons!ideTitle" ]    = "use of R_EIK_BUTTONS_ resources"
+
+# localised string for Script eikonenvstatic
+stringPool[ "eikonenvstatic!title" ]       = "Using CEikonEnv::Static"
+stringPool[ "eikonenvstatic!description" ] = "CEikonEnv::Static() calls should be kept to a minimum, because this involves TLS. All applications, controls, and dialogs already have a pointer to the singleton instance of CEikonEnv as a member variable and so do not need to find it again. If a class does not have access to a CEikonEnv and needs to use it repeatedly, then it should store one."
+stringPool[ "eikonenvstatic!ideTitle" ]    = "using CEikonEnv::Static"
+
+# localised string for Script enummembers
+stringPool[ "enummembers!title" ]       = "Enums with badly-named members"
+stringPool[ "enummembers!description" ] = "Enums with badly-named members make the code harder to maintain and may cause defects."
+stringPool[ "enummembers!ideTitle" ]    = "enum with badly-named member"
+
+# localised string for Script enumnames
+stringPool[ "enumnames!title" ]       = "Badly-named enums"
+stringPool[ "enumnames!description" ] = "Badly-named enums make the code harder to maintain and may cause defects."
+stringPool[ "enumnames!ideTitle" ]    = "badly-named enum"
+
+# localised string for Script exportinline
+stringPool[ "exportinline!title" ]       = "Exporting inline functions"
+stringPool[ "exportinline!description" ] = "Inline functions should not be exported because this can cause those that link to the DLL to fail to build. Exporting functions limits the changes that can be made in the future due to considerations of binary-compatibility."
+stringPool[ "exportinline!ideTitle" ]    = "exporting inline functions"
+
+# localised string for Script exportpurevirtual
+stringPool[ "exportpurevirtual!title" ]       = "Exporting pure virtual functions"
+stringPool[ "exportpurevirtual!description" ] = "Symbian recommends against the exportation of pure virtual functions."
+stringPool[ "exportpurevirtual!ideTitle" ]    = "exporting pure virtual functions"
+
+# localised string for Script externaldriveletters
+# stringPool[ "externaldriveletters!title" ]       = "Hard-coded external drive letters"
+# stringPool[ "externaldriveletters!description" ] = "External drive letters should not be hard-coded as the external drive may change between platforms and releases. This may cause confusion over ownership leading to classes being deleted erroneously and leaks occurring."
+# stringPool[ "externaldriveletters!ideTitle" ]    = "hard-coded external drive letter"
+
+# localised string for Script flags
+stringPool[ "flags!title" ]       = "Use of R&D flags or feature flags"
+stringPool[ "flags!description" ] = "Independent application must not use R&D flags nor feature flags via preprocessor statements in the source code. This means bld*.hrh and productvariant.hrh should not be used."
+stringPool[ "flags!ideTitle" ]    = "use of R&D flags or feature flags"
+
+# localised string for Script foff
+stringPool[ "foff!title" ]       = "Use of _FOFF"
+stringPool[ "foff!description" ] = "_FOFF allows access to data in classes that were not intended for public access. This may cause problems, especially when the location of the data changes."
+stringPool[ "foff!ideTitle" ]    = "use of _FOFF"
+
+# localised string for Script forbiddenwords
+stringPool[ "forbiddenwords!title" ]       = "Use of forbidden words in header files"
+stringPool[ "forbiddenwords!description" ] = "Some words should not be used in header files; especially those header files destined for external release. Some words may be forbidden for legal reasons or for platform consistency. Where they exist, alternative allowed words should be used. For example, \"NMP\" and \"Nokia Mobile Phones\" should be replaced by \"Nokia\"."
+stringPool[ "forbiddenwords!ideTitle" ]    = "use of forbidden words in header files"
+
+# localised string for Script forgottoputptroncleanupstack
+stringPool[ "forgottoputptroncleanupstack!title" ]       = "Neglected to put variable on cleanup stack"
+stringPool[ "forgottoputptroncleanupstack!description" ] = "If a variable is not put on the cleanup stack and a leaving function or ELeave is called, a memory leak occurs. CodeScanner occasionally gives false positives for this issue. Individual cases should be investigated."
+stringPool[ "forgottoputptroncleanupstack!ideTitle" ]    = "neglected to put variable on cleanup stack"
+
+# localised string for Script friend
+stringPool[ "friend!title" ]       = "Use of friends"
+stringPool[ "friend!description" ] = "The friend directive is often misused and can indicate problems in the OO design."
+stringPool[ "friend!ideTitle" ]    = "use of friends"
+
+# localised string for Script goto
+stringPool[ "goto!title" ]       = "Use of goto"
+stringPool[ "goto!description" ] = "Goto should not be used if it can be avoided because it makes the program flow more difficult to follow."
+stringPool[ "goto!ideTitle" ]    = "use of goto"
+
+# localised string for Script ifassignments
+stringPool[ "ifassignments!title" ]       = "Assignment in an If statement"
+stringPool[ "ifassignments!description" ] = "Assignments inside an If statement often indicate that the assignment was not intended. Even if the assignment was intended, it is clearer to separate out the assignment from the conditional. The script that detects such occurrences has a few false positives when the action statements are on the same line as the conditional check. However, this is also against the coding standards and the action should be on a separate line."
+stringPool[ "ifassignments!ideTitle" ]    = "assignment in an If statement"
+
+# localised string for Script ifpreprocessor
+stringPool[ "ifpreprocessor!title" ]       = "Use of #if in .h files"
+stringPool[ "ifpreprocessor!description" ] = "#if in header files should only be used before the main include guards and not around #include statements or around functional blocks in class definitions. The reason for the latter is to aid readability and to make BC breaks more difficult."
+stringPool[ "ifpreprocessor!ideTitle" ]    = "use of #if in .h files (not as main include guards)"
+
+# localised string for Script inheritanceorder
+stringPool[ "inheritanceorder!title" ]       = "Incorrect inheritance order of M and C classes"
+stringPool[ "inheritanceorder!description" ] = "If a C class inherits first from an M class and then a C class, a panic can occur when trying to pop a CBase pointer pointing to such a class from the cleanup stack when in fact a pointer pointing to the first predecessor, the mixin class, was popped instead."
+stringPool[ "inheritanceorder!ideTitle" ]    = "incorrect inheritance order of M and C classes"
+
+# localised string for Script intleaves
+stringPool[ "intleaves!title" ]       = "Methods that leave AND return a TInt error"
+stringPool[ "intleaves!description" ] = "Returning an error code as well as being able to leave is problematical for the caller. It is preferable to adhere to one method of returning the error. Note: CodeScanner is likely to return false positives for this situation, because some returned TInt values will not be error codes."
+stringPool[ "intleaves!ideTitle" ]    = "methods that leave AND return a TInt error"
+
+# localised string for Script jmp
+stringPool[ "jmp!title" ]       = "Use of setjmp and/or longjmp"
+stringPool[ "jmp!description" ] = "Using setjmp and/or longjmp makes code less maintainable."
+stringPool[ "jmp!ideTitle" ]    = "use of setjmp and/or longjmp"
+
+# localised string for Script leave
+stringPool[ "leave!title" ]       = "Leaving functions called in non-leaving functions"
+stringPool[ "leave!description" ] = "Non-leaving functions should not call leaving functions. Note: Operator functions are considered to be able to leave when scanning the code inside them."
+stringPool[ "leave!ideTitle" ]    = "leaving function called in non-leaving function"
+
+# localised string for Script LeaveNoError
+stringPool[ "LeaveNoError!title" ]       = "Leaving with KErrNone"
+stringPool[ "LeaveNoError!description" ] = "Leaving with KErrNone usually indicates that there is a makeshift way around a design issue rather than a true and proper fix to the architecture."
+stringPool[ "LeaveNoError!ideTitle" ]    = "leaving with KErrNone"
+
+# localised string for Script leavingoperators
+stringPool[ "leavingoperators!title" ]       = "Leaving functions called in operator functions"
+stringPool[ "leavingoperators!description" ] = "It is not obvious that operator functions can leave. Calling leaving functions in operator functions should be considered carefully."
+stringPool[ "leavingoperators!ideTitle" ]    = "leaving functions called in operator functions"
+
+# localised string for Script LFunctionCantLeave
+stringPool[ "LFunctionCantLeave!title" ]       = "L-functions that cannot leave"
+stringPool[ "LFunctionCantLeave!description" ] = "A function should not be named with an 'L' if it cannot leave. The only exception is in virtual functions where the function name is defined in the base class so the L cannot be removed. For example, RunL()."
+stringPool[ "LFunctionCantLeave!ideTitle" ]    = "L-functions that cannot leave"
+
+# localised string for Script longlines
+stringPool[ "longlines!title" ]       = "Overly long lines of code"
+stringPool[ "longlines!description" ] = "Lines longer than about 100 characters can indicate messy or badly-structured code that is hard to maintain."
+stringPool[ "longlines!ideTitle" ]    = "overly long line of code"
+
+# localised string for Script magicnumbers
+stringPool[ "magicnumbers!title" ]       = "Use of magic numbers"
+stringPool[ "magicnumbers!description" ] = "Magic numbers - that is, numbers that are hard-coded into the source code and instead of being presented as constants - make code difficult to maintain and give no indication of why a calculation is the way it is. Magic numbers should be replaced with named constants."
+stringPool[ "magicnumbers!ideTitle" ]    = "use of magic numbers"
+
+# localised string for Script mclassdestructor
+stringPool[ "mclassdestructor!title" ]       = "M class has destructor"
+stringPool[ "mclassdestructor!description" ] = "M classes should not contain a destructor."
+stringPool[ "mclassdestructor!ideTitle" ]    = "M class has destructor"
+
+# localised string for Script memberlc
+stringPool[ "memberlc!title" ]       = "Assigning LC methods to member variables"
+stringPool[ "memberlc!description" ] = "Objects on the cleanup stack should not be assigned to member variables"
+stringPool[ "memberlc!ideTitle" ]    = "LC method assigned to data member"
+
+# localised string for Script membervariablecallld
+stringPool[ "membervariablecallld!title" ]       = "Calling LD function on member variable"
+stringPool[ "membervariablecallld!description" ] = "LD functions should not be called on a member variable because ownership can be unclear and may lead to double deletes."
+stringPool[ "membervariablecallld!ideTitle" ]    = "calling LD function on member variable"
+
+# localised string for Script missingcancel
+stringPool[ "missingcancel!title" ]       = "Cancel() not called in active object's destructor"
+stringPool[ "missingcancel!description" ] = "Cancel() should always be called in active object's destructor to cancel an outstanding request if there is one. If there is no request pending then Cancel() just does nothing, but if we do not call Cancel() when having an outstanding request a panic will be raised. CodeScanner occasionally gives false positives for this issue. Individual cases should be investigated."
+stringPool[ "missingcancel!ideTitle" ]    = "Cancel() not called in active object's destructor"
+
+# localised string for Script missingcclass
+stringPool[ "missingcclass!title" ]       = "C class not inheriting from another C class"
+stringPool[ "missingcclass!description" ] = "All C classes should inherit from another C class to ensure that all data members are zeroed."
+stringPool[ "missingcclass!ideTitle" ]    = "C class not inheriting from another C class"
+
+# localised string for Script mmpsourcepath
+stringPool[ "mmpsourcepath!title" ]       = "Use of absolute path names in MMP files"
+stringPool[ "mmpsourcepath!description" ] = "Use of absolute paths in MMP files makes it impossible to relocate the source. Relative paths should be used instead."
+stringPool[ "mmpsourcepath!ideTitle" ]    = "use of absolute path names in MMP files"
+
+# localised string for Script multilangrsc
+stringPool[ "multilangrsc!title" ]       = "Not using BaflUtils::NearestLanguageFile() when loading a resource file"
+stringPool[ "multilangrsc!description" ] = "If AddResourceFileL() is used without first using BaflUtils::NearestLanguageFile(), then not all language versions of resources will be picked up."
+stringPool[ "multilangrsc!ideTitle" ]    = "not using BaflUtils::NearestLanguageFile() when loading a resource file"
+
+# localised string for Script multipledeclarations
+stringPool[ "multipledeclarations!title" ]       = "Multiple declarations on one line"
+stringPool[ "multipledeclarations!description" ] = "Multiple declarations on one line can be confusing. Separate them out so that each declaration is on its own separate line."
+stringPool[ "multipledeclarations!ideTitle" ]    = "multiple declarations on one line"
+
+# localised string for Script multipleinheritance
+stringPool[ "multipleinheritance!title" ]       = "Non M-class multiple inheritance"
+stringPool[ "multipleinheritance!description" ] = "It is bad Symbian OS practice to derive from two classes that have implemented functions. Complex behaviour that was not intended can result."
+stringPool[ "multipleinheritance!ideTitle" ]    = "multiple inheritance from non M-classes"
+
+# localised string for Script mydocs
+stringPool[ "mydocs!title" ]       = "Hard-coded mydocs directory strings"
+stringPool[ "mydocs!description" ] = "The mydocs directory is subject to change so should not be referenced directly. Note: @	This issue will only occur in code developed for the Nokia Series 90 platform."
+stringPool[ "mydocs!ideTitle" ]    = "hard-coded mydocs directory strings"
+
+# localised string for Script namespace
+stringPool[ "namespace!title" ]       = "Use of namespace"
+stringPool[ "namespace!description" ] = "Namespaces are often used to work around a poor naming convention."
+stringPool[ "namespace!ideTitle" ]    = "use of namespace"
+
+# localised string for Script newlreferences
+stringPool[ "newlreferences!title" ]       = "NewL() returning a reference"
+stringPool[ "newlreferences!description" ] = "NewL() and NewLC() functions should return a pointer to an object created on the heap."
+stringPool[ "newlreferences!ideTitle" ]    = "NewL() returning a reference"
+
+# localised string for Script noleavetrap
+stringPool[ "noleavetrap!title" ]       = "TRAP used with no leaving functions"
+stringPool[ "noleavetrap!description" ] = "A TRAP is unnecessary if there are no leaving functions."
+stringPool[ "noleavetrap!ideTitle" ]    = "TRAP contains no leaving functions"
+
+# localised string for Script nonconsthbufc
+stringPool[ "nonconsthbufc!title" ]       = "Non-const HBufC* parameter passing"
+stringPool[ "nonconsthbufc!description" ] = "HBufC* parameters should almost always be passed as a const pointer."
+stringPool[ "nonconsthbufc!ideTitle" ]    = "non-const HBufC* parameter passing"
+
+# localised string for Script nonconsttdesc
+stringPool[ "nonconsttdesc!title" ]       = "Non-const TDesC& parameter passing"
+stringPool[ "nonconsttdesc!description" ] = "TDesC& parameters should be passed as a const. If it is not, it may indicate that the coder does not understand descriptors, for example, passing descriptors by value."
+stringPool[ "nonconsttdesc!ideTitle" ]    = "non-const TDesC& parameter passing"
+
+# localised string for Script nonleavenew
+stringPool[ "nonleavenew!title" ]       = "Use of new without (ELeave)"
+stringPool[ "nonleavenew!description" ] = "Using new without (ELeave) is only used in special circumstances. The leaving variant should typically be used in preference. A common exception is for application creation, where NULL is returned for failed creation."
+stringPool[ "nonleavenew!ideTitle" ]    = "new used without (ELeave)"
+
+# localised string for Script nonunicodeskins
+stringPool[ "nonunicodeskins!title" ]       = "Non-Unicode skins"
+stringPool[ "nonunicodeskins!description" ] = "Skin definition files (SKN, SKE) must be Unicode. Note: Code that causes this issue only needs attention if it is found in code developed for Nokia Series 90 code."
+stringPool[ "nonunicodeskins!ideTitle" ]    = "non-Unicode skins"
+
+# localised string for Script null
+stringPool[ "null!title" ]       = "NULL equality check"
+stringPool[ "null!description" ] = "There is no need to compare pointer variables to NULL. Use If(ptr)."
+stringPool[ "null!ideTitle" ]    = "NULL equality check"
+
+# localised string for Script open
+stringPool[ "open!title" ]       = "Ignoring Open() return value"
+stringPool[ "open!description" ] = "Ignoring the return value from Open() functions (due to OOM, etc.) means that when the resource is accessed next, a panic will result."
+stringPool[ "open!ideTitle" ]    = "ignoring Open() return value"
+
+# localised string for Script pointertoarrays
+stringPool[ "pointertoarrays!title" ]       = "Pointer to arrays as members of a C class"
+stringPool[ "pointertoarrays!description" ] = "In C classes, there is no need to use pointers to arrays as data members. Instead, use the arrays themselves. Using pointers leads to obscure notation like \"(*array)[n]\" for the more usual \"array[n]\". It also makes it necessary to explicitly delete the arrays in the destructor. Using the arrays themselves also simplifies notation, reduces indirection, and reduces heap fragmentation."
+stringPool[ "pointertoarrays!ideTitle" ]    = "pointer to arrays as members of a C class"
+
+# localised string for Script pragmadisable
+stringPool[ "pragmadisable!title" ]       = "Use of #pragma warning"
+stringPool[ "pragmadisable!description" ] = "Disabling warnings can lead to problems, because the warnings are probably there for a reason."
+stringPool[ "pragmadisable!ideTitle" ]    = "use of #pragma warning"
+
+# localised string for Script pragmamessage
+stringPool[ "pragmamessage!title" ]       = "Use of #pragma message"
+stringPool[ "pragmamessage!description" ] = "#pragma messages during the build stage can interfere with the build log parsing."
+stringPool[ "pragmamessage!ideTitle" ]    = "use of #pragma message"
+
+# localised string for Script pragmaother
+stringPool[ "pragmaother!title" ]       = "Use of #pragma other than warning and message"
+stringPool[ "pragmaother!description" ] = "#pragma directives should only be used in very edge cases (for example, functions consisting of inline assembler without explicit return statements) because, typically, their usage masks valid build warnings and error messages."
+stringPool[ "pragmaother!ideTitle" ]    = "use of #pragma other than warning and message"
+
+# localised string for Script privateinheritance
+stringPool[ "privateinheritance!title" ]       = "Use of private inheritance"
+stringPool[ "privateinheritance!description" ] = "Classes should not be inherited privately. If public or protected inheritance is not appropriate, consider using an amalgamation; that is, have an object of that type as a member variable."
+stringPool[ "privateinheritance!ideTitle" ]    = "use of private inheritance"
+
+# localised string for Script pushaddrvar
+stringPool[ "pushaddrvar!title" ]       = "Pushing address of a variable onto the cleanup stack"
+stringPool[ "pushaddrvar!description" ] = "If the variable is owned by the code pushing it, it should be stored as a pointer. If it is not, it should not be pushed onto the cleanup stack."
+stringPool[ "pushaddrvar!ideTitle" ]    = "pushing address of a variable onto the cleanup stack"
+
+# localised string for Script pushmember
+stringPool[ "pushmember!title" ]       = "Pushing data members onto the cleanup stack"
+stringPool[ "pushmember!description" ] = "Pushing member variables is likely to lead to double deletes or leakage in certain circumstances and so should be avoided. Even if no panic can result, it is bad practice and makes maintenance more difficult."
+stringPool[ "pushmember!ideTitle" ]    = "data member pushed to cleanup stack"
+
+# localised string for Script readresource
+stringPool[ "readresource!title" ]       = "Using ReadResource() instead of ReadResourceL()"
+stringPool[ "readresource!description" ] = "ReadResourceL() should always be used in preference to ReadResource() because in an error scenario ReadResource() effectively fails silently. If no check is performed on the resulting descriptor afterwards, unexpected states can ensue. These states are often characterized by buffer overflows."
+stringPool[ "readresource!ideTitle" ]    = "Using ReadResource() instead of ReadResourceL()"
+
+# localised string for Script resourcenotoncleanupstack
+stringPool[ "resourcenotoncleanupstack!title" ]       = "Neglected to put resource objects on cleanup stack"
+stringPool[ "resourcenotoncleanupstack!description" ] = "If a stack-based resource object is not put on the cleanup stack with CleanupResetAndDestroyPushL() or CleanupClosePushL(), and a leaving function or ELeave is called, a memory leak occurs. CodeScanner occasionally gives false positives for this issue. Individual cases should be investigated."
+stringPool[ "resourcenotoncleanupstack!ideTitle" ]    = "neglected to put resource objects on cleanup stack"
+
+# localised string for Script resourcesonheap
+stringPool[ "resourcesonheap!title" ]       = "Resource objects on the heap"
+stringPool[ "resourcesonheap!description" ] = "There is very rarely any real need to put R classes on the heap (unless they are not real R classes!).  Doing so can lead to inefficiency and cleanup stack problems."
+stringPool[ "resourcesonheap!ideTitle" ]    = "resource objects on the heap"
+
+# localised string for Script returndescriptoroutofscope
+stringPool[ "returndescriptoroutofscope!title" ]       = "Return descriptor out of scope"
+stringPool[ "returndescriptoroutofscope!description" ] = "Returning a TBuf descriptor that is declared locally takes it out of scope. This can cause a crash on WINSCW, although not on WINS."
+stringPool[ "returndescriptoroutofscope!ideTitle" ]    = "return descriptor out of scope"
+
+# localised string for Script rfs
+stringPool[ "rfs!title" ]       = "Use of non-pointer/reference RFs"
+stringPool[ "rfs!description" ] = "Connecting to an RFs is a time-consuming operation. (It can take approximately 0.1 seconds on some devices.) To minimise wasted time and resources, use the already-connected one in EikonEnv or elsewhere, if possible."
+stringPool[ "rfs!ideTitle" ]    = "use of non-pointer/reference RFs"
+
+# localised string for Script rssnames
+stringPool[ "rssnames!title" ]       = "Duplicate RSS names"
+stringPool[ "rssnames!description" ] = "Resource files with clashing NAME fields can cause the wrong resource file to be accessed. This can lead to incorrect functionality or panics."
+stringPool[ "rssnames!ideTitle" ]    = "duplicate RSS names"
+
+# localised string for Script stringliterals
+stringPool[ "stringliterals!title" ]       = "Use of _L string literals"
+stringPool[ "stringliterals!description" ] = "_L() string literals should be replaced by the _LIT() macro."
+stringPool[ "stringliterals!ideTitle" ]    = "use of _L string literals"
+
+# localised string for Script stringsinresourcefiles
+stringPool[ "stringsinresourcefiles!title" ]       = "Strings in RSS or RA files"
+stringPool[ "stringsinresourcefiles!description" ] = "Strings should not be defined in RSS or RA files. Instead, they should be put in RLS or other localisable files."
+stringPool[ "stringsinresourcefiles!ideTitle" ]    = "strings in RSS or RA files"
+
+# localised string for Script struct
+stringPool[ "struct!title" ]       = "Use of struct"
+stringPool[ "struct!description" ] = "C-style structs should not generally be used. The correct idiom is to use a class with public members. A permissible use of a C-style struct is if it is used to group non-semantically related entities together for convenience, and if a class-related hierarchy would be too heavy-weight."
+stringPool[ "struct!ideTitle" ]    = "use of struct"
+
+# localised string for Script tcclasses
+stringPool[ "tcclasses!title" ]       = "T classes inheriting from C classes"
+stringPool[ "tcclasses!description" ] = "T classes that are derived from C classes may have a complex constructor and so need to be handled differently. It is better to make the T class into a C class, which will make the code easier to maintain."
+stringPool[ "tcclasses!ideTitle" ]    = "T class inherits from C class"
+
+# localised string for Script tclassdestructor
+stringPool[ "tclassdestructor!title" ]       = "T class has destructor"
+stringPool[ "tclassdestructor!description" ] = "T classes should not have a destructor"
+stringPool[ "tclassdestructor!ideTitle" ]    = "T class has destructor"
+
+# localised string for Script todocomments
+stringPool[ "todocomments!title" ]       = "\"To do\" comments"
+stringPool[ "todocomments!description" ] = "\"To do\" comments in code suggest that it is not finished."
+stringPool[ "todocomments!ideTitle" ]    = "\"To do\" comment"
+
+# localised string for Script trapcleanup
+stringPool[ "trapcleanup!title" ]       = "Use of LC function in TRAPs"
+stringPool[ "trapcleanup!description" ] = "You cannot trap something that leaves something on the cleanup stack because it will panic."
+stringPool[ "trapcleanup!ideTitle" ]    = "LC function used in TRAP"
+
+# localised string for Script trapeleave
+stringPool[ "trapeleave!title" ]       = "Trapping new(ELeave)"
+stringPool[ "trapeleave!description" ] = "The trapping of a \"new(ELeave) CXxx\" call is redundant and wasteful as the code to support TRAP is surprisingly large. If the instantiation process really needs not to leave, use \"new CXxx\" and check for NULL."
+stringPool[ "trapeleave!ideTitle" ]    = "trapping new(ELeave)"
+
+# localised string for Script traprunl
+stringPool[ "traprunl!title" ]       = "Trapping of (Do)RunL() rather than using RunError()"
+stringPool[ "traprunl!description" ] = "The RunError() function should be used rather than the CActive derivative using its own TRAPD solution within a RunL()."
+stringPool[ "traprunl!ideTitle" ]    = "trapping of (Do)RunL() rather than using RunError()"
+
+# localised string for Script trspassing
+stringPool[ "trspassing!title" ]       = "Passing TRequestStatus parameters by value"
+stringPool[ "trspassing!description" ] = "TRequestStatus parameters should be passed by reference. If TRequestStatus is just being used as an error code, then convert it to a TInt."
+stringPool[ "trspassing!ideTitle" ]    = "passing TRequestStatus parameters by value"
+
+# localised string for Script uids
+stringPool[ "uids!title" ]       = "Duplicate UIDs"
+stringPool[ "uids!description" ] = "UIDs must be unique."
+stringPool[ "uids!ideTitle" ]    = "duplicate UIDs"
+
+# localised string for Script uncompressedaif
+stringPool[ "uncompressedaif!title" ]       = "Uncompressed AIFs in ROM"
+stringPool[ "uncompressedaif!description" ] = "AIF files should be referenced as \"AIF=\" rather than \"data=\" or \"file=\" otherwise they can bloat the ROM size and slow down application loading."
+stringPool[ "uncompressedaif!ideTitle" ]    = "uncompressed AIFs in ROM"
+
+# localised string for Script uncompressedbmp
+stringPool[ "uncompressedbmp!title" ]       = "Uncompressed bitmaps in ROM"
+stringPool[ "uncompressedbmp!description" ] = "Using uncompressed bitmaps can significantly bloat the size of ROM images. All occurrences of \"bitmap=\" in iby/hby files should be replaced with \"auto-bitmap=\". Also, including bitmaps using \"data=\" or \"file=\" causes bloat and load-speed reductions."
+stringPool[ "uncompressedbmp!ideTitle" ]    = "uncompressed bitmaps in ROM"
+
+# localised string for Script unicodesource
+stringPool[ "unicodesource!title" ]       = "Unicode source files"
+stringPool[ "unicodesource!description" ] = "Having Unicode source files (CPP, H, RLS, LOC, RSS, and RA) will break most build systems."
+stringPool[ "unicodesource!ideTitle" ]    = "Unicode source files"
+
+# localised string for Script userafter
+stringPool[ "userafter!title" ]       = "Use of User::After"
+stringPool[ "userafter!description" ] = "Generally, User::After() functions are used to skirt around timing problems. Typically, they should be removed and the defects fixed properly: that is, by waiting for the correct event to continue execution."
+stringPool[ "userafter!ideTitle" ]    = "use of User::After"
+
+# localised string for Script userfree
+stringPool[ "userfree!title" ]       = "Using User::Free directly"
+stringPool[ "userfree!description" ] = "User::Free() should never be called, because all objects free their memory on deletion; their destructors are not called and further resources cannot be freed or closed. This function should be removed and replaced by explicit deletes."
+stringPool[ "userfree!ideTitle" ]    = "using User::Free directly"
+
+# localised string for Script userWaitForRequest
+stringPool[ "userWaitForRequest!title" ]       = "Use of User::WaitForRequest"
+stringPool[ "userWaitForRequest!description" ] = "User::WaitForRequest() should not generally be used in UI code because the UI will not respond to redraw events while its thread is stopped."
+stringPool[ "userWaitForRequest!ideTitle" ]    = "use of User::WaitForRequest"
+
+# localised string for Script variablenames
+stringPool[ "variablenames!title" ]       = "Local variables with member/argument names"
+stringPool[ "variablenames!description" ] = "Local variable names should be of the form localVariable and not aLocalVar or iLocalVar. Badly-named variables can be misleading and cause maintenance and coding errors."
+stringPool[ "variablenames!ideTitle" ]    = "local variables with member/argument names"
+
+# localised string for Script voidparameter
+stringPool[ "voidparameter!title" ]       = "Void parameter explicitly declared"
+stringPool[ "voidparameter!description" ] = "Declaring a void parameter is unnecessary. A function declared as DoSomething(void) may as well be declared as DoSomething(). Void casts are also unnecessary."
+stringPool[ "voidparameter!ideTitle" ]    = "void parameter explicitly declared"
+
+# localised string for Script worryingcomments
+stringPool[ "worryingcomments!title" ]       = "Worrying comments"
+stringPool[ "worryingcomments!description" ] = "Typically, exclamation and question marks in comments indicate that something odd is in the code or that it is unfinished or not understood fully."
+stringPool[ "worryingcomments!ideTitle" ]    = "worrying comments"
+
+#!LOCALISEHERE
+
+def Usage(code, msg=""):
+	print msg
+	print
+	print KVersion
+	print
+	print "Usage: CodeScanner [options] <source dir> [<output dir>]"	
+	print "   or: CodeScanner [options] <source file> [<output dir>]"
+	print 
+	print "options:"
+	print "    -h - display command help"
+	print "    -v - display verbose messages"
+	print "    -c <config file> - use specified configuration file"
+	print "    -i <source dir/file> - specify additional directory/file to scan"
+	print "    -l <log file> - create debug log with specified filename"
+	print "    -o html|xml|std - specify output format : HTML, XML or StdOut; default is HTML"
+	print "    -x url to lxr site"
+	print "    -r lxr version"
+	print "    -t on/off - create a time-stamped directory for results, default is on"
+	print
+	print "<source dir> is the directory containing the source code to scan"
+	print "<source file> is the single file containing the source code to scan"
+	print "<output dir> is the directory in which to produce the output"
+	print
+	print "Notes:"
+	print "<source dir> and <output dir> cannot be identical"
+	print "<output dir> cannot be the root of a drive"
+	print
+	print KCopyrightLine1
+	print KCopyrightLine2
+	if scanner.iLog <> None:
+		scanner.iLog.Write("usage(): exiting with code " + str(code))
+		scanner.iLog.Close()
+	sys.exit(code)
+
+def DefaultCompare(aLines, aCurrentline, aRematch, aFilename):
+	if aRematch.search(aLines[aCurrentline]):
+		return 1
+	else:
+		return 0
+
+def DefaultFuncParamCompare(lines, currentline, rematch, filename):
+	# distinguish local declaration from function parameter
+    line = lines[currentline]
+    m = rematch.search(line)
+    if m:
+        isFuncParam = (line.find(")") <> -1)
+        isLocal = (line.find(";") <> -1)
+
+        while (not isFuncParam) and (not isLocal) and (currentline + 1 < len(lines)):
+            currentline += 1
+            line = lines[currentline]
+            isFuncParam = (line.find(")") <> -1)
+            isLocal = (line.find(";") <> -1)
+
+        if isFuncParam:
+            return 1
+        elif isLocal:
+            return 0
+
+    return 0
+
+def ScanDirOrFile(argument):
+	if os.path.isdir(argument):
+		scanner.iComponentManager.SetRoot(argument)
+		scanner.TraverseDirectory(argument)
+	elif os.path.isfile(argument):
+		parentDir = os.path.dirname(argument)
+		scanner.iComponentManager.SetRoot(parentDir)
+		scanner.iComponentManager.BeginDirectory(parentDir)
+		numberOfLinesScanned = 0
+		numberOfLinesScanned += scanner.ScanFile(argument)
+		scanner.iComponentManager.EndDirectory(parentDir, numberOfLinesScanned)
+	else:
+		print "Unable to open specified source file: " + argument
+		sys.exit(2)
+
+
+class CScript:
+
+	# #######################################################
+	# CScript - a test script
+
+	def __init__(self, aScriptName):
+		self.iScriptName = aScriptName
+		self.iCompare = DefaultCompare
+		self.iReString = ""
+		self.iReMatch = re.compile("")
+		self.iTitle = stringPool[aScriptName + "!title"]
+		self.iIdeTitle = stringPool[aScriptName + "!ideTitle"]
+		self.iFileExts = []
+		self.iIgnore = KIgnoreNothing
+		self.iDescription = stringPool[aScriptName + "!description"]
+		self.iSeverity = KSeverityMedium
+		self.iBaseClass = ""
+
+	def ScriptConfig(self):
+		if (scanner.iDomConfig <> None):
+			for scriptsNode in scanner.iDomConfig.getElementsByTagName("scripts"):
+				for scriptNode in scriptsNode.getElementsByTagName(self.iScriptName):
+					return scriptNode
+		return None
+	
+	def DefaultInheritanceCompare(self, lines, currentline, rematch, filename):
+		m = rematch.search(lines[currentline])
+		if m:
+			inheritanceString = m.group(3)
+			# check for inheritance list spanning multiple lines
+			i = currentline + 1
+			while (inheritanceString.find("{") == -1) and i < len(lines):
+				if (inheritanceString.find(";") <> -1):
+					return 0
+				inheritanceString += lines[i]
+				i += 1
+
+			# construct inheritance class list
+			inheritancelist = inheritanceString.split(",")
+			reclass = re.compile("[\s:]*(public|protected|private)?\s*([\w:]+)")
+			classlist = []
+			for inheritance in inheritancelist:
+				match = reclass.search(inheritance)
+				if match:
+					inheritclass = match.group(2)
+					colonpos = inheritclass.rfind(":")
+					if (colonpos <> -1):
+						inheritclass = inheritclass[colonpos + 1:]
+					classlist.append(inheritclass)
+
+			# search for inheritance class
+			for classname in classlist:
+				if classname == self.iBaseClass:
+					return 1
+
+		return 0
+
+
+class CCustomScript(CScript):
+
+	# #######################################################
+	# CScript - a test script based on a custom rule
+
+	def __init__(self, aScriptName):
+		self.iScriptName = aScriptName
+		self.iCompare = DefaultCompare
+		self.iReString = ""
+		self.iTitle = ""
+		self.iIdeTitle = ""
+		self.iFileExts = []
+		self.iIgnore = KIgnoreNothing
+		self.iDescription = ""
+
+
+class CCategorisedScripts:
+
+	# #######################################################
+	# CCategorisedScripts - a collection of scripts sorted
+	# by script category (panic, can panic, etc.)
+
+	def AddScript(self, aScript):
+		# do we have a category for this already?
+		category = aScript.iCategory
+		if (not self.iScripts.has_key(category)):
+			# no, create a linear array here
+			self.iScripts[category] = []
+
+		# append to the correct category
+		self.iScripts[category].append(aScript)
+
+		# compile the reg-ex otherwise will get continuous hits
+		aScript.iReMatch = re.compile(aScript.iReString, re.VERBOSE)
+
+	def AllScripts(self):
+		result = []
+		for scripts in self.iScripts.values():
+			result += scripts
+
+		return result
+
+	def PrintListOfTestScripts(self):
+		for category in self.iScripts.keys():
+			print(category + "\n----------------------------------")
+			for script in self.iScripts[category]:
+				print("\t" + script.iScriptName)
+
+		print("")
+
+	# iScripts is a 2D array, 1st level is a hash of categories
+	#                         2nd level is linear array
+	iScripts = {}        
+
+class CLogger:
+
+	# #######################################################
+	# CLogger
+	# a simple log file interface
+
+	def __init__(self, aFilename):
+		if aFilename != None and len(aFilename) > 0:
+			self.iFile = file(aFilename, "w")
+			self.iFile.write(KVersion + " started at " + datetime.datetime.now().ctime() + "\n")
+		else:
+			self.iFile = None
+
+	def Write(self, aText):
+		if self.iFile <> None:
+			self.iFile.write(str(datetime.datetime.now().time())+":"+aText+"\n")
+			self.iFile.flush()
+
+	def Close(self):
+		if self.iFile <> None:
+			self.iFile.write(KVersion + " ended at " + datetime.datetime.now().ctime() + "\n")
+			self.iFile.close()
+
+
+class CRendererBase:
+
+	# #######################################################
+	# CRendererBase - base class for renderers
+
+	def RegisterSelf(self, aName, aDescription, aRendererManager):
+		self.iName = aName
+		self.iDescription = aDescription
+		aRendererManager.AddRenderer(self)
+	def BeginComponent(self, aComponent):
+		return
+	def BeginFile(self, aFilename):
+		return
+	def ReportError(self, aLineContext, aScript):
+		return
+	def EndFile(self):
+		return
+	def EndComponent(self, aComponent):
+		return
+
+
+class CStdOutRenderer(CRendererBase):
+
+	# #######################################################
+	# CStdOutRenderer - renderer for Standard Console Output
+	# Output goes to standard output; when run in Carbide, 
+	# this shows up in the output window. Correctly formatted 
+	# lines can then be selected, automatically selecting 
+	# the corresponding line of the associated source file. 
+	# The format is:
+	#   <filename>(<line>) : <comment>
+
+	def __init__(self, aRendererManager):
+		self.RegisterSelf("stdout", "StdOut renderer", aRendererManager)
+		print KVersion
+
+	def BeginComponent(self, aComponent):
+		return
+
+	def BeginFile(self, aFilename):
+		self.iErrorCount = 0
+		scanner.ReportAction("Scanning file " + aFilename)
+
+	def ReportError(self, aLineContext, aScript):
+		self.iErrorCount += 1
+		if (aScript.iSeverity == KSeverityLow):
+			msgType = "info"
+		elif (aScript.iSeverity == KSeverityMedium):
+			msgType = "warning"
+		elif (aScript.iSeverity == KSeverityHigh):
+			msgType = "error"
+		print(aLineContext.iFileName + "(" + str(aLineContext.iLineNumber) + ") : " + msgType + ": " + aScript.iScriptName + ": " + KSeverityConfigMap[aScript.iSeverity] + ": " + KCategoryConfigMap[aScript.iCategory] + ": " + aScript.iIdeTitle)
+		if len(scanner.iRendererManager.iAnnotation)>0:
+			print scanner.iRendererManager.iAnnotation
+			scanner.iRendererManager.iAnnotation = ""
+
+	def EndFile(self):
+		scanner.ReportAction("Total problems found in file: " + str(self.iErrorCount))
+
+	def EndComponent(self, aComponent):
+		scanner.iEndTime = datetime.datetime.now().ctime()
+		return
+
+
+class CXmlComponentSummaryFile:
+	# #########################################################
+	# CXmlComponentSummaryFile
+	# Encapsulates the script (problem) summary for XML output.
+	# For each script, there is a listing for occurrences
+	# of that script's problem and location of each occurrence.
+
+	def CreateSummary(self, aXmlRenderer):
+		try:
+			outputPath = os.path.normpath(os.path.join(aXmlRenderer.iOutputDirectory, "problemIndex.xml"))
+			outputFile = file(outputPath, "w")
+		except IOError:
+			scanner.ReportError("IOError : Unable to create output file " + outputPath)
+		else:
+			errors = aXmlRenderer.iErrors
+			level = 0
+			indent = "   "
+			outputFile.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
+			outputFile.write(level * indent + "<problemIndex>\n")
+			level += 1
+			for category in KCategoryHtmlDisplayOrder:
+				found = False
+				if scanner.iCategoriedScripts.iScripts.has_key(category):
+					for script in scanner.iCategoriedScripts.iScripts[category]:
+						if errors.has_key(script.iScriptName):
+							found = True
+							break
+					if found:
+						outputFile.write(level * indent + "<category")
+						outputFile.write(" name=\"" + KCategoryConfigMap[category] + "\">\n")
+						level += 1
+						for script in scanner.iCategoriedScripts.iScripts[category]:
+							if errors.has_key(script.iScriptName):
+								outputFile.write(level * indent + "<problem")
+								outputFile.write(" name=\"" + script.iScriptName + "\"")
+								outputFile.write(" severity=\"" + KSeverityConfigMap[script.iSeverity] + "\">\n")
+								level += 1
+								for fileName, lines in errors[script.iScriptName].items():
+									outputFile.write(level * indent + "<file")
+									outputFile.write(" path=\"" + fileName + "\">\n")
+									level += 1
+									for lineNo in lines:
+										outputFile.write(level * indent + str(lineNo) + "\n")
+									level -= 1
+									outputFile.write(level * indent + "</file>\n")
+								level -= 1
+								outputFile.write(level * indent + "</problem>\n")
+						level -= 1
+						outputFile.write(level * indent + "</category>\n")
+			level -= 1
+			outputFile.write(level * indent + "</problemIndex>\n")
+			outputFile.close()
+
+
+class CXmlRenderer(CRendererBase):
+
+	# ########################################
+	# CXmlRenderer - a renderer for XML output
+
+	def __init__(self, aRendererManager, aOutputDirectory):
+		self.RegisterSelf("xml", "XML renderer", aRendererManager)
+		self.iOutputDirectory = aOutputDirectory
+		if os.path.isdir(self.iOutputDirectory) != True :
+			os.makedirs(self.iOutputDirectory)
+		self.iErrors = {} 
+		print
+		print KVersion
+		print KCopyrightLine1
+		print KCopyrightLine2
+
+	def BeginComponent(self, aComponent):
+		return
+
+	def BeginFile(self, aFilename):
+		self.iFilename = aFilename
+		scanner.ReportAction("Scanning file " + aFilename)
+
+	def ReportError(self, aLineContext, aScript):
+		scriptName = aScript.iScriptName
+		fileName = aLineContext.iFileName
+		lineNumber = aLineContext.iLineNumber
+		if (not self.iErrors.has_key(scriptName)):
+			self.iErrors[scriptName] = {}
+		if (not self.iErrors[scriptName].has_key(fileName)):
+			self.iErrors[scriptName][fileName] = []
+		self.iErrors[scriptName][fileName].append(lineNumber)
+
+	def EndFile(self):
+		#tbd
+		return
+
+	def EndComponent(self, aComponent):
+		relativeComponentName = scanner.iComponentManager.RelativeComponentName(aComponent.iFullPath)
+		if len(relativeComponentName) < 1:	# root component - final component
+			scanner.iEndTime = datetime.datetime.now().ctime()
+			componentSummaryFile = CXmlComponentSummaryFile()
+			componentSummaryFile.CreateSummary(self)
+
+
+class CHtmlOutputFileBase:
+
+	# #######################################################
+	# CHtmlOutputFileBase - base class for HTML output files
+
+	def WriteHeader(self, aOutputFile):
+		aOutputFile.write("<html><body>")
+
+	def Write(self, aOutputFile, aText):
+		aOutputFile.write(aText)
+
+	def WriteLink(self, aOutputFile, aHref, aText):
+		aHref = self.CleanupLink(aHref)
+		aOutputFile.write("<a href=\"" + aHref + "\">" + aText + "</a>")
+
+	def WriteElement(self, aOutputFile, aElementName, aElementValue):
+		aOutputFile.write("<"+aElementName+">"+aElementValue+"</"+aElementName+">")
+
+	def WriteBreak(self, aOutputFile):
+		aOutputFile.write("<br>")
+
+	def WriteFooter(self, aOutputFile):
+		aOutputFile.write("<br><hr><center><h5>"+KCopyrightLine1Html+"</h5>")
+		aOutputFile.write("<h5>")
+		CHtmlOutputFileBase.WriteLink(self, aOutputFile, "http://"+KWww, KWww)
+		aOutputFile.write("</h5></center></body></html>")
+
+	def CleanupLink(self, aHref):
+		# Mozilla Firefox does not handle link with the '#' character correctly, 
+		# so we need to replace it with the equivalent URL encoding "%23"
+		aHref = aHref.replace("#", "%23")
+		# Mozilla Firefox sometimes does not handle link with '\' correctly,
+		# so we need to replace it with '/'
+		aHref = aHref.replace('\\', '/')
+		return aHref
+
+
+class CHtmlOutputFile(CHtmlOutputFileBase):
+
+	# #######################################################
+	# CHtmlOutputFile - simplified access to HTML output file
+
+	def __init__(self, aOutputPath):
+		if not os.path.isdir(os.path.dirname(aOutputPath)):
+			os.makedirs(os.path.dirname(aOutputPath))
+		self.iOutputFile = file(aOutputPath, "w")
+		self.WriteHeader(self.iOutputFile)
+
+	def Write(self, aText):
+		CHtmlOutputFileBase.Write(self, self.iOutputFile, aText)
+
+	def WriteLink(self, aHref, aText):
+		CHtmlOutputFileBase.WriteLink(self, self.iOutputFile, aHref, aText)
+
+	def WriteElement(self, aElementName, aElementValue):
+		CHtmlOutputFileBase.WriteElement(self, self.iOutputFile, aElementName, aElementValue)
+
+	def WriteBreak(self):
+		CHtmlOutputFileBase.WriteBreak(self, self.iOutputFile)
+		
+	def Close(self):
+		self.WriteFooter(self.iOutputFile)
+		self.iOutputFile.close()
+
+
+class CHtmlComponentSummaryFiles:
+
+	# #######################################################
+	# CHtmlComponentSummaryFiles
+	# Encapsulates the component summary files for HTML output.
+	# For each component, there is a component report file listing the number 
+	# of occurrences of each problem type. There is also a single index or 
+	# summary file with links to each of the component report files.
+
+	def CreateSummaries(self, aHtmlRenderer, aOutputDirectory):
+		totalErrorCount = 0
+		outputPath = os.path.normpath(os.path.join(aOutputDirectory, "componentIndex.html"))
+		componentSummaryFile = CHtmlOutputFile(outputPath)
+		componentSummaryFile.Write("<font face=verdana>")
+		componentSummaryFile.WriteElement("h2", "Component Summary")
+		componentSummaryFile.Write("Source: "+scanner.iSource)
+		componentSummaryFile.WriteBreak()
+		componentSummaryFile.Write("Scan started at:   " + scanner.iStartTime)
+		componentSummaryFile.WriteBreak()
+		componentSummaryFile.Write("Scan completed at: " + scanner.iEndTime)
+		componentSummaryFile.WriteBreak()
+		componentSummaryFile.WriteBreak()
+		componentSummaryFile.WriteLink("problemIndex.html", "View problems by type")
+		componentSummaryFile.WriteBreak()
+		componentSummaryFile.Write("<hr>")
+		componentSummaryFile.WriteBreak()
+		componentSummaryFile.Write("<table border=\"1\" width=\"100%\">")
+		componentSummaryFile.Write("<tr bgcolor=\"#0099ff\">")
+		componentSummaryFile.WriteElement("th width=\"75%\"", "Component")
+		componentSummaryFile.WriteElement("th", "Items Found")
+		componentSummaryFile.WriteElement("th", "Lines of Code")
+		componentSummaryFile.WriteElement("th", "Possible Defects/KLOC")
+		componentSummaryFile.Write("</tr>")
+		for component in scanner.iComponentManager.iCompletedComponents:
+			componentName = scanner.iComponentManager.ComponentName(component.iFullPath)
+			outputPath = os.path.normpath(os.path.join(aOutputDirectory, "byComponent"))
+			outputPath = os.path.normpath(os.path.join(outputPath, componentName))
+			outputPath = os.path.normpath(os.path.join(outputPath, "componentSummary.html"))
+			errorCount = self.WriteComponentReport(aHtmlRenderer, outputPath, component.iFullPath, componentName)
+			if (errorCount > 0):
+				totalErrorCount = totalErrorCount + errorCount
+				numberOfLinesScanned = component.iNumberOfLinesScanned
+				if (numberOfLinesScanned > 0):
+					defectsPerKLOC = int((1000.0 / numberOfLinesScanned) * errorCount)
+				else:
+					defectsPerKLOC = 0
+				componentSummaryFile.Write("<tr>")
+				componentSummaryFile.Write("<td>")
+				relOutputPath = os.path.normpath(os.path.join("byComponent", componentName))
+				relOutputPath = os.path.normpath(os.path.join(relOutputPath, "componentSummary.html"))
+				componentSummaryFile.WriteLink(relOutputPath, component.iFullPath)
+				componentSummaryFile.Write("</td>")
+				componentSummaryFile.Write("<td>")
+				componentSummaryFile.WriteElement("center",str(errorCount))
+				componentSummaryFile.Write("</td>")
+				componentSummaryFile.Write("<td>")
+				componentSummaryFile.WriteElement("center",str(numberOfLinesScanned))
+				componentSummaryFile.Write("</td>")
+				componentSummaryFile.Write("<td>")
+				componentSummaryFile.WriteElement("center",str(defectsPerKLOC))
+				componentSummaryFile.Write("</td>")
+				componentSummaryFile.Write("</tr>")
+
+		componentSummaryFile.Write("<tr>")
+		componentSummaryFile.Write("<td>")
+		componentSummaryFile.WriteElement("b", "Total")
+		componentSummaryFile.Write("</td>")
+		componentSummaryFile.Write("<td><center>")
+		componentSummaryFile.WriteElement("b", str(totalErrorCount))
+		componentSummaryFile.Write("</center></td>")
+		componentSummaryFile.Write("</tr>")
+
+		componentSummaryFile.Write("</table>")
+		componentSummaryFile.Close()
+
+	def WriteComponentReport(self, aHtmlRenderer, aOutputPath, aComponentFullPath, aComponentName):
+		totalErrorCount = 0
+		componentReportFile = CHtmlOutputFile(aOutputPath)
+		componentReportFile.Write("<font face=verdana>")
+		componentReportFile.WriteElement("h2", "Component Report")
+		componentReportFile.WriteElement("h3", "Component: "+aComponentFullPath)
+		componentReportFile.Write("<font face=verdana color=black>")
+		found = False
+		for category in KCategoryHtmlDisplayOrder:
+			if scanner.iCategoriedScripts.iScripts.has_key(category):
+				for script in scanner.iCategoriedScripts.iScripts[category]:
+					errorCount = scanner.iComponentManager.ScriptComponentErrorCount(aComponentFullPath, script.iScriptName)
+					if errorCount > 0:
+						found = True
+						break
+
+		if found:
+			componentReportFile.Write("<table border=\"1\" width=\"100%\">")
+			componentReportFile.Write("<tr bgcolor=\"#0099ff\">")
+			componentReportFile.WriteElement("th width=\"75%\"", "Problem")
+			componentReportFile.WriteElement("th", "Items Found")
+			componentReportFile.WriteElement("th", "Severity")
+			componentReportFile.Write("</tr>")
+			for category in KCategoryHtmlDisplayOrder:
+				if scanner.iCategoriedScripts.iScripts.has_key(category):
+					for script in scanner.iCategoriedScripts.iScripts[category]:
+						errorCount = scanner.iComponentManager.ScriptComponentErrorCount(aComponentFullPath, script.iScriptName)
+						if errorCount > 0:
+							componentReportFile.Write("<tr>")
+							componentReportFile.Write("<td>")
+							#scriptComponentPath = aHtmlRenderer.ScriptComponentPath(aComponentFullPath, script.iScriptName)
+							#componentReportFile.WriteLink(scriptComponentPath, script.iTitle)
+							componentReportFile.WriteLink(script.iScriptName+".html", script.iTitle)
+							componentReportFile.Write("</td>")
+							componentReportFile.Write("<td>")
+							componentReportFile.WriteElement("center", str(errorCount))
+							componentReportFile.Write("</td>")
+							componentReportFile.Write("<td>")
+							componentReportFile.WriteElement("center", KSeverityHTMLMap[script.iSeverity])
+							componentReportFile.Write("</td>")
+							componentReportFile.Write("</tr>")
+							totalErrorCount = totalErrorCount + errorCount
+			componentReportFile.Write("<tr>")
+			componentReportFile.Write("<td>")
+			componentReportFile.WriteElement("b", "Total")
+			componentReportFile.Write("</td>")
+			componentReportFile.Write("<td><center>")
+			componentReportFile.WriteElement("b", str(totalErrorCount))
+			componentReportFile.Write("</center></td>")
+			componentReportFile.Write("</tr>")
+			componentReportFile.Write("</table>")
+		else:
+			componentReportFile.WriteBreak()
+			componentReportFile.WriteElement("i", "There are no items to report for this component.")
+			componentReportFile.WriteBreak()
+		componentReportFile.Close()
+		return totalErrorCount
+
+
+class CHtmlScriptSummaryFiles:
+
+	# #######################################################
+	# CHtmlScriptSummaryFiles
+	# Encapsulates the script (problem) summary files for HTML output.
+	# For each script, there is a file listing the number of occurrences
+	# of that script's problem for each component. There is also a single
+	# index or summary file with links to each of the problem report file.
+
+	def CreateSummaries(self, aHtmlRenderer, aOutputDirectory):
+
+		totalErrorCount = 0
+
+		outputPath = os.path.normpath(os.path.join(aOutputDirectory, "problemIndex.html"))
+		scriptSummaryFile = CHtmlOutputFile(outputPath)
+		scriptSummaryFile.Write("<font face=verdana>")
+		scriptSummaryFile.WriteElement("h2", "Problem Summary")
+		scriptSummaryFile.Write("Source: "+scanner.iSource)
+		scriptSummaryFile.WriteBreak()
+		scriptSummaryFile.Write("Scan started at:   " + scanner.iStartTime)
+		scriptSummaryFile.WriteBreak()
+		scriptSummaryFile.Write("Scan completed at: " + scanner.iEndTime)
+		scriptSummaryFile.WriteBreak()
+		scriptSummaryFile.WriteBreak()
+		scriptSummaryFile.WriteLink("componentIndex.html", "View problems by component")
+		scriptSummaryFile.WriteBreak()
+		scriptSummaryFile.Write("<hr>")
+		scriptSummaryFile.WriteBreak()
+		for category in KCategoryHtmlDisplayOrder:
+			if scanner.iCategoriedScripts.iScripts.has_key(category):
+				scriptSummaryFile.WriteElement("h3", "Category: "+category)
+				scriptSummaryFile.Write("<table border=\"1\" width=\"100%\">")
+				scriptSummaryFile.Write("<tr bgcolor=\"#0099ff\">")
+				scriptSummaryFile.WriteElement("th width=\"75%\"", "Problem")
+				scriptSummaryFile.WriteElement("th", "Items Found")
+				scriptSummaryFile.WriteElement("th", "Severity")
+				scriptSummaryFile.Write("</tr>")
+				categoryErrorCount = 0
+				for script in scanner.iCategoriedScripts.iScripts[category]:
+					outputPath = os.path.normpath(os.path.join(aOutputDirectory, "byProblem"))
+					outputPath = os.path.normpath(os.path.join(outputPath, script.iScriptName+"Summary.html"))
+					errorCount = self.WriteScriptReport(aHtmlRenderer, outputPath, script)
+					categoryErrorCount = categoryErrorCount + errorCount
+					scriptSummaryFile.Write("<tr>")
+					scriptSummaryFile.Write("<td>")
+					relOutputPath = os.path.normpath(os.path.join("byProblem", script.iScriptName+"Summary.html"))
+					scriptSummaryFile.WriteLink(relOutputPath, script.iTitle)
+					scriptSummaryFile.Write("</td>")
+					scriptSummaryFile.Write("<td>")
+					scriptSummaryFile.WriteElement("center", str(errorCount))
+					scriptSummaryFile.Write("</td>")
+					scriptSummaryFile.Write("<td>")
+					scriptSummaryFile.WriteElement("center", KSeverityHTMLMap[script.iSeverity])
+					scriptSummaryFile.Write("</td>")
+					scriptSummaryFile.Write("</tr>")
+				totalErrorCount = totalErrorCount + categoryErrorCount
+				scriptSummaryFile.Write("<tr>")
+				scriptSummaryFile.Write("<td>")
+				scriptSummaryFile.WriteElement("b", "Category Total")
+				scriptSummaryFile.Write("</td>")
+				scriptSummaryFile.Write("<td>")
+				scriptSummaryFile.WriteElement("center", "<b>"+str(categoryErrorCount)+"</b>")
+				scriptSummaryFile.Write("</td>")
+				scriptSummaryFile.Write("</tr>")
+				scriptSummaryFile.Write("</table>")
+
+		scriptSummaryFile.WriteBreak()
+		scriptSummaryFile.WriteElement("b", "Total: " + str(totalErrorCount))
+		scriptSummaryFile.WriteBreak()
+
+		scriptSummaryFile.Close()
+
+	def WriteScriptReport(self, aHtmlRenderer, aOutputPath, aScript):
+		totalErrorCount = 0
+		scriptReportFile = CHtmlOutputFile(aOutputPath)
+		scriptReportFile.Write("<font face=verdana>")
+		scriptReportFile.WriteElement("h2", "Problem Report")
+		scriptReportFile.WriteElement("h3", "Problem: " + aScript.iTitle)
+		scriptReportFile.Write(aScript.iDescription)
+		scriptReportFile.WriteBreak()
+		scriptReportFile.WriteBreak()
+
+		found = False
+		for component in scanner.iComponentManager.iCompletedComponents:
+			errorCount = scanner.iComponentManager.ScriptComponentErrorCount(component.iFullPath, aScript.iScriptName)
+			if errorCount > 0:
+				found = True
+				break
+
+		if found:
+			scriptReportFile.Write("<table border=\"1\" width=\"100%\">")
+			scriptReportFile.Write("<tr bgcolor=\"#0099ff\">")
+			scriptReportFile.WriteElement("th width=\"80%\"", "Component")
+			scriptReportFile.WriteElement("th", "Items Found")
+			scriptReportFile.Write("</tr>")
+			for component in scanner.iComponentManager.iCompletedComponents:
+				errorCount = scanner.iComponentManager.ScriptComponentErrorCount(component.iFullPath, aScript.iScriptName)
+				if errorCount > 0:
+					scriptReportFile.Write("<tr>")
+					scriptReportFile.Write("<td>")
+					scriptComponentPath = aHtmlRenderer.ScriptComponentPath(component.iFullPath, aScript.iScriptName, "..")
+					scriptReportFile.WriteLink(scriptComponentPath, component.iFullPath)
+					scriptReportFile.Write("</td>")
+					scriptReportFile.Write("<td>")
+					scriptReportFile.WriteElement("center", str(errorCount))
+					scriptReportFile.Write("</td>")
+					scriptReportFile.Write("</tr>")
+					totalErrorCount = totalErrorCount + errorCount
+			scriptReportFile.Write("<tr>")
+			scriptReportFile.Write("<td>")
+			scriptReportFile.WriteElement("b", "Total")
+			scriptReportFile.Write("</td>")
+			scriptReportFile.Write("<td><center>")
+			scriptReportFile.WriteElement("b", str(totalErrorCount))
+			scriptReportFile.Write("</center></td>")
+			scriptReportFile.Write("</tr>")
+			scriptReportFile.Write("</table>")
+		else:
+			scriptReportFile.WriteBreak()
+			scriptReportFile.WriteElement("i", "There are no items of this problem type to report.")
+			scriptReportFile.WriteBreak()
+
+		scriptReportFile.Close()
+		return totalErrorCount
+
+
+class CHtmlScriptComponentFile:
+
+	# #######################################################
+	# CHtmlScriptComponentFile
+	# Encapsulates access to the HTML output files with the greatest amount of detail.
+	# Each of these files is for a specific problem (script) and for a specific component.
+
+	# The file handle is closed between each call to avoid exhausting the system
+	# limit for open file handles. Many of these files may be open at one time,
+	# and the number of open files is dependent on both the directory structure
+	# being traversed and the number of types of problems found.
+
+	def __init__(self, aLxrUrl, aLxrVersion):
+		self.iLxrUrl = aLxrUrl
+		self.iLxrVersion = aLxrVersion
+		
+	def BeginOutputFile(self, aOutputPath, aScript, aComponentName):
+		if not os.path.isdir(os.path.dirname(aOutputPath)):
+			os.makedirs(os.path.dirname(aOutputPath))
+		outputFile = file(aOutputPath, "w")
+		self.iScriptComponentFile = CHtmlOutputFileBase()
+		self.iScriptComponentFile.Write(outputFile, "<font face=verdana>")
+		self.iScriptComponentFile.WriteHeader(outputFile)
+		self.iScriptComponentFile.WriteElement(outputFile, "h2", "Detailed Problem Report")
+		self.iScriptComponentFile.WriteElement(outputFile, "h3", "Component: "+aComponentName)
+		self.iScriptComponentFile.WriteElement(outputFile, "h3", "Problem: "+aScript.iTitle)
+		self.iScriptComponentFile.Write(outputFile, aScript.iDescription)
+		self.iScriptComponentFile.WriteBreak(outputFile)
+		self.iScriptComponentFile.Write(outputFile, "<hr>")
+		self.iScriptComponentFile.WriteBreak(outputFile)
+		outputFile.close()
+
+	def ReportError(self, aOutputPath, aLineContext):
+		outputFile = file(aOutputPath, "a")
+		if self.iLxrUrl == None:
+			# Mozilla Firefox cannot open links to local files, 
+			# so it is necessary to convert local file path
+			filePath = "file:///" + aLineContext.iFileName
+		else:
+			# generate link to LXR server instead of local file system
+			filePath = self.iLxrUrl + aLineContext.iFileName[len(scanner.iComponentManager.iRootPath):]
+			if self.iLxrVersion <> None:
+				filePath = filePath + "?v="+self.iLxrVersion
+			filePath = filePath + '#%03d'%aLineContext.iLineNumber
+		self.iScriptComponentFile.WriteLink(outputFile, filePath, self.TrimFileName(aLineContext))
+		self.iScriptComponentFile.Write(outputFile, "(" + str(aLineContext.iLineNumber) + ") ")
+		self.iScriptComponentFile.Write(outputFile, aLineContext.iClassName+"::"+aLineContext.iMethodName+" ")
+		self.iScriptComponentFile.Write(outputFile, "<code><font color=red>"+self.CleanUpText(aLineContext.iLineText))
+		self.iScriptComponentFile.Write(outputFile, "</font></code>")
+		self.iScriptComponentFile.WriteBreak(outputFile)
+		if len(scanner.iRendererManager.iAnnotation)>0:
+			self.iScriptComponentFile.Write(outputFile, scanner.iRendererManager.iAnnotation)
+			self.iScriptComponentFile.WriteBreak(outputFile)
+			scanner.iRendererManager.iAnnotation = ""
+		outputFile.close()
+
+	def EndOutputFile(self, aOutputPath):
+		outputFile = file(aOutputPath, "a")
+		self.iScriptComponentFile.WriteFooter(outputFile)
+		outputFile.close()
+
+	def TrimFileName(self, aLineContext):
+		filename = aLineContext.iFileName
+		componentNameLen = len(aLineContext.iComponentName)
+		if len(filename) > componentNameLen:
+			if filename[0:componentNameLen] == aLineContext.iComponentName:
+				filename = filename[componentNameLen:]
+				if filename[0] == os.path.sep:
+					filename = filename[1:]
+		return filename
+
+	def CleanUpText(self, aLineText):
+		# check for sub-strings that look like HTML tags and preform clean up if needed
+		reTag = re.compile(r"""(<.+>)""", re.VERBOSE)
+		foundTag = reTag.search(aLineText)
+		if foundTag:
+			aNewLineText = aLineText.replace("<", "&lt;")
+			aNewLineText = aNewLineText.replace(">", "&gt;")
+			return aNewLineText
+		else:
+			return aLineText		
+
+			
+def ComponentCompare(a, b):
+	return cmp(os.path.normcase(a.iFullPath), os.path.normcase(b.iFullPath))
+
+
+class CHtmlRenderer(CRendererBase):
+
+	# #######################################################
+	# CHtmlRenderer - a renderer for HTML output
+
+	# I have nothing to offer but blood, toil, tears and sweat. 
+	#  - Winston Churchill, 1940 
+
+	def __init__(self, aRendererManager, aOutputDirectory, aLxrUrl, aLxrVersion):
+		self.RegisterSelf("html", "HTML renderer", aRendererManager)
+		self.iOutputDirectory = aOutputDirectory
+		if os.path.isdir(self.iOutputDirectory) != True :
+			os.makedirs(self.iOutputDirectory)
+		self.iScriptComponentFile = CHtmlScriptComponentFile(aLxrUrl, aLxrVersion)
+		self.iScriptComponentFilePaths = {}
+		print
+		print KVersion
+		print KCopyrightLine1
+		print KCopyrightLine2
+
+	def BeginFile(self, aFilename):
+		self.iFilename = aFilename
+		scanner.ReportAction("Scanning file " + aFilename)
+
+	def ReportError(self, aLineContext, aScript):
+		outputPath = self.ScriptComponentPath(aLineContext.iComponentName, aScript.iScriptName)
+		if not os.path.isfile(outputPath):
+			self.iScriptComponentFilePaths[aLineContext.iComponentName].append(outputPath)
+			self.iScriptComponentFile.BeginOutputFile(outputPath, aScript, aLineContext.iComponentName)
+		self.iScriptComponentFile.ReportError(outputPath, aLineContext)
+
+	def EndFile(self):
+		return
+
+	def BeginComponent(self, aComponent):
+		self.iScriptComponentFilePaths[aComponent.iFullPath] = []
+
+	def EndComponent(self, aComponent):
+		if self.iScriptComponentFilePaths.has_key(aComponent.iFullPath):
+			for outputPath in self.iScriptComponentFilePaths[aComponent.iFullPath]:
+				self.iScriptComponentFile.EndOutputFile(outputPath)
+			del self.iScriptComponentFilePaths[aComponent.iFullPath]
+		relativeComponentName = scanner.iComponentManager.RelativeComponentName(aComponent.iFullPath)
+		if len(relativeComponentName) < 1:	# root component - final component
+			scanner.iEndTime = datetime.datetime.now().ctime()
+			scanner.iComponentManager.iCompletedComponents.sort(ComponentCompare)
+			scriptSummaryFiles = CHtmlScriptSummaryFiles()
+			scriptSummaryFiles.CreateSummaries(self, self.iOutputDirectory)
+			componentSummaryFiles = CHtmlComponentSummaryFiles()
+			componentSummaryFiles.CreateSummaries(self, self.iOutputDirectory)
+
+	def ScriptComponentPath(self, aComponentName, aScriptName, aRel=None):
+		componentName = scanner.iComponentManager.ComponentName(aComponentName)
+		if aRel==None:
+			aRel = self.iOutputDirectory
+		outputPath = os.path.normpath(os.path.join(aRel, "byComponent"))
+		outputPath = os.path.normpath(os.path.join(outputPath, componentName))
+		outputPath = os.path.normpath(os.path.join(outputPath, aScriptName+".html"))
+		return outputPath
+
+
+class CRendererManager:
+
+	# #######################################################
+	# CRendererManager
+	# this class handles all the renderers 
+
+	def __init__(self):
+		# declare associative list of renderers: iRendererList[name]=renderer
+		self.iRendererList = {}
+		self.iAnnotation = ""
+
+	def AddRenderer(self, aRenderer):
+		self.iRendererList[aRenderer.iName.lower()] = aRenderer
+
+	def PrintListOfRenderers(self):
+		print("Renderers:")        
+		for name, renderer in self.iRendererList.items():
+			print("\t" + name + "\t" + renderer.iDescription)
+
+		print("")
+
+	def BeginFile(self, aFilename):
+		for name, renderer in self.iRendererList.items():
+			renderer.BeginFile(aFilename)
+
+	def ReportError(self, aLineContext, aScript):
+		for name, renderer in self.iRendererList.items():
+			renderer.ReportError(aLineContext, aScript)
+
+	def ReportAnnotation(self, aAnnotation):
+		self.iAnnotation = aAnnotation
+
+	def EndFile(self):
+		for name, renderer in self.iRendererList.items():
+			renderer.EndFile()
+
+	def BeginComponent(self, aComponent):
+		for name, renderer in self.iRendererList.items():
+			renderer.BeginComponent(aComponent)
+
+	def EndComponent(self, aComponent):
+		for name, renderer in self.iRendererList.items():
+			renderer.EndComponent(aComponent)
+
+
+class CComponent:
+
+	# #######################################################
+	# CComponent - a single component, identified by the
+	# directory path to its source code
+
+	def __init__(self, aPath):
+		self.iFullPath = aPath
+		self.iScriptErrorCounts = {}
+		self.iHasGroupDir = False
+		self.iNumberOfLinesScanned = 0
+
+	def appendComponent(self, aComponent):
+		for scriptName in aComponent.iScriptErrorCounts.keys():
+			if self.iScriptErrorCounts.has_key(scriptName):
+				self.iScriptErrorCounts[scriptName] += aComponent.iScriptErrorCounts[scriptName]
+			else:
+				self.iScriptErrorCounts[scriptName] = aComponent.iScriptErrorCounts[scriptName]
+		self.iNumberOfLinesScanned += aComponent.iNumberOfLinesScanned
+		return
+
+
+class CComponentManager:
+
+	# #######################################################
+	# CComponentManager - controls access to components
+
+	def __init__(self):
+		self.iComponentStack = []
+		self.iCompletedComponents = []
+		self.iRootComponent = CComponent("")
+		self.iUseFullComponentPath = False
+
+	def SetRoot(self, aRootPath):
+		# set the list of root directories - used to left-trim component names
+		self.iRootPath = self.SanitizePath(aRootPath)
+
+	def BeginDirectory(self, aPath):
+		aPath = self.SanitizePath(aPath)
+		if os.path.isdir(aPath):
+			newComponent = CComponent(aPath)
+			contents = os.listdir(aPath)
+			for entry in contents:
+				if (entry.upper() == "GROUP"):
+					entryPath = os.path.normpath(os.path.join(aPath, entry))
+					if os.path.isdir(entryPath):
+						newComponent.iHasGroupDir = True
+						break
+			if len(self.iComponentStack) > 0:
+				topComponent = self.iComponentStack[len(self.iComponentStack)-1]
+				if (newComponent.iHasGroupDir or (not topComponent.iHasGroupDir)):
+					self.BeginComponent(newComponent)
+				else:
+					scanner.iLog.Write(aPath + " taken as part of " + topComponent.iFullPath)
+			else:
+				self.BeginComponent(newComponent)
+		else:
+			scanner.iLog.Write("ERROR: CComponentManager::BeginDirectory: bad path "+aPath)
+		return aPath
+
+	def EndDirectory(self, aPath, numberOfLinesScanned):
+		aPath = self.SanitizePath(aPath)
+		if len(self.iComponentStack) > 0:
+			topComponent = self.iComponentStack[len(self.iComponentStack)-1]
+			topComponent.iNumberOfLinesScanned += numberOfLinesScanned
+			if (topComponent.iFullPath == aPath):
+				self.EndComponent()
+
+	def ReportError(self, aLineContext, aScript):
+		scanner.iRendererManager.ReportError(aLineContext, aScript)
+		for component in self.iComponentStack:
+			if component.iFullPath == aLineContext.iComponentName:
+				if component.iScriptErrorCounts.has_key(aScript.iScriptName):
+					component.iScriptErrorCounts[aScript.iScriptName] = component.iScriptErrorCounts[aScript.iScriptName] + 1
+				else:
+					component.iScriptErrorCounts[aScript.iScriptName] = 1
+
+	def ScriptComponentErrorCount(self, aComponentName, aScriptName):
+		for component in self.iCompletedComponents:
+			if component.iFullPath == aComponentName:
+				if component.iScriptErrorCounts.has_key(aScriptName):
+					return component.iScriptErrorCounts[aScriptName]
+				else:
+					return 0
+		return 0
+
+	def BeginComponent(self, aComponent):
+		scanner.iRendererManager.BeginComponent(aComponent)
+		scanner.ReportAction("Begin component: " + aComponent.iFullPath)
+		self.iComponentStack.append(aComponent)
+
+	def EndComponent(self):
+		previousComponent = self.iComponentStack.pop()
+		matchingComponent = self.MatchingComponent(previousComponent)
+		if (matchingComponent <> None):
+			matchingComponent.appendComponent(previousComponent)
+		else:
+			self.iCompletedComponents.append(previousComponent)
+		scanner.ReportAction("End component: " + previousComponent.iFullPath)
+		scanner.iRendererManager.EndComponent(previousComponent)
+
+	def MatchingComponent(self, aComponent):
+		for component in self.iCompletedComponents:
+			if (ComponentCompare(component, aComponent) == 0):
+				return component
+		return None
+
+	def CurrentComponentName(self):
+		if len(self.iComponentStack) < 1:
+			return None
+		return self.iComponentStack[len(self.iComponentStack)-1].iFullPath
+
+	def SanitizePath(self, aPath):
+		# Translate an unspecified or relative pathname into an absolute pathname
+		if len(aPath) < 1:
+			aPath = "."
+		aPath = os.path.normpath(aPath)
+		# translate "." and ".." into absolute paths
+		aPath = os.path.abspath(aPath)
+		return aPath
+
+	def ComponentName(self, aFullComponentName):
+		if (self.iUseFullComponentPath):
+			(unused, componentName) = os.path.splitdrive(aFullComponentName)
+			if len(componentName) > 0:
+				if componentName[0] == os.path.sep and len(componentName) > 1:
+					componentName = componentName[1:]
+			return componentName
+		else:
+			return self.RelativeComponentName(aFullComponentName)
+
+	def RelativeComponentName(self, aFullComponentName):
+		# Remove the root path from the specified component name
+		rootLen = len(self.iRootPath)
+		if aFullComponentName[0:rootLen] == self.iRootPath:
+			relativeComponentName = aFullComponentName[rootLen:]
+		else:
+			# this case is unexpected...but we'll try to make the best of it
+			(unused, relativeComponentName) = os.path.splitdrive(aFullComponentName)
+		# trim leading path separator, if present
+		if len(relativeComponentName) > 0:
+			if relativeComponentName[0] == os.path.sep and len(relativeComponentName) > 1:
+				relativeComponentName = relativeComponentName[1:]
+		return relativeComponentName
+
+
+class CLineContext:
+
+	# #######################################################
+	# CLineContext
+	# A description of the line of source code currently being scanned
+
+	iComponentName = ""
+	iFileName = ""
+	iLineNumber = 0
+	iClassName = ""
+	iMethodName = ""
+	iLineText = ""
+
+
+class CCodeScanner:
+
+	# #######################################################
+	# CCodeScanner - main application class
+
+	def __init__(self):
+		self.iCategoriedScripts = CCategorisedScripts()
+		self.iRendererManager   = CRendererManager()
+		self.iComponentManager = CComponentManager()
+		self.iLineContext = CLineContext()
+		self.iDomConfig = None
+		self.iVerbose = False
+		self.iLog = None
+		self.iSource = None
+		self.iEncodedFileList = None
+		self.iOutputDirectory = None
+		self.iStartTimeObj = None
+		self.iStartTime = None
+		self.iEndTime = None
+		self.iLxrUrl = None
+		self.iLxrVersion = None
+		self.iConfigFilename = ""
+		self.iInputFilenames = ""
+		self.iLogFilename = ""
+		self.iOutputFormat = ""
+		self.iTimeStampedOutput = ""
+		self.iReMethod = re.compile(r"""
+			((?P<class>\w+)::~?)?
+			(?P<method>[A-Za-z0-9<>=!*\-+/]+)
+			[\s\n]*
+			\(
+			[^;]*
+			$
+			""", re.VERBOSE)
+
+	def ReportError(self, aErrorMsg):
+		self.iLog.Write(aErrorMsg)
+		print aErrorMsg
+
+	def ReportAction(self, aAction):
+		self.iLog.Write(aAction)
+		if self.iVerbose:
+			print aAction
+
+	def ReportInfo(self, aInfoMsg):
+		self.iLog.Write(aInfoMsg)
+		print aInfoMsg
+
+	def CleanOutputDirectory(self):
+		self.iLog.Write("Deleting existing contents of output directory " + self.iOutputDirectory)
+		for root, dirs, files in os.walk(self.iOutputDirectory, topdown = False):
+			for name in files:
+				os.remove(os.path.join(root, name))
+			for name in dirs:
+				os.rmdir(os.path.join(root, name))
+
+	def CheckSourceIncluded(self, aSourceFileName):
+		if (self.iDomConfig <> None):
+			for sourceNode in self.iDomConfig.getElementsByTagName("sources"):
+				for excludeSourceNode in sourceNode.getElementsByTagName("exclude"):
+					reExcludeSourceStr = excludeSourceNode.firstChild.nodeValue
+					reExcludeSource = re.compile(reExcludeSourceStr, re.IGNORECASE)
+					if reExcludeSource.search(aSourceFileName):
+						self.ReportInfo("Note: excluding " + aSourceFileName + " : " + reExcludeSourceStr)
+						return False
+		return True
+
+	def CheckScriptEnabled(self, aScript):
+		if (self.iDomConfig <> None):
+			for scriptsNode in self.iDomConfig.getElementsByTagName("scripts"):
+				for scriptNode in scriptsNode.getElementsByTagName(aScript.iScriptName):
+					enabledAttr = scriptNode.getAttribute("enable")
+					if (enabledAttr.lower() == "false"):
+						return False
+			for severitiesNode in self.iDomConfig.getElementsByTagName("severities"):
+				for severityNode in severitiesNode.getElementsByTagName(KSeverityConfigMap[aScript.iSeverity]):
+					enabledAttr = severityNode.getAttribute("enable")
+					if (enabledAttr.lower() == "false"):
+						return False
+			for categoriesNode in self.iDomConfig.getElementsByTagName("categories"):
+				for categoryNode in categoriesNode.getElementsByTagName(KCategoryConfigMap[aScript.iCategory]):
+					enabledAttr = categoryNode.getAttribute("enable")
+					if (enabledAttr.lower() == "false"):
+						return False
+		return True
+
+	def UpdateScriptCategory(self, aScript):
+		if (self.iDomConfig <> None):
+			for scriptsNode in self.iDomConfig.getElementsByTagName("scripts"):
+				for scriptNode in scriptsNode.getElementsByTagName(aScript.iScriptName):
+					if scriptNode.hasAttribute("category"):
+						newCategory = scriptNode.getAttribute("category").lower()
+						if (newCategory <> KCategoryConfigMap[aScript.iCategory]):
+							for name, value in KCategoryConfigMap.items():
+								if (newCategory == value):
+									return name
+		# no update needed, return original category
+		return aScript.iCategory
+
+	def UpdateScriptSeverity(self, aScript):
+		if (self.iDomConfig <> None):
+			for scriptsNode in self.iDomConfig.getElementsByTagName("scripts"):
+				for scriptNode in scriptsNode.getElementsByTagName(aScript.iScriptName):
+					if scriptNode.hasAttribute("severity"):
+						newSeverity = scriptNode.getAttribute("severity").lower()
+						if (newSeverity <> KSeverityConfigMap[aScript.iSeverity]):
+							for name, value in KSeverityConfigMap.items():
+								if (newSeverity == value):
+									return name
+		# no update needed, return original severity
+		return aScript.iSeverity
+
+	def ScanFile(self, aSourceFile):
+		self.iLineContext.iFileName = aSourceFile
+		self.iLineContext.iLineNumber = 0
+		self.iLineContext.iClassName = ""
+		self.iLineContext.iMethodName = ""
+		self.iLineContext.iComponentName = self.iComponentManager.CurrentComponentName()
+
+		self.iRendererManager.BeginFile(aSourceFile)
+
+		# note source file extension - used for filtering later on
+		(unused, sourceFileExt) = os.path.splitext(aSourceFile)
+		if len(sourceFileExt) > 0 and sourceFileExt[0] == '.':
+			sourceFileExt = sourceFileExt[1:]
+
+		# open, read, and preparse source file
+		inputFileHandle = file(aSourceFile, "r")
+		inputFileLines = inputFileHandle.readlines()
+		inputFileHandle.close()
+		
+		(noQuoteFileLines, noCommentFileLines, noCommentOrQuoteFileLines, csCommands) = self.PreParseSourceFile(inputFileLines)
+
+		# bundle all the filtered versions of the file contents into
+		# a hash to re-factor code
+		fileContentsToTest = { KIgnoreNothing           : inputFileLines,
+							   KIgnoreComments          : noCommentFileLines,
+							   KIgnoreQuotes            : noQuoteFileLines,
+							   KIgnoreCommentsAndQuotes : noCommentOrQuoteFileLines
+							   }
+
+		# now apply test scripts to source file
+		iBraceCount = 0
+		iBraceCountList = []
+		newCurrentClassName = ""
+		newCurrentMethodName = ""
+		self.iCurrentClassName = ""
+		self.iCurrentMethodName = ""
+		self.iCurrentMethodStart = -1
+
+		totalNumberOfLines = len(inputFileLines)
+		reConstant = re.compile(r"""
+			^\s*
+			(static\s+)?
+			const
+			\s+
+			\w+		# type
+			\s*
+			[\*&]?	# reference or pointer
+			\s*
+			\w+		# name
+			\s*
+			(=|\()
+			""", re.VERBOSE)
+		reInheritance = re.compile("[\s:]*(public|protected|private)\s*([\w:]+)")
+		rePreprocessorIf = re.compile("^\s*\#(el)*if(.*)")
+		rePreprocessorElse = re.compile("^\s*\#else")
+		rePreprocessorEnd = re.compile("^\s*\#endif")
+		reTypedef = re.compile("^\s*typedef")
+		i = 0
+		while (i < totalNumberOfLines):
+			# for extra open braces in #if blocks
+			if (rePreprocessorIf.search(noCommentOrQuoteFileLines[i])):
+				iBraceCountList.append(iBraceCount)
+			if (rePreprocessorElse.search(noCommentOrQuoteFileLines[i])):
+				if (len(iBraceCountList) > 0):
+					iBraceCount = iBraceCountList.pop()
+			if (rePreprocessorEnd.search(noCommentOrQuoteFileLines[i])):
+				if (len(iBraceCountList) > 0):
+					iBraceCountList.pop()
+
+			if (newCurrentMethodName == ""):
+				methodString = noCommentOrQuoteFileLines[i]
+				currentLine = i
+				m = self.iReMethod.search(methodString)
+				if not m and (i + 1 < totalNumberOfLines):
+					currentLine = i + 1
+					methodString += noCommentOrQuoteFileLines[currentLine]
+					m = self.iReMethod.search(methodString)
+
+				if m and (iBraceCount == 0) and (methodString.find("#") == -1) and (methodString.find("_LIT") == -1):	# must be at root level and not a preprocessor directive or a _LIT
+					if not reTypedef.match(methodString) and not reConstant.match(methodString):  # must not be typedef or constant declaration 
+						# check for cases where macros are used to declare a class
+						# by searching for the inheritance part
+						# eg. NONSHARABLE_CLASS(CMyClass) : public CBase
+						isClass = reInheritance.search(methodString)
+						if not isClass and (currentLine + 1 < totalNumberOfLines):
+							methodString += noCommentOrQuoteFileLines[currentLine + 1]
+							isClass = reInheritance.search(methodString)
+						if not isClass:
+							newCurrentMethodName = m.group('method')
+							if m.group('class'):
+								newCurrentClassName = m.group('class')
+							else:
+								newCurrentClassName = ""
+
+			iBraceCount += noCommentOrQuoteFileLines[i].count("{")
+			if (iBraceCount > 0) and (newCurrentMethodName <> ""):
+				self.iCurrentClassName = newCurrentClassName
+				self.iCurrentMethodName = newCurrentMethodName
+				self.iCurrentMethodStart = i
+				newCurrentClassName = ""
+				newCurrentMethodName = ""
+
+			self.iLineContext.iLineNumber = i+1
+			self.iLineContext.iClassName = self.iCurrentClassName
+			self.iLineContext.iMethodName = self.iCurrentMethodName
+
+			# perform all test scripts onto source file									   
+			for script in self.iCategoriedScripts.AllScripts():
+				if (script.iFileExts.count(sourceFileExt) > 0
+				    and fileContentsToTest[script.iIgnore][i] != "\n"
+					and	script.iCompare(fileContentsToTest[script.iIgnore], i, script.iReMatch, aSourceFile)):
+					# skip any script that has been disabled via CodeScanner command(s) in sources
+					if script.iScriptName.lower() in csCommands[i].lower():
+						continue
+					self.iLineContext.iLineText = fileContentsToTest[script.iIgnore][i]
+					self.iComponentManager.ReportError(self.iLineContext, script)
+
+			iBraceCount -= noCommentOrQuoteFileLines[i].count("}")
+			if (iBraceCount < 0):	# for extra close braces in #if blocks
+				iBraceCount = 0
+
+			if (iBraceCount == 0):
+				self.iCurrentClassName = ""
+				self.iCurrentMethodName = ""
+				self.iCurrentMethodStart = -1
+
+			i = i + 1
+
+		self.iRendererManager.EndFile()
+		return totalNumberOfLines
+
+	def TraverseDirectory(self, aDirectory):
+		# skip folders marked to be excluded in configuration file
+		aPath = self.iComponentManager.SanitizePath(aDirectory)
+		if (not self.CheckSourceIncluded(aPath)) or (not self.CheckSourceIncluded(aPath + os.path.sep)):
+			return
+		aDirectory = self.iComponentManager.BeginDirectory(aDirectory)
+		contents = os.listdir(aDirectory)
+		numberOfLinesScanned = 0
+		for entry in contents:
+			entryPath = os.path.normpath(os.path.join(aDirectory, entry))
+			if os.path.isdir(entryPath):
+				self.TraverseDirectory(entryPath)
+			else:
+				if self.CheckSourceIncluded(entryPath):
+					numberOfLinesScanned += self.ScanFile(entryPath)
+		self.iComponentManager.EndDirectory(aDirectory, numberOfLinesScanned)
+
+	def AddScript(self, aScript):
+		enabled = self.CheckScriptEnabled(script)
+		if enabled:
+			aScript.iCategory = self.UpdateScriptCategory(aScript)
+			aScript.iSeverity = self.UpdateScriptSeverity(aScript)
+			self.iCategoriedScripts.AddScript(aScript)
+		else:
+			self.ReportInfo("Note: script '" + aScript.iScriptName + "' DISABLED")
+
+	def AddCustomScript(self, aScript):
+		self.ReportInfo("Note: custom rule '" + aScript.iScriptName + "' ADDED")
+		self.iCategoriedScripts.AddScript(aScript)
+
+	def PreParseSourceFile(self, aLines):
+		# it provides 3 versions of input:
+		# 	1. without quotes
+		# 	2. without comments
+		# 	3. without quotes and without comments
+		
+		inCommentBlock = 0
+		noQuoteLines = []
+		noCommentLines = []
+		noCommentOrQuoteLines = []
+		csCommands = []
+		reCSCommand = re.compile("codescanner((::\w+)+)") # CodeScanner command(s) in comments
+
+		for line in aLines:
+			noQuoteLine = ""
+			noCommentLine = ""
+			noCommentOrQuoteLine = ""
+			csCommand = "\n"
+
+			i = 0
+			startQuote = 0
+			b = 0
+			escCount = 0
+
+			while i < len(line):
+				# skip quotes
+				if not inCommentBlock and ((line[i] == "\"") or (line[i] == "\'")):
+					startQuote = i
+					i += 1
+					while (i < len(line)):
+						endIndex = line[i:].find(line[startQuote])
+						if (endIndex <> -1):
+							b = i + endIndex - 1
+							escCount = 0
+							while (line[b] == "\\"):
+								escCount += 1
+								b -= 1
+
+							i += endIndex + 1
+							if (escCount % 2 == 0):
+								noQuoteLine += "\"\""
+								noCommentOrQuoteLine += "\"\""
+								noCommentLine += line[startQuote:i]
+								break
+						else:
+							#	print "Unterminated quote : " + line
+							break
+					continue	
+				
+				# parse comments
+				if not inCommentBlock:
+					if (line[i] == "/"):
+						if (i < (len(line)-1)):
+							if (line[i + 1] == "/"):
+								noCommentLine += "\n"
+								noCommentOrQuoteLine += "\n"
+								noQuoteLine += line[i:]
+								# look for CodeScanner command(s) in comments
+								m = reCSCommand.search(line[i:])
+								if m:
+									csCommand = m.group(1)
+								break
+							elif (line[i + 1] == "*"):
+								inCommentBlock = 1
+								i += 2
+								noQuoteLine += "/*"
+								continue
+
+					noCommentLine += line[i]
+					noCommentOrQuoteLine += line[i]
+					noQuoteLine += line[i]
+				else:
+					# look for CodeScanner command(s) in comments
+					m = reCSCommand.search(line[i:])
+					if m:
+						csCommand = m.group(1)
+					endIndex = line[i:].find("*/")
+					if (endIndex <> -1):
+						inCommentBlock = 0
+						noQuoteLine += line[i:i + endIndex + 2]
+						i += endIndex + 2
+						continue
+					else:
+						noCommentLine += "\n"
+						noCommentOrQuoteLine += "\n"
+						noQuoteLine = line[i:]
+						break
+				
+				i += 1
+
+			noCommentLines.append(noCommentLine)
+			noCommentOrQuoteLines.append(noCommentOrQuoteLine)
+			noQuoteLines.append(noQuoteLine)
+			csCommands.append(csCommand)
+
+		return [noQuoteLines, noCommentLines, noCommentOrQuoteLines, csCommands]
+
+	def ReadConfigFile(self):
+		if self.iConfigFilename <> "":
+			if (os.path.isfile(self.iConfigFilename)):
+				self.iDomConfig = xml.dom.minidom.parse(self.iConfigFilename)
+				if self.iVerbose:
+					print "Note: using configuration file " + self.iConfigFilename
+			else:
+				self.ReportInfo("Unable to open specified configuration file: " + self.iConfigFilename)
+				self.iLog.Close()
+				sys.exit(2)
+
+	def ReadArgumentsFromConfigFile(self):
+		if (self.iDomConfig <> None):
+			for argumentsNode in self.iDomConfig.getElementsByTagName("arguments"):
+				# read input file names
+				for inputFileNode in argumentsNode.getElementsByTagName("input"):
+					self.iInputFilenames += inputFileNode.firstChild.nodeValue + "::"
+				# read output format
+				for outputFormatNode in argumentsNode.getElementsByTagName("outputformat"):
+					self.iOutputFormat += outputFormatNode.firstChild.nodeValue
+				# read lxr URL
+				for lxrURLNode in argumentsNode.getElementsByTagName("lxr"):
+					self.iLxrUrl = lxrURLNode.firstChild.nodeValue
+				# read lxr version
+				for lxrVersionNode in argumentsNode.getElementsByTagName("lxrversion"):
+					self.iLxrVersion = lxrVersionNode.firstChild.nodeValue
+				# read time stamped output option
+				for timeStampedOutputNode in argumentsNode.getElementsByTagName("timestampedoutput"):
+					self.iTimeStampedOutput = timeStampedOutputNode.firstChild.nodeValue
+
+	def ReadCustomRulesFromConfigFile(self):
+		if (self.iDomConfig <> None):
+			for customRulesNode in self.iDomConfig.getElementsByTagName("customrules"):
+				for customRuleNode in customRulesNode.getElementsByTagName("customrule"):
+					ignoreComments = True
+
+					# read the name of the rule
+					ruleName = ""
+					for ruleNameNode in customRuleNode.getElementsByTagName("name"):
+						if (ruleNameNode == None) or (ruleNameNode.firstChild == None) or (ruleNameNode.firstChild.nodeValue == None):
+							continue
+						else:
+							ruleName = ruleNameNode.firstChild.nodeValue
+					if len(ruleName) == 0:
+						self.ReportError("Missing custom rule name in configuration file: " + self.iConfigFilename)
+						continue
+
+					# read the keywords associated with the rule
+					keywordList = []
+					badKeywordElement = False
+					for keywordNode in customRuleNode.getElementsByTagName("keyword"):
+						# read keyword content
+						if (keywordNode == None) or (keywordNode.firstChild == None) or (keywordNode.firstChild.nodeValue == None):
+							badKeywordElement = True
+							continue
+						newKeyword = CCustomRuleKeyword()
+						newKeyword.iContent = keywordNode.firstChild.nodeValue
+
+						# read keyword type
+						if not keywordNode.hasAttribute("type"):
+							badKeywordElement = True
+							continue
+						type = keywordNode.getAttribute("type").lower()
+						if type in KCustomRuleKeywordMap.values():
+							if type == KKeywordComment:
+								ignoreComments = False
+						else:
+							type = KCustomRuleKeywordMap[KKeywordUnknown]
+						newKeyword.iType = type
+						keywordList.append(newKeyword)
+					if (len(keywordList) == 0) or (badKeywordElement == True):
+						self.ReportBadCustomRuleElement(ruleName, "keyword")
+						continue
+
+					# read the file types associated with the rule
+					fileTypeList = []
+					badFileTypeElement = False
+					for fileTypeNode in customRuleNode.getElementsByTagName("filetype"):
+						if (fileTypeNode == None) or (fileTypeNode.firstChild == None) or (fileTypeNode.firstChild.nodeValue == None):
+							badFileTypeElement = True
+							continue
+						newFileType = fileTypeNode.firstChild.nodeValue
+						fileTypeList.append(newFileType.lower())
+					if (len(fileTypeList) == 0) or (badFileTypeElement == True):
+						self.ReportBadCustomRuleElement(ruleName, "file type")
+						continue
+
+					# read the severity level of the rule
+					severity = KSeverityLow
+					for severityNode in customRuleNode.getElementsByTagName("severity"):
+						if (severityNode == None) or (severityNode.firstChild == None) or (severityNode.firstChild.nodeValue == None):
+							self.ReportBadCustomRuleElement(ruleName, "severity")
+							continue
+						severityValue = severityNode.firstChild.nodeValue
+						for severityKey in KSeverityConfigMap.keys():
+							if severityValue == KSeverityConfigMap[severityKey]:
+								severity = severityKey
+
+					# read the tile of the rule
+					title = ""
+					for titleNode in customRuleNode.getElementsByTagName("title"):
+						if (titleNode == None) or (titleNode.firstChild == None) or (titleNode.firstChild.nodeValue == None):
+							continue
+						title = titleNode.firstChild.nodeValue
+					if len(title) == 0:
+						self.ReportBadCustomRuleElement(ruleName, "title")
+						continue
+
+					# read the description of the rule
+					description = ""
+					for descriptionNode in customRuleNode.getElementsByTagName("description"):
+						if (descriptionNode == None) or (descriptionNode.firstChild == None) or (descriptionNode.firstChild.nodeValue == None):
+							continue
+						description = descriptionNode.firstChild.nodeValue
+					if len(description) == 0:
+						self.ReportBadCustomRuleElement(ruleName, "description")
+						continue
+
+					# read the optional link of the rule
+					link = None
+					for linkNode in customRuleNode.getElementsByTagName("link"):
+						if (linkNode == None) or (linkNode.firstChild == None) or (linkNode.firstChild.nodeValue == None):
+							self.ReportBadCustomRuleElement(ruleName, "link")
+							continue
+						link = linkNode.firstChild.nodeValue
+
+					# create the RE string for the custom rule
+					keywordMap = self.ConstructCustomRuleKeywordMap(keywordList)
+					reString = self.ConstructCustomRuleREString(keywordMap)
+					if len(reString) == 0:
+						continue
+					
+					# create a script based on the custom rule
+					aScript = CCustomScript(ruleName)
+					aScript.iReString = reString
+					aScript.iReMatch = re.compile(reString)
+					aScript.iFileExts = fileTypeList
+					aScript.iCategory = KCategoryOther
+					if keywordMap.has_key(KKeywordBaseClass):
+						aScript.iBaseClass = keywordMap[KKeywordBaseClass]
+						aScript.iCompare = aScript.DefaultInheritanceCompare
+					if ignoreComments:
+						aScript.iIgnore = KIgnoreComments
+					else:
+						aScript.iIgnore = KIgnoreQuotes
+					aScript.iSeverity = severity
+					aScript.iTitle = title
+					aScript.iIdeTitle = title
+					aScript.iDescription = description
+					if link <> None:
+						aScript.iLink = link
+					self.AddCustomScript(aScript)
+		return
+
+	def ReportBadCustomRuleElement(self, name, element):
+		self.ReportError("<customrule> element '" + name + "' has bad <" + element + "> child element in configuration file: " + self.iConfigFilename)
+
+	def ConstructCustomRuleKeywordMap(self, keywordList):
+		reString = ""
+		keywordMap = {}
+		for keyword in keywordList:
+			if keywordMap.has_key(keyword.iType):
+				keywordMap[keyword.iType] = keywordMap[keyword.iType] + "|" + keyword.iContent
+			else:
+				keywordMap[keyword.iType] = keyword.iContent
+		return keywordMap
+
+	def ConstructCustomRuleREString(self, keywordMap):
+		# generate RE string based on the keyword types
+		if keywordMap.has_key(KKeywordBaseClass):
+			reString = "^\s*class\s+(\w+::)?(\w+)\s*:(.*)"
+		elif keywordMap.has_key(KKeywordCall):
+			reString = "(" + keywordMap[KKeywordCall] + ")\s*\(.*\)\s*;"
+		elif keywordMap.has_key(KKeywordClassName):
+			if keywordMap.has_key(KKeywordMethod):
+				reString = "([A-Za-z0-9]+\s+" + keywordMap[KKeywordClassName] + "::)?(" + keywordMap[KKeywordMethod] + ")\s*\(.*\)\s*[^;]"
+			else:
+				reString = "^\s*class\s+(\w+::)?(" + keywordMap[KKeywordClassName] + ")"
+		elif keywordMap.has_key(KKeywordComment):
+			reString = "/(/|\*).*(" + keywordMap[KKeywordComment] + ")"
+		elif keywordMap.has_key(KKeywordGeneric):
+			reString = "(" + keywordMap[KKeywordGeneric] + ")"
+		elif keywordMap.has_key(KKeywordLocal):
+			reString = "^\s*[A-Z]\w*\s*[\*&\s]\s*(" + keywordMap[KKeywordLocal] + ")\w*\s*[;\(=]"
+		elif keywordMap.has_key(KKeywordMacro):
+			reString = "^\s*\#define\s+(" + keywordMap[KKeywordMacro] + ")"
+		elif keywordMap.has_key(KKeywordMember):
+			reString = "^\s*[A-Z]\w*\s*[\*&\s]\s*(" + keywordMap[KKeywordMember] + ")\w*\s*[;\(=]"
+		elif keywordMap.has_key(KKeywordMethod):
+			reString = "[A-Za-z0-9]+\s+[C|T|R][A-Za-z0-9]+::(" + keywordMap[KKeywordMethod] + ")\s*\(.*\)\s*[^;]"
+		elif keywordMap.has_key(KKeywordParameter):
+			reString = "({)*\s*(" + keywordMap[KKeywordParameter] + ")\s*=\s*(.*);"
+		return reString
+
+
+class CCustomRuleKeyword:
+	# #######################################################
+	# CCustomRuleKeyword - keyword associated with custom rules
+
+	def __init__(self):
+		iContent = ""
+		iType = "unknown"
+
+
+# #######################################################
+
+class CEncodedFile:
+    def Extract(self, aBaseDirectory):
+        outputFileHandle = open(os.path.join(aBaseDirectory, self.iFilename), 'wb')
+        outputFileBinary = zlib.decompress(base64.decodestring(self.iFileBody))
+        outputFileHandle.write(outputFileBinary)
+        outputFileHandle.close()
+
+	iFilename = ""
+	iFileBody = ""
+
+# #######################################################
+
+
+class CEncodedFileList:
+	def AddEncodedFile(self, aEncodedFile):
+		self.iEncodedFileList[aEncodedFile.iFilename.lower()] = aEncodedFile
+
+	def ExtractEncodedFile(self, aFilename, aBaseDirectory):
+		# look for the filename in our list of files
+		filename = aFilename.lower()
+		if (self.iEncodedFileList.has_key(filename)):
+			self.iEncodedFileList[filename].Extract(aBaseDirectory)
+		else:
+			scanner.iLog.Write("Missing "+filename)
+
+	def ExtractAllEncodedFiles(self, aBaseDirectory):
+		# run through associative array and extract everything
+		for filename in self.iEncodedFileList.keys():
+			self.ExtractEncodedFile(filename, aBaseDirectory)
+
+	# declare iEncodedFileList is an associative array
+	iEncodedFileList = {}
+
+
+# #######################################################
+# main()
+scanner = CCodeScanner()
+
+# process command line arguments
+opts, args = getopt.getopt(sys.argv[1:], "hvc:i:l:o:x:r:t:", ["help", "verbose", "config=", "input=", "logfile=", "outputformat=", "lxr=", "lxrversion=", "timestampedoutput="])
+for o, a in opts:
+	if o in ("-h", "--help"):
+		Usage(0)
+	if o in ("-v", "--verbose"):
+		scanner.iVerbose = True
+	if o in ("-c", "--config"):
+		scanner.iConfigFilename = a
+	if o in ("-i", "--input"):
+		scanner.iInputFilenames += a + "::"
+	if o in ("-l", "--logfile"):
+		scanner.iLogFilename = a
+	if o in ("-o", "--outputformat"):
+		scanner.iOutputFormat += a			
+	if o in ("-x", "--lxr"):
+		scanner.iLxrUrl = a
+	if o in ("-r", "--lxrversion"):
+		scanner.iLxrVersion = a
+	if o in ("-t", "--timestampedoutput"):
+		scanner.iTimeStampedOutput = a
+
+if len(args) < 1:
+	Usage(1)
+
+scanner.iLog = CLogger(scanner.iLogFilename)
+scanner.iLog.Write("Command line: " + str(sys.argv[1:]))
+scanner.iLog.Write("Current working directory: " + os.getcwd())
+
+scanner.ReadConfigFile()
+scanner.ReadArgumentsFromConfigFile()
+scanner.ReadCustomRulesFromConfigFile()
+
+scanner.iSource = args[0]
+scanner.iEncodedFileList = CEncodedFileList()
+scanner.iStartTimeObj = datetime.datetime.now()
+scanner.iStartTime = scanner.iStartTimeObj.ctime()
+scanner.iOutputDirectory = scanner.iStartTimeObj.strftime("%a-%b-%d-%H-%M-%S-%Y")
+
+# invoke the pysco module to improve performance
+psyco.full()
+
+# choose renderer based on command line arguments
+if len(args) > 1:
+	if ("off" in scanner.iTimeStampedOutput.lower()):
+		scanner.iOutputDirectory = args[1]
+	else:
+		scanner.iOutputDirectory = os.path.normpath(os.path.join(args[1], scanner.iOutputDirectory))
+	scanner.CleanOutputDirectory()
+	if scanner.iOutputFormat <> "":
+	#user specified output format
+		if ("xml" in scanner.iOutputFormat.lower()):
+			CXmlRenderer(scanner.iRendererManager, scanner.iOutputDirectory)
+		if ("html" in scanner.iOutputFormat.lower()):
+			CHtmlRenderer(scanner.iRendererManager, scanner.iOutputDirectory, scanner.iLxrUrl, scanner.iLxrVersion)
+		if ("std" in scanner.iOutputFormat.lower()):
+			CStdOutRenderer(scanner.iRendererManager)
+	else:
+	#default output format
+		CHtmlRenderer(scanner.iRendererManager, scanner.iOutputDirectory, scanner.iLxrUrl, scanner.iLxrVersion)
+else:
+	CStdOutRenderer(scanner.iRendererManager)
+
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# accessArrayElementWithoutCheck.py
+#
+# Checks : Array element accessed by At() function without checking 
+# index is within array range.
+#
+# Reason : Whenever an element in an array is accessed, the index 
+# should be checked to ensure that it is less than array.Count(). 
+# CodeScanner checks for explicit calls to a Count() function; so 
+# if the array index is checked in a different way, it gives 
+# false positives. Accessing an invalid index can cause a panic.
+#
+# #################################################################
+
+script = CScript("accessArrayElementWithoutCheck")
+script.iReString = r"""
+	(->|\.)		# pointer/instance of array
+	\s*			# optional whitespace
+	At
+	\s*			# optional whitespace
+	\(			# opening bracket
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+accessArrayCountFn = re.compile("""
+	(\.|->)
+	\s*
+	Count
+	\s*
+	\(
+	\s*
+	\)
+	""", re.VERBOSE)
+
+accessArrayDeclaration = re.compile("""
+	\w+			# array type
+	[0-9<>*& ]*	# optional array element
+	\w+			# array name
+	\s*
+	\[
+	.*			# array size
+	\]
+	\s*
+	;
+	""", re.VERBOSE)
+
+def isTimerObject(lines, currentline, varname):
+	if (varname.lower().find("array") <> -1) or (varname.lower().find("list") <> -1):
+		return False
+	if (varname.lower().find("heartbeat") <> -1):
+		return True
+	if (varname.lower().find("periodic") <> -1):
+		return True
+	if (varname.lower().find("timer") <> -1):
+		return True
+
+	vartype = GetLocalVariableType(lines, currentline, varname)
+	if (len(vartype) > 0):
+		if (vartype.lower().find("array") <> -1) or (vartype.lower().find("list") <> -1):
+			return False
+		if (vartype.lower().find("heartbeat") <> -1):
+			return True
+		if (vartype.lower().find("periodic") <> -1):
+			return True
+		if (vartype.lower().find("timer") <> -1):
+			return True
+
+	return False
+
+def arrayAccessCompare(lines, currentline, rematch, filename):
+	line = lines[currentline]
+	m = rematch.search(line)
+
+	if m:
+		if (line.count("At") == 1):
+			openBracketPos = line.find("At")
+		else:
+			openBracketPos = line.find("At(")
+		cutLine = line[openBracketPos+1:]
+		closeBracketPos = cutLine.find(")") + len(line) - len(cutLine)
+		if (closeBracketPos > openBracketPos) and (openBracketPos >= 0):
+			variable = line[openBracketPos+3:closeBracketPos]
+			variable = TrimVariableName(variable)
+
+			if (len(variable) == 0):
+				return 0
+
+			# if a constant index assume it's going to be ok!
+			if (variable[0] == "E") or (variable[0] == "K"):
+				return 0
+
+			variableIsNumeric = 1
+			varPos = 0
+			while (varPos < len(variable)):
+				if (variable[varPos] < '0') or (variable[varPos] > '9'):
+					variableIsNumeric = 0
+					break
+				varPos = varPos + 1
+
+			linePos = openBracketPos - 1
+			while (linePos > 0) and (isNonAlpha(line[linePos])):
+				linePos = linePos - 1
+			arrayNameEnd = linePos + 1
+			while (linePos >= 0) and (isNonAlpha(line[linePos]) == 0):
+				linePos = linePos - 1
+			arrayNameStart = linePos + 1
+		
+			arrayName = ""
+			if (arrayNameStart >= 0):
+				arrayName = line[arrayNameStart:arrayNameEnd]
+				arrayName = TrimVariableName(arrayName)
+
+				if (len(arrayName) > 0):
+					# if a constant array assume it's going to be ok!
+					if (arrayName[0] == "E") or (arrayName[0] == "K"):
+						return 0
+
+					# ignore any heartbeat/periodic/timer object that is not an array or list
+					if isTimerObject(lines, currentline, arrayName):
+						return 0
+
+			if (variableIsNumeric):
+				if (len(arrayName) > 2):
+					if (arrayName[0] == "i") and (arrayName[1] >= 'A') and (arrayName[1] <= 'Z'):
+						return 0 
+
+			i = currentline
+
+			while (i >= 0) and (i >= scanner.iCurrentMethodStart):
+				line = lines[i]
+
+				# check to see if index is compared to array size
+				if (len(arrayName) > 0):
+					arrayNamePos = line.find(arrayName)
+					if (arrayNamePos >= 0):
+						cutLine = line[arrayNamePos + len(arrayName):]
+						if (accessArrayCountFn.search(cutLine)):
+							return 0
+
+					if (variableIsNumeric == 1):
+						if (accessArrayDeclaration.search(line)):
+							openBracketPos = line.find("[")
+							cutLine = line[openBracketPos:]
+							closeBracketPos = cutLine.find("]") + len(line) - len(cutLine)
+							if (closeBracketPos > openBracketPos) and (openBracketPos >= 0):
+								declVariable = line[openBracketPos:closeBracketPos]
+								declVariable = TrimVariableName(declVariable)
+								if (len(declVariable) > 0):
+									# if a constant index assume it's going to be ok!
+									if (declVariable[0] == "E") or (declVariable[0] == "K"):
+										return 0
+
+								declVariableIsNumeric = 1
+								varPos = 0
+								while (varPos < len(declVariable)):
+									if (declVariable[varPos] < '0') or (declVariable[varPos] > '9'):
+										declVariableIsNumeric = 0
+										break
+									varPos = varPos + 1
+								if (declVariableIsNumeric == 1):
+									if (int(variable) < int(declVariable)):
+										return 0
+
+				i = i - 1
+			return 1
+
+	return 0
+
+script.iCompare	= arrayAccessCompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# accessArrayElementWithoutCheck2.py
+#
+# Checks : Array element accessed by [] without checking range.
+#
+# Reason : Whenever an element in an array is accessed, the index 
+# should first be checked to ensure that it is within range. 
+# CodeScanner checks for explicit calls to a Count() or Length() 
+# function; so if the array index is checked in a different way, 
+# it gives false positives. Accessing an invalid index can cause 
+# a panic.
+#
+# #################################################################
+
+script = CScript("accessArrayElementWithoutCheck2")
+script.iReString = r"""
+	\w+
+	\s*		# optional whitespace
+	\)*		# optional closing bracket
+	\s*		# optional whitespace
+	\[
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+accessArrayCountFn = re.compile("""
+	(\.|->)
+	\s*
+	Count
+	\s*
+	\(
+	\s*
+	\)
+	""", re.VERBOSE)
+
+accessArrayLengthFn = re.compile("""
+	(\.|->)
+	\s*
+	Length
+	\s*
+	\(
+	\s*
+	\)
+	""", re.VERBOSE)
+
+accessArrayDeclareNew = re.compile("""
+	\s*
+	=
+	\s*
+	new
+	\s*
+	""", re.VERBOSE)
+
+bufferArrayDeclaration = re.compile("""
+	\w+		# array type
+	\s*
+	<
+	\s*
+	[0-9]+
+	\s*
+	>
+	\s*
+	\w+		# array name
+	\s*
+	;
+	""", re.VERBOSE)
+
+accessArrayDeclaration = re.compile("""
+	\w+		# array type
+	\s*
+	(\*|&)*
+	\s*
+	\[
+	.*		# array size
+	\]
+	\s*
+	;
+	""", re.VERBOSE)
+
+constArrayDeclaration = re.compile("""
+	\w+		# array type
+	[0-9<>*& ]*	# optional array element
+	\s+
+	\w+		# array name
+	\s*
+	\[
+	.*		# array size
+	\]
+	\s*
+	=
+	[^=]
+	""", re.VERBOSE)
+
+def arrayAccessCompare2(lines, currentline, rematch, filename):
+	line = lines[currentline]
+	m = rematch.search(line)
+
+	if m:
+		if (accessArrayDeclareNew.search(line)):
+			return 0
+
+		if (accessArrayDeclaration.search(line)):
+			return 0
+
+		if (constArrayDeclaration.search(line)):
+			return 0
+
+		openBracketPos = line.find("[")
+		cutLine = line[openBracketPos:]
+		closeBracketPos = cutLine.find("]") + len(line) - len(cutLine)
+		if (closeBracketPos > openBracketPos) and (openBracketPos >= 0):
+			variable = line[openBracketPos:closeBracketPos]
+			variable = TrimVariableName(variable)
+
+			if (len(variable) == 0):
+				return 0
+
+			# if a constant index assume it's going to be ok!
+			if (variable[0] == "E") or (variable[0] == "K"):
+				return 0
+
+			variableIsNumeric = 1
+			varPos = 0
+			while (varPos < len(variable)):
+				if (variable[varPos] < '0') or (variable[varPos] > '9'):
+					variableIsNumeric = 0
+					break
+				varPos = varPos + 1
+
+			linePos = openBracketPos
+			while (linePos > 0) and (isNonAlpha(line[linePos])):
+				linePos = linePos - 1
+			arrayNameEnd = linePos + 1
+			while (linePos >= 0) and (isNonAlpha(line[linePos]) == 0):
+				linePos = linePos - 1
+			arrayNameStart = linePos + 1
+		
+			arrayName = ""
+			if (arrayNameStart >= 0):
+				arrayName = line[arrayNameStart:arrayNameEnd]
+				arrayName = TrimVariableName(arrayName)
+
+				if (len(arrayName) > 0):
+					# if a constant array assume it's going to be ok!
+					if (arrayName[0] == "E") or (arrayName[0] == "K"):
+						return 0
+
+			if (variableIsNumeric):
+				if (len(arrayName) > 2):
+					if (arrayName[0] == "i") and (arrayName[1] >= 'A') and (arrayName[1] <= 'Z'):
+						return 0 
+
+			i = currentline
+
+			while (i >= 0) and (i >= scanner.iCurrentMethodStart):
+				line = lines[i]
+				
+				# check to see if index is compared to array size
+				if (len(arrayName) > 0):
+					arrayNamePos = line.find(arrayName)
+					if (arrayNamePos >= 0):
+						cutLine = line[arrayNamePos + len(arrayName):]
+						if (accessArrayCountFn.search(cutLine)):
+							return 0
+						if (accessArrayLengthFn.search(cutLine)):
+							return 0
+
+					if (variableIsNumeric == 1):
+						doCheck = 0
+						if (accessArrayDeclaration.search(line)):
+							openBracketPos = line.find("[")
+							cutLine = line[openBracketPos:]
+							closeBracketPos = cutLine.find("]") + len(line) - len(cutLine)
+							if (closeBracketPos > openBracketPos) and (openBracketPos >= 0):
+								declVariable = line[openBracketPos:closeBracketPos]
+								declVariable = TrimVariableName(declVariable)
+								if (len(declVariable) > 0):
+									doCheck = 1
+
+						if (bufferArrayDeclaration.search(line)):
+							openBracketPos = line.find("<")
+							cutLine = line[openBracketPos:]
+							closeBracketPos = cutLine.find(">") + len(line) - len(cutLine)
+							if (closeBracketPos > openBracketPos) and (openBracketPos >= 0):
+								declVariable = line[openBracketPos:closeBracketPos]
+								declVariable = TrimVariableName(declVariable)
+								if (len(declVariable) > 0):
+									doCheck = 1
+
+						if (doCheck == 1):
+							# if a constant index assume it's going to be ok!
+							if (declVariable[0] == "E") or (declVariable[0] == "K"):
+								return 0
+
+							declVariableIsNumeric = 1
+							varPos = 0
+							while (varPos < len(declVariable)):
+								if (declVariable[varPos] < '0') or (declVariable[varPos] > '9'):
+									declVariableIsNumeric = 0
+									break
+								varPos = varPos + 1
+							if (declVariableIsNumeric == 1):
+								if (int(variable) < int(declVariable)):
+									return 0
+
+				i = i - 1
+			return 1
+
+	return 0
+
+script.iCompare	= arrayAccessCompare2
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# activestart.py
+#
+# Checks : Using CActiveScheduler::Start.
+#
+# Reason : Using CActiveScheduler::Start() can mean that something 
+# asynchronous is being made synchronous. Instead, use active 
+# objects correctly in an asynchronous way.
+#
+# #################################################################
+
+script = CScript("activestart")
+script.iReString = "CActiveScheduler::Start"
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# activestop.py
+#
+# Checks : Using CActiveScheduler::Stop.
+#
+# Reason : Using CActiveScheduler::Stop() can mean that something 
+# asynchronous is being made synchronous. Instead, use active 
+# objects correctly in an asynchronous way.
+#
+# #################################################################
+
+script = CScript("activestop")
+script.iReString = "CActiveScheduler::Stop"
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# arraypassing.py
+#
+# Checks : Passing arrays by value rather than reference.
+#
+# Reason : Passing arrays by value causes the array to be copied 
+# needlessly, which takes up time and memory. For efficiency, 
+# references should be used.
+#
+# #################################################################
+
+script = CScript("arraypassing")
+script.iReString = r"""
+    (\(|,)?         # open bracket or preceeding comma
+    \s*             # whitespace
+	(R|C)\w*Array	# skip to a parameter type containing "R...Array..." or "C...Array..."
+    \s*				# whitespace
+	(<.*>)?			# optional class in angle brackets
+	\s+				# whitespace
+	(\w+)			# parameter name
+    (=|\w|\s)*      # optional parameter initialization or whitespace
+    (\)|,)			# close bracket or trailing comma
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryPerformance
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+script.iCompare = DefaultFuncParamCompare
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# arrayptrcleanup.py
+#
+# Checks : Using local CArrayPtr classes without cleanup items.
+#
+# Reason : It is not enough to push a local CArrayPtr class onto 
+# the cleanup stack. A TCleanupItem and callback function must be 
+# used to avoid leaking the elements.
+#
+# #################################################################
+
+script = CScript("arrayptrcleanup")
+script.iReString = r"""
+	\s+
+	(
+	\w+
+	)
+	\s*
+	=
+	\s*
+	new
+	\s*
+	\(
+	\s*
+	ELeave
+	\s*
+	\)
+	\s*
+	CArrayPtr
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+def arrayptrcleanupcompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		varName = m.group(1)
+		if (len(varName) == 1) or (varName[0] not in "ai") or varName[1].islower():
+			for i in range(currentline, currentline + 10):
+				if i >= len(lines):
+					break
+				elif (lines[i].find("TCleanupItem") <> -1) and (lines[i].find(varName) <> -1):
+					return 0
+			return 1
+	return 0
+
+script.iCompare = arrayptrcleanupcompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# assertdebuginvariant.py
+#
+# Checks : __ASSERT_DEBUG with User::Invariant.
+#
+# Reason : Replace __ASSERT_DEBUG(<condition>, User::Invariant()) 
+# with ASSERT(<condition>), because it is easier to read.
+#
+# #################################################################
+
+script = CScript("assertdebuginvariant")
+	
+script.iReString = "__ASSERT_DEBUG\s*\(\w*\s*,\s*User::Invariant\s*\(\s*\)\s*\)\s*;"
+script.iFileExts = ["h", "cpp", ".inl", "c"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# baddefines.py
+#
+# Checks : Lowercase definition names.
+#
+# Reason : Badly-named definitions makes the code harder to 
+# maintain and can lead to defects.
+#
+# #################################################################
+
+script = CScript("baddefines")
+script.iReString = r"""
+	\#define
+	\s+					# at least one whitespace char
+	[A-Z0-9_]*[a-z]+	# find a lower case character
+	"""
+script.iFileExts = ["h", "cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# baseconstruct.py
+#
+# Checks : Leaving function called before BaseConstructL().
+#
+# Reason : If a leave occurs before BaseConstructL() is called, 
+# the system can panic because it is trying to clean up an 
+# application that has not been fully initialised.
+#
+# #################################################################
+
+script = CScript("baseconstruct")
+script.iReString = r"""
+	^
+	\s*
+	BaseConstructL
+	\s*
+	\(
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+def baseconstructcompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		if scanner.iCurrentMethodStart >= 0:
+			for i in range(scanner.iCurrentMethodStart, currentline):
+				line = lines[i]
+				n = KReLeavingLine.search(line)
+				if n:
+					return 1
+	return 0
+
+script.iCompare = baseconstructcompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# callActiveObjectWithoutCheckingOrStopping.py
+#
+# Checks : Active object called without checking whether it is 
+# active or canceling it first.
+#
+# Reason : If an active object is started twice, a panic occurs. 
+# CodeScanner picks out places where there is a call to a Start(), 
+# Queue(), or After() function on a member variable, without a 
+# previous call to IsActive(), Cancel(), or Stop(). In general, 
+# if starting a timer, there should at least be a call to IsActive() 
+# to ensure that the timer is not already running.
+#
+# #################################################################
+
+script = CScript("callActiveObjectWithoutCheckingOrStopping")
+script.iReString = r"""\("""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+activeObjectIsActive = re.compile("""
+	(\.|->)
+	\s*
+	IsActive
+	\s*
+	\(
+	\s*
+	\)
+	""", re.VERBOSE)
+
+activeObjectCancel = re.compile("""
+	(\.|->)
+	\s*
+	Cancel
+	\s*
+	\(
+	\s*
+	\)
+	""", re.VERBOSE)
+
+activeObjectStop = re.compile("""
+	(\.|->)
+	\s*
+	Stop
+	\s*
+	\(
+	\s*
+	\)
+	""", re.VERBOSE)
+
+activeObjectCreate = re.compile("""
+	=
+	\s*
+	\w+
+	::
+	New
+	\w*
+	\s*
+	\(
+	""", re.VERBOSE)
+
+activeObjectCreate2 = re.compile("""
+	=
+	\s*
+	new
+	\s*
+	\(
+	\s*
+	ELeave
+	\s*
+	\)
+	""", re.VERBOSE)
+
+activeObjectStart = re.compile("""
+	(\.|->)
+	\s*
+	Start
+	\s*
+	\(
+	""", re.VERBOSE)
+
+activeObjectQueue = re.compile("""
+	(\.|->)
+	\s*
+	Queue
+	\s*
+	\(
+	""", re.VERBOSE)
+
+activeObjectAfter = re.compile("""
+	(\.|->)
+	\s*
+	After
+	\s*
+	\(
+	""", re.VERBOSE)
+
+# RTimer::After() takes 2 arguments
+rtimerObjectAfter = re.compile("""
+	(\.|->)
+	\s*
+	After
+	\s*
+	\(
+	\s*
+	\w+			# first argument
+	\s*
+	,
+	""", re.VERBOSE)
+
+# Non-active types with After(), Queue() or Start() function
+KNonActiveTypes = {
+	"KAnimation"					: "Animation",
+	"KAnimator"						: "Animator",
+	"KClockSourcePeriodicUtility"	: "ClockSourcePeriodicUtility",
+	"KCodecWrapper"					: "CodecWrapper",
+	"KCommTimer"					: "CommTimer",
+	"KEmbeddedStore"				: "EmbeddedStore",
+	"KFormulaTextLexer"				: "FormulaTextLexer",
+	"KObexServer"					: "ObexServer",
+	"KSpriteAnimation"				: "SpriteAnimation",
+	"KRConnection"					: "RConnection",
+	"KRSubConnection"				: "RSubConnection",
+	"KRTest"						: "RTest",
+	"KRTimer"						: "RTimer",
+	"KValidityPeriod"				: "ValidityPeriod",
+	"KVideoPlayHwDevice"			: "VideoPlayHwDevice",
+	"KVideoRecordHwDevice"			: "VideoRecordHwDevice",
+}
+
+def isNonActiveObject(variable):
+	for name, value in KNonActiveTypes.items():
+		if (variable.lower().find(value.lower()) <> -1):
+			return True
+	return False
+
+def activeObjectCompare(lines, currentline, rematch, filename):
+	line = lines[currentline]
+	m = rematch.search(line)
+
+	if m:
+		if (scanner.iCurrentMethodName == "Start"):
+			return 0
+		if (scanner.iCurrentMethodName == "Queue"):
+			return 0
+		if (scanner.iCurrentMethodName == "After"):
+			return 0
+
+		checkForIsActive = 0	
+		if (activeObjectStart.search(line)):
+			checkForIsActive = 1
+		if (activeObjectQueue.search(line)):
+			checkForIsActive = 1
+		if (activeObjectAfter.search(line)):
+			# make sure we are not dealing with RTimer::After()
+			if (not rtimerObjectAfter.search(line)):
+				checkForIsActive = 1
+		if (checkForIsActive == 1):
+			varEnd = line.find("->")
+			if (varEnd < 0):
+				varEnd = line.find(".")
+			if (varEnd < 0):
+				return 0
+			
+			variable = TrimVariableName(line[:varEnd])
+			if (len(variable) == 0):
+				return 0
+
+			# if a local variable then unlikely to have been started already
+			if (len(variable) > 2):
+				if (variable[0] != 'i'):
+					return 0
+				else:
+					if (variable[1] < 'A') or (variable[1] > 'Z'):
+						return 0
+
+			# ignore non-active object
+			if isNonActiveObject(variable):
+				return 0
+
+			i = currentline
+			while (i > scanner.iCurrentMethodStart):
+				line = lines[i]
+				varPos = line.find(variable)
+				if (varPos >= 0):
+					cutLine = line[varPos:]
+					if (activeObjectIsActive.search(cutLine)):
+						return 0
+					if (activeObjectCancel.search(cutLine)):
+						return 0
+					if (activeObjectStop.search(cutLine)):
+						return 0
+					if (activeObjectCreate.search(cutLine)):
+						return 0
+					if (activeObjectCreate2.search(cutLine)):
+						return 0
+				i = i - 1
+			return 1
+
+	return 0
+
+script.iCompare	= activeObjectCompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# changenotification.py
+#
+# Checks : Using RSAVarChangeNotify to see System Agent changes.
+#
+# Reason : When watching for System Agent changes, use RSystemAgent 
+# rather than RSAVarChangeNotify, which can fail.
+#
+# #################################################################
+
+script = CScript("changenotification")
+script.iReString = "RSAVarChangeNotify"
+script.iFileExts = ["cpp", "h", "inl", "hpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# cleanup.py
+#
+# Checks : CleanupStack::Pop(AndDestroy) parameters.
+#
+# Reason : These functions should be called with explicit variable 
+# parameters to avoid misalignment.
+#
+# #################################################################
+
+script = CScript("cleanup")
+script.iReString = r"""
+	CleanupStack::Pop(AndDestroy)?
+	\s*
+	\(
+	\s*
+	([0-9]+\s*\)|\))
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# commentcode.py
+#
+# Checks : Commented-out code.
+#
+# Reason : Instances of code that are commented out make the code 
+# hard to maintain and to interpret clearly. The commented out code 
+# should be removed. Any requirement to rediscover old code 
+# should be made through source control and not by trawling through 
+# commented-out code.
+#
+# #################################################################
+
+script = CScript("commentcode")
+script.iReString = r"""
+	/(/|\*)			# "//" or "/*"
+	(.*);			# skip to semicolon
+	\s*				# optional whitespace
+	(//.*)?			# optional comment
+	$				# end of line
+	"""
+script.iFileExts = ["h","cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreQuotes
+script.iSeverity = KSeverityLow
+
+reDeclaration = re.compile("""
+	\s*
+	[A-Z][\w<>*&]+
+	\s+
+	\w+
+	\s*
+	""", re.VERBOSE)
+
+def commentcodecompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		if ((m.group(2)[-1:] == ")") or (m.group(2).find("=") <> -1)) or (reDeclaration.match(m.group(2))):
+			line = lines[currentline]
+			i = 0
+			inCommentBlock = 0
+
+			while i < len(line):
+				if not inCommentBlock:
+					if (line[i] == "/"):
+						if (line[i + 1] == "/"):
+							return 1
+						elif (line[i + 1] == "*"):
+							inCommentBlock = 1
+							i += 2
+							continue
+				else:
+					endIndex = line[i:].find("*/")
+					if (endIndex <> -1):
+						inCommentBlock = 0
+						if line[i:i + endIndex + 2].find(";") <> -1:
+							return 1
+						i += endIndex + 2
+						continue
+					else:
+						return 1
+				
+				i += 1
+		
+	return 0
+
+script.iCompare = commentcodecompare
+scanner.AddScript(script)
+
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# CommonFunctions.py
+#
+# Some commonly used functions.
+#
+# #################################################################
+
+KReStringLeavingLine = "(\w*[a-z]\w*L(C*|D|P))\s*\(|ELeave|User::Leave|tream\s+<<|tream\s+>>"
+
+KReLeavingLine = re.compile(KReStringLeavingLine, re.VERBOSE)
+
+def isNonAlpha(char):
+	if (char >= 'A'):
+		if (char <= 'Z'):
+			return 0
+	if (char >= 'a'):
+		if (char <= 'z'):
+			return 0
+	if (char >= '0'):
+		if (char <= '9'):
+			return 0
+	return 1
+
+def TrimVariableName(var):
+	while (len(var) > 0) and (isNonAlpha(var[0])):
+		var = var[1:len(var)]
+	while (len(var) > 0) and (isNonAlpha(var[len(var)-1])):
+		var = var[0:len(var)-1]
+
+	if (len(var) > 0):
+		spaceIndex = var.find(" ")
+		if (spaceIndex <> -1):
+			cutVar = var[spaceIndex:]
+			return TrimVariableName(cutVar)
+	return var
+
+def GetBracketDepth(lines, currentline):
+	i = scanner.iCurrentMethodStart
+	bracketdepth = 0
+	while (i < currentline):
+		thisline = lines[i]
+		commentBegin = thisline.find("//")
+		if (commentBegin != -1):
+			thisline = thisline[:commentBegin]
+		bracketdepth += thisline.count("{")
+		bracketdepth -= thisline.count("}")
+		i = i + 1
+
+	return bracketdepth	
+
+varDeclaration = re.compile("""
+	\s*					# whitespace
+	([A-Z]\w*)			# variable type
+	\s*             	# whitespace
+	(<.*>)?				# optional class in angle brackets
+	\s*[\*&\s]\s*		# optional "*" or "&" plus at least one whitespace char
+	(\w+)				# variable name
+	\s*             	# whitespace
+	[;\(=]				# ";" or "(" or "="
+	""", re.VERBOSE)
+
+def GetLocalVariableType(lines, currentline, varname):
+	# skip non-local object
+	if (len(varname) > 2):
+		if (varname[0] == 'i'):
+			return ""
+
+	# lookup type of local variable or function parameter
+	if (scanner.iCurrentMethodStart <> -1):
+		i = scanner.iCurrentMethodStart
+		while (i < currentline):
+			line = lines[i]
+			if (line.find(varname) <> -1):
+				# look up variable declaration
+				m = varDeclaration.search(line)
+				if m:
+					# return variable type
+					return m.group(1)
+			i = i + 1
+	return ""
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# connect.py
+#
+# Checks : Ignoring Connect() return value.
+#
+# Reason : Ignoring the error returned from Connect() functions 
+# means that if the Connect() function fails due to OOM or 
+# other problems, the next access to the resource will panic.
+#
+# #################################################################
+
+script = CScript("connect")
+script.iReString = r"""
+	^\s*				# start of line plus optional whitespace
+	\w+					# variable name
+	(\.|->)				# "." or "->"
+	Connect\s*\(\s*\)
+	\s*;
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCanPanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+scanner.AddScript(script)
+
+
+
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# ConnectAndDontCloseMemberVariable.py
+#
+# Checks : Calling Connect() or Open() on a member variable without 
+# calling Close() in the destructor.
+#
+# Reason : If Connect() or Open() is called on any member variable, 
+# then Close() must be called in the destructor.
+#
+# #################################################################
+
+script = CScript("ConnectAndDontCloseMemberVariable")
+script.iReString = r"""
+	^\s*				# start of line plus optional whitespace
+	i[A-Z]\w+			# member variable name
+	(\.|->)				# "." or "->"
+	(Connect|Open)
+	\s*\(\s*\)
+	\s*;
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryWrongFunctionality
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+ConnectAndDontCloseLeavingFunction = re.compile("""
+	[A-Za-z0-9]+
+	L
+	(C|D|P)*
+	\s*
+	\(
+	""", re.VERBOSE)
+
+def ConnectNotCloseCompare(lines, currentline, rematch, filename):
+	line = lines[currentline]
+	m = rematch.search(line)
+
+	if m:
+		# get the variable name, between the '*' and the '='
+		startindex = line.find("i")
+		if (startindex == -1):
+			startindex = 0
+		endindex = line.find("Connect")
+		if (endindex == -1):
+			endindex = line.find("Open")
+		variable = line[startindex:endindex]
+		if (len(variable) < 1):
+			return 0
+		variable = TrimVariableName(variable)
+
+		# see if variable is closed within this function before a Leave
+		i = currentline
+		bracketdepth = GetBracketDepth(lines, i)
+		while (i < len(lines)) and (bracketdepth  > 0):
+			line = lines[i]
+			if (line.find(variable) >= 0):
+				if (line.find("Close") >= 0):
+					return 0
+
+			bracketdepth += line.count("{")
+			bracketdepth -= line.count("}")
+
+			if (line.find("User::Leave") >= 0):
+				bracketdepth = 0
+			if (line.find("ELeave") >= 0):
+				bracketdepth = 0
+			if (ConnectAndDontCloseLeavingFunction.search(line)):
+				bracketdepth = 0
+				
+			i = i + 1
+		
+		# look for destructor and see if variable is closed there
+		stringToFind = "~" + scanner.iCurrentClassName
+		i = 1
+		foundDestructor = 0
+		bracketdepth = 0
+		while (i < len(lines)):
+			thisLine = lines[i]
+			if (thisLine.find(stringToFind) >= 0) and (foundDestructor == 0):
+				while (i < len(lines)) and (foundDestructor == 0):
+					thisLine = lines[i]
+					if (thisLine.find('{') >= 0):
+						foundDestructor = 1
+					else:
+						i = i + 1
+
+			if (foundDestructor):
+				bracketdepth += thisLine.count("{")
+				bracketdepth -= thisLine.count("}")
+				if (bracketdepth == 0):
+					return 1
+				
+				if (thisLine.find(variable) >= 0):
+					if (thisLine.find("Close") >= 0):
+						return 0
+			i = i + 1
+
+		if (foundDestructor):
+			return 1
+	return 0
+
+script.iCompare	= ConnectNotCloseCompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# constnames.py
+#
+# Checks : Badly-named constants.
+#
+# Reason : Badly-named constant will make the source code harder to 
+# maintain and make defects more likely.
+#
+# #################################################################
+
+script = CScript("constnames")
+script.iReString = r"""
+	^
+	\s*
+	const
+	\s+
+	\w+		# type
+	\s*
+	[\*&]?	# reference or pointer
+	\s*
+	[^K\s]	# name initial letter
+	\w+		# name
+	\s*
+	=
+	[^()]*
+	;
+	"""
+script.iFileExts = ["h", "cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+def constnamescompare(lines, currentline, rematch, filename):
+	if (scanner.iCurrentMethodName == ""):
+		if rematch.search(lines[currentline]):
+			return 1
+
+	return 0
+
+script.iCompare = constnamescompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# consttdescptr.py
+#
+# Checks : Const descriptor pointer as argument.
+#
+# Reason : Use "const TDesC&" instead of "const TDesC*".
+#
+# #################################################################
+
+script = CScript("consttdescptr")
+script.iReString = r"""
+    (\(|,)?        # open bracket or preceeding comma
+    \s*            # whitespace
+	const
+    \s+            # whitespace
+	TDesC
+    \s*            # whitespace
+	\*
+    \s*            # whitespace
+    (=|\w|\s)*     # optional parameter name, parameter initialization or whitespace
+    (\)|,)         # close bracket or trailing comma
+	"""
+script.iFileExts = ["h"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# controlornull.py
+#
+# Checks : Accessing return value of ControlOrNull().
+#
+# Reason : The return value might be NULL, so it should be checked 
+# before access.
+#
+# #################################################################
+
+script = CScript("controlornull")
+script.iReString = "(\.|->)ControlOrNull\(.*\)->"
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCanPanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# crepository.py
+#
+# Checks : Ignoring CRepository::get() return value.
+#
+# Reason : Independent application cannot assume that the 
+# Central Repository is set up fully. This means the return value 
+# of CRepository::get() cannot be ignored.
+#
+# #################################################################
+
+script = CScript("crepository")
+script.iReString = r"""
+    ^\s*
+    (\w+)
+    (\.|->)
+    (G|g)et\s*\(
+    """
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryOther
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+reCRepositoryAssignStr = "=\s+$"
+reCRepositoryAssign = re.compile(reCRepositoryAssignStr, re.IGNORECASE)
+
+reCRepositoryConditionalStr = "(if|while)\s+\($"
+reCRepositoryConditional = re.compile(reCRepositoryConditionalStr, re.IGNORECASE)
+
+def crepositorycompare(lines, currentline, rematch, filename):
+    m = rematch.search(lines[currentline])
+    if m:
+        objectName = m.group(1)
+        objectType = GetLocalVariableType(lines, currentline, objectName)
+        if (objectType.find("CRepository") == -1):
+            return 0
+
+        # look for handler of CRepository::get() return value on a different line
+        i = currentline - 1
+        if (i > 0) and (i >= scanner.iCurrentMethodStart):
+            line = lines[i]
+            bracketCount = line.count("(") - line.count(")")
+            if (bracketCount > 0):
+                return 0
+            r1 = reCRepositoryAssign.search(line)
+            if r1:
+                return 0
+            r2 = reCRepositoryConditional.search(line)
+            if r2:
+                return 0
+        return 1
+    else:
+        return 0
+
+script.iCompare = crepositorycompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# ctltargettype.py
+#
+# Checks : Use of targettype ctl.
+#
+# Reason : The ctl target type should not be used. Instead, use DLL 
+# and explicitly refer to the Control Panel's DEF file. 
+# Note: Code that causes this issue only needs attention if it is 
+# found in code developed for Nokia Series 90 code that has extra 
+# exports for resetting the Control Panel item's data.
+#
+# #################################################################
+
+script = CScript("ctltargettype")
+script.iReString = r"""
+	^\s*
+	[Tt][Aa][Rr][Gg][Ee][Tt][Tt][Yy][Pp][Ee]
+	\s+
+	"""
+script.iFileExts = ["mmp"]
+script.iCategory = KCategoryWrongFunctionality
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+reTargetPath = re.compile("""
+	^\s*
+	[Tt][Aa][Rr][Gg][Ee][Tt][Pp][Aa][Tt][Hh]
+	\s+
+	""", re.VERBOSE)
+
+reDefFile = re.compile("""
+	^\s*
+	[Dd][Ee][Ff][Ff][Ii][Ll][Ee]
+	""", re.VERBOSE)
+	
+def ctltargettypecompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		if lines[currentline].upper().find("CTL") <> -1:
+			return 1
+
+		if lines[currentline].upper().find("DLL") <> -1:
+			foundDefFile = 0
+			foundSystemControls = 0
+
+			for line in lines:
+				if reTargetPath.search(line):
+					if line.upper().find("SYSTEM\\CONTROLS") <> -1:
+						foundSystemControls = 1
+
+				if reDefFile.search(line):
+					if line.upper().find("CTRL.DEF") <> -1:
+						foundDefFile = 1
+
+				if (foundSystemControls == 1) and (foundDefFile == 1):
+					break
+		
+			if (foundSystemControls == 1) and (foundDefFile <> 1):
+				return 1
+			
+	return 0
+
+script.iCompare	= ctltargettypecompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# customizableicons.py
+#
+# Checks : Use of customizable icons.
+#
+# Reason : Due to device customization requirements, independent 
+# application must not remove any customization done by the 
+# variant team. This means independent application cannot include 
+# customizable icons.
+#
+# #################################################################
+
+script = CScript("customizableicons")
+script.iReString = ""
+script.iFileExts = ["mk", "mmp"]
+script.iCategory = KCategoryOther
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+reCustomizableIconsStr = ""
+scriptNode = script.ScriptConfig()
+if (scriptNode <> None):
+    for wordNode in scriptNode.getElementsByTagName("iconsRE"):
+        reCustomizableIconsStr = wordNode.firstChild.nodeValue
+        print "Note: 'customizable icons' pattern configured as:  " + reCustomizableIconsStr
+        break
+if len(reCustomizableIconsStr) > 0:
+    reCustomizableIcons = re.compile(reCustomizableIconsStr, re.IGNORECASE)
+else:
+    reCustomizableIcons = None
+
+def customizableIconsCompare(lines, currentline, rematch, filename):
+    if reCustomizableIcons:
+        return reCustomizableIcons.search(lines[currentline])
+
+script.iCompare = customizableIconsCompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# debugrom.py
+#
+# Checks : Debug components in ROM.
+#
+# Reason : Debug versions of components in the ROM could mean that 
+# ROM space is being taken up with debugging information or that 
+# logging is being put out. Release versions should be in the ROM 
+# unless there is a good reason why they are not.
+#
+# #################################################################
+
+script = CScript("debugrom")
+script.iReString = "DEBUG_DIR|\\udeb\\\\"
+script.iFileExts = ["iby", "hby"]
+script.iCategory = KCategoryPerformance
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# declarename.py
+#
+# Checks : Use of __DECLARE_NAME.
+#
+# Reason : The __DECLARE_NAME macro is historical and serves 
+# no purpose anymore and should be removed.
+#
+# #################################################################
+
+script = CScript("declarename")
+script.iReString = r"""
+	^\s*				# start of line plus optional whitespace
+	__DECLARE_NAME
+	\s*					# optional whitespace
+	\(					# open bracket
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# deleteMemberVariable.py
+#
+# Checks : Member variable deleted incorrectly.
+#
+# Reason : When a member variable is deleted, it should be assigned 
+# either to NULL or to another value. This prevents accidental 
+# access of the deleted object. If a NewL() or other leaving 
+# function is called to reassign the member variable, it should 
+# first be assigned to NULL in case that function leaves.
+#
+# #################################################################
+
+script = CScript("deleteMemberVariable")
+script.iReString = r"""
+	delete		# delete command
+	\s*			# optional space
+	\(*			# optional open bracket
+	\s*			# optional space
+	i[A-Z]		# member variable name
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCanPanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+deleteMemberVariableLeavingFunction = re.compile("""
+	[A-Za-z0-9]+
+	L
+	(C|D)*
+	\s*
+	\(
+	""", re.VERBOSE)
+
+deleteMemberVariableNewELeave = re.compile("""
+	new
+	\s*
+	\(
+	\s*
+	ELeave
+	\s*
+	\)
+	""", re.VERBOSE)
+
+deleteMemberVariableLeave = re.compile("""
+	User::Leave
+	""", re.VERBOSE)
+
+deleteMemberVariableArrayDeletion = re.compile("""
+	(\.|->)
+	\s*
+	Delete
+	\s*
+	\(
+	""", re.VERBOSE)
+
+deleteMemberVariableArrayDeletion2 = re.compile("""
+	(\.|->)
+	\s*
+	Remove
+	\s*
+	\(
+	""", re.VERBOSE)
+
+def deleteMemberVariableCompare(lines, currentline, rematch, filename):
+	line = lines[currentline]
+	m = rematch.search(line)
+
+	if m:
+		if (scanner.iCurrentMethodName.find(scanner.iCurrentClassName) > -1):
+			return 0
+
+		deletingArrayMember = 0
+		if (line.find("[")):
+			deletingArrayMember = 1
+
+		# get the variable name, between the 'delete' and the ';'
+		endindex = line.find(";")
+		if (endindex == -1):
+			endindex = len(line)
+		startindex = line.find("delete")
+		variable = line[startindex+6:endindex]
+		variable2 = TrimVariableName(variable)
+
+		bracketdepth = GetBracketDepth(lines, currentline)
+
+		i = currentline
+		while (i < len(lines)):
+			nextLine = lines[i]
+
+			if deleteMemberVariableLeavingFunction.search(nextLine):
+				return 1
+			if deleteMemberVariableLeave.search(nextLine):
+				return 1
+			if deleteMemberVariableNewELeave.search(nextLine):
+				return 1
+			
+			if (deletingArrayMember == 1):
+				if (nextLine.find(variable2)):
+					if deleteMemberVariableArrayDeletion.search(nextLine):
+						return 0
+					if deleteMemberVariableArrayDeletion2.search(nextLine):
+						return 0
+
+			foundAssignment = nextLine.find("=")
+			if (foundAssignment > -1 and nextLine[foundAssignment+1] != "="):
+				assigned = nextLine[:foundAssignment]
+				if (assigned.find(variable2)):
+					return 0
+
+			if (nextLine.find('{') >= 0):
+				bracketdepth = bracketdepth + 1
+			if (nextLine.find('}') >= 0):
+				bracketdepth = bracketdepth - 1
+				if (bracketdepth == 0):
+					return 1
+
+			i = i + 1
+	return 0
+
+script.iCompare	= deleteMemberVariableCompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# destructor.py
+#
+# Checks : Pointer access in destructors.
+# 
+# Reason : Accessing pointers to objects in destructors without 
+# checking whether they are not NULL could result in a panic, since
+# they may not have been constructed. The pointers should be
+# checked to determine whether they are owned objects. If they are
+# not owned, they should really be references rather than pointers.
+#
+# #################################################################
+
+script = CScript("destructor")
+script.iReString = r"""
+	^\s*
+	\w+
+	\s*
+	::~
+	\s*
+	\w+
+	\(
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCanPanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+remember = re.compile("(i[A-Z]\w*)(.+)")
+reguard = re.compile("^\s*(if|while)(.*)({|$)")
+
+def findguard(lines, currentline, destructorstartline, membername):
+	i = currentline
+	line = lines[i]
+
+	while (i > destructorstartline):
+		line = lines[i]
+		m = reguard.search(line)
+		if m:
+			index = m.group(2).find(membername)
+			if (index <> -1):
+				if (line[index - 1:index] <> "*") and (line[index + len(membername):index + len(membername) + 2] <> "->"):
+					return 1
+		i = i - 1
+
+	return 0
+
+def destructorcompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		openbracecount = 0
+		closebracecount = 0
+		checkline = currentline
+
+		while (checkline < len(lines)):
+			line = lines[checkline]
+			openbracecount += line.count("{")
+			closebracecount += line.count("}")
+			member = remember.search(line)
+			if member and ((member.group(2)[:2] == "->") or (line[member.start()-1:member.start()] == "*" and member.group(2)[:1] <> ".")):
+				membername = member.group(1)
+				if (membername.upper()[-3:] == "ENV") or findguard(lines, checkline, currentline, membername) <> 0:
+					return 0
+				else:
+					return 1
+
+			if (openbracecount and (openbracecount - closebracecount == 0)):
+				break
+			checkline += 1
+
+	return 0
+
+script.iCompare	= destructorcompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# #################################################################
+# doubleSemiColon.py
+#
+# Checks : Use of double semicolon.
+#
+# Reason : Double semicolons at the end of a line are not necessary 
+# and cause a CodeWarrior compiler error.
+#
+# #################################################################
+
+script = CScript("doubleSemiColon")
+script.iReString = r"""
+	;
+	\s*
+	;
+	\s*
+	$
+	"""
+script.iFileExts = ["cpp", "h", "inl"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# driveletters.py
+#
+# Checks : Hard-coded drive letters.
+#
+# Reason : Drive letters should not be hard-coded.
+#
+# #################################################################
+
+script = CScript("driveletters")
+script.iReString = r"""[a-zA-Z]:\\\\"""
+script.iFileExts = ["cpp", "h", "rss", "rls", "loc", "ra"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreComments
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# eikbuttons.py
+#
+# Checks : Checks that the R_EIK_BUTTONS_* resources are not being 
+# used.
+#
+# Reason : R_EIK_BUTTONS_* resources will not be internationalised, 
+# and should not be used. Instead, create your own button resource. 
+# No button resource (or indeed, rls string) should be used in 
+# more than one location. Note: This issue is only relevant for 
+# development on Nokia platforms.
+#
+# #################################################################
+
+script = CScript("eikbuttons")
+script.iReString = "R_EIK_BUTTONS_.*?"
+script.iFileExts = ["rss", "cpp"]
+script.iCategory = KCategoryLocalisation
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# eikonenvstatic.py
+#
+# Checks : Using CEikonEnv::Static.
+#
+# Reason : CEikonEnv::Static() calls should be kept to a minimum, 
+# because this involves TLS. All applications, controls, and 
+# dialogs already have a pointer to the singleton instance of 
+# CEikonEnv as a member variable and so don't need to find it again. 
+# If a class does not have access to a CEikonEnv and needs to use 
+# it repeatedly, then it should store one.
+#
+# #################################################################
+
+script = CScript("eikonenvstatic")
+script.iReString = "CEikonEnv::Static"
+
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryPerformance
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# enummembers.py
+#
+# Checks : Badly-named enum members.
+#
+# Reason : Badly-named enum members make the code harder to 
+# maintain and may cause defects.
+#
+# #################################################################
+
+script = CScript("enummembers")
+script.iReString = r"""
+			^
+			\s*
+			enum
+			((\s+\w+)|(\s+\w+\s*::\s*\w+))?
+			\s*
+			({|$)
+			"""
+script.iFileExts = ["h", "cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+reMember = re.compile("^\s*(\w+)")
+
+def enummemberscompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		startline = currentline
+		openbraceindex = lines[startline].find("{")
+		while (openbraceindex == -1) and (startline < len(lines)) and (lines[startline].find(";") == -1):
+			startline += 1
+			openbraceindex = lines[startline].find("{")
+
+		if openbraceindex == -1:
+			return 0
+
+		endline = currentline
+		closebraceindex = lines[endline].find("}")
+		while (closebraceindex == -1) and (endline < len(lines)):
+			endline += 1
+			closebraceindex = lines[endline].find("}")
+
+		enumcontents = ""
+		if (startline == endline):
+			enumcontents = lines[startline][openbraceindex + 1:closebraceindex - 1]
+		else:
+			enumcontents = lines[startline][openbraceindex + 1:]
+			line = startline + 1
+			while (line < len(lines)) and (line < endline):
+				enumcontents = enumcontents + lines[line]
+				line += 1
+
+			enumcontents = enumcontents + lines[endline][:closebraceindex - 1]
+
+		# check contents
+		members = enumcontents.split("\n\r,")
+		for member in members:
+			m2 = reMember.search(member)
+			if m2 and (m2.group(1)[:1] <> "E"):
+				return 1
+									
+	return 0
+
+script.iCompare = enummemberscompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# enumnames.py
+#
+# Checks : Badly-named enums.
+#
+# Reason : Badly-named enums make the code harder to maintain and 
+# may cause defects.
+#
+# #################################################################
+
+script = CScript("enumnames")
+script.iReString = r"""
+			^
+			\s*
+			enum
+			\s+
+			(\w+\s*::\s*)?
+			(\w+)
+			\s*
+			({|$)
+			"""
+script.iFileExts = ["h", "cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+def enumnamescompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		if m.group(2)[:1] <> "T":
+				return 1
+
+	return 0
+
+script.iCompare = enumnamescompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# exportinline.py
+#
+# Checks : Exporting inline functions.
+#
+# Reason : Inline functions should not be exported because this can 
+# cause those that link to the DLL to fail to build. Exporting 
+# functions limits the changes that can be made in the future 
+# due to considerations of binary-compatibility.
+#
+# #################################################################
+
+script = CScript("exportinline")
+script.iReString = "IMPORT_C\s+.*inline\s+.+\("
+script.iFileExts = ["cpp", "h", "hpp", "inl", "c"]
+script.iCategory = KCategoryWrongFunctionality
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# exportpurevirtual.py
+#
+# Checks : Exporting pure virtual functions.
+#
+# Reason : Symbian recommends against the exportation of 
+# pure virtual functions.
+#
+# #################################################################
+
+script = CScript("exportpurevirtual")
+script.iReString = "IMPORT_C\s+.*\)\s*=\s*0\s*;$"
+script.iFileExts = ["cpp", "h", "hpp", "inl", "c"]
+script.iCategory = KCategoryWrongFunctionality
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+scanner.AddScript(script)
+
+
+
+# This script is duplicate of driveletters.py
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# externaldriveletters.py
+#
+# Checks : Hard-coded external drive letters.
+#
+# Reason : External drive letters should not be hard-coded as the 
+# external drive may change between platforms and releases. 
+# This may cause confusion over ownership leading to classes being 
+# deleted erroneously and leaks occurring.
+#
+# #################################################################
+
+#script = CScript("externaldriveletters")
+#script.iReString = """"[abd-yABD-Y]:\\\\"""
+#script.iFileExts = ["cpp", "h", "rss", "rls", "loc", "ra"]
+#script.iCategory = KCategoryCanPanic
+#script.iIgnore = KIgnoreComments
+#script.iSeverity = KSeverityHigh
+
+#scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# flags.py
+#
+# Checks : Use of R&D flags or feature flags.
+#
+# Reason : Independent application must not use R&D flags nor 
+# feature flags via preprocessor statements in the source code.
+# This means bld*.hrh and productvariant.hrh should not be used.
+#
+# #################################################################
+
+script = CScript("flags")
+script.iReString = r"""
+    ^\s*
+    \#include
+    \s+
+    ("|<)
+    ((bld\w+|productvariant)\.hrh)
+    ("|>)
+    """
+script.iFileExts = ["cpp", "h", "hrh", "mmp"]
+script.iCategory = KCategoryOther
+script.iIgnore = KIgnoreComments
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# foff.py
+#
+# Checks : Use of _FOFF.
+#
+# Reason : _FOFF allows access to data in classes that were not 
+# intended for public access. This may cause problems, especially 
+# when the location of the data changes.
+#
+# #################################################################
+
+script = CScript("foff")
+script.iReString = "_FOFF"
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# forbiddenwords.py
+#
+# Checks : Use of forbidden words in header files.
+#
+# Reason : Some words should not be used in header files; 
+# especially those header files destined for external release. 
+# Some words may be forbidden for legal reasons or for platform 
+# consistency. Where they exist, alternative allowed words should 
+# be used. For example, \"NMP\" and \"Nokia Mobile Phones\" should 
+# be replaced by \"Nokia\".
+#
+# #################################################################
+
+script = CScript("forbiddenwords")
+script.iReString = ""
+script.iFileExts = ["h"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreNothing
+script.iSeverity = KSeverityLow
+
+reForbiddenWordsStr = "(Typhoon|Hurricane|Calypso|Rubik|Epoc\\|Nokia Mobile Phones|NMP|Mobile Innovation|(^|\s)S90|(^|\s)S80)"
+
+scriptNode = script.ScriptConfig()
+if (scriptNode <> None):
+	for wordNode in scriptNode.getElementsByTagName("wordsRE"):
+		reForbiddenWordsStr = wordNode.firstChild.nodeValue
+		print "Note: 'forbidden words' pattern configured as: " + reForbiddenWordsStr
+		break
+reForbiddenWords = re.compile(reForbiddenWordsStr, re.IGNORECASE)
+
+def forbiddenwordcompare(lines, currentline, rematch, filename):
+	return reForbiddenWords.search(lines[currentline])
+
+script.iCompare = forbiddenwordcompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# forgottoputptroncleanupstack.py
+#
+# Checks : Neglected to put variable on cleanup stack.
+#
+# Reason : If a variable is not put on the cleanup stack and a 
+# leaving function or ELeave is called, a memory leak occurs. 
+# CodeScanner occasionally gives false positives for this issue. 
+# Individual cases should be investigated.
+#
+# #################################################################
+
+script = CScript("forgottoputptroncleanupstack")
+script.iReString = r"""
+	\s+				# optional whitespace
+	[b-hj-z]+		# must not be a member or parameter
+	[A-Za-z0-9]+	# variable name
+	\s*				# optional whitespace
+	=				# assignment operator
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+forgottoputptroncleanupstackCleanup = re.compile("""Cleanup""", re.VERBOSE)
+
+forgottoputptroncleanupstackDeleteOp = re.compile("""
+	\s+
+	delete
+	\s+
+	""", re.VERBOSE)
+
+forgottoputptroncleanupstackReturnCmd = re.compile("""
+	(\s*|\()
+	return
+	(\s*|\()
+	""", re.VERBOSE)
+
+forgottoputptroncleanupstackSetFn = re.compile("""
+	Set
+	[A-Za-z0-9]+
+	[A-KM-Za-z0-9]
+	\s*
+	\(
+	""", re.VERBOSE)
+
+forgottoputptroncleanupstackBreak = re.compile("""
+	\s+
+	break
+	\s*
+	;
+	""", re.VERBOSE)
+
+forgottoputptroncleanupstackIf = re.compile("""
+	\s+
+	if
+	\s*
+	\(
+	""", re.VERBOSE)
+	
+forgottoputptroncleanupstackElse = re.compile("""
+	\}*
+	\s*
+	else
+	\s*
+	\{*
+	""", re.VERBOSE)
+
+forgottoputptroncleanupstackAssignToMember = re.compile("""
+	i
+	[A-Za-z0-9\[\]]+
+	\s*
+	=
+	\s*
+	.*
+	\s*
+	;
+	""", re.VERBOSE)
+
+forgottoputptroncleanupstackTrapMacro = re.compile("""
+	TRAP
+	[D]*
+	\s*
+	\(
+	""", re.VERBOSE)
+
+forgottoputptroncleanupstackLeavingFunction = re.compile("""
+	[A-Za-z0-9]+
+	L
+	\s*
+	\(
+	""", re.VERBOSE)
+
+forgottoputptroncleanupstackLeave = re.compile("""
+	User::Leave
+	""", re.VERBOSE)
+
+forgottoputptroncleanupstackLeaveAndDelete = re.compile("""
+	L
+	[D]+
+	\s*
+	\(
+	""", re.VERBOSE)
+
+forgottoputptroncleanupstackNewOperator = re.compile("""
+	new
+	\s*
+	\(
+	\s*
+	ELeave
+	""", re.VERBOSE)
+
+forgottoputptroncleanupstackNewFunction = re.compile("""
+	::NewL
+	\s*
+	\(
+	""", re.VERBOSE)
+
+forgottoputptroncleanupstackCreateFunction = re.compile("""
+	Create
+	[A-Za-z0-9]+
+	L
+	\s*
+	\(
+	""", re.VERBOSE)
+
+forgottoputptroncleanupstackAllocFunction = re.compile("""
+	Alloc
+	L*
+	\s*
+	\(
+	""", re.VERBOSE)
+
+def findForgetCompare(lines, currentline, rematch, filename):
+	line = lines[currentline]
+	m = rematch.search(line)
+
+	if m:
+		foundNew = 0
+		equalPos = line.find("=")
+		assignedSection = line[equalPos:]
+	
+		if forgottoputptroncleanupstackNewFunction.search(assignedSection):
+			foundNew = 1
+		if forgottoputptroncleanupstackNewOperator.search(assignedSection):
+			foundNew = 1
+		if forgottoputptroncleanupstackAllocFunction.search(assignedSection):
+			foundNew = 1
+		if forgottoputptroncleanupstackCreateFunction.search(assignedSection):
+			foundNew = 1
+
+		# if this line contains a 'new', a 'NewL(', or an 'AllocL('
+		if (foundNew == 1):	
+			i = currentline
+
+		# move to next line ending if this line doesn't contain one
+			while (lines[i].find(';') == -1):
+				i = i + 1
+
+		# go to next line
+			i = i + 1
+			bracketdepth = GetBracketDepth(lines, i)
+			
+		# get the variable name, between the '*' and the '='
+			startindex = line.find("*")
+			if (startindex == -1):
+				startindex = 0
+			endindex = line.find("=")
+			variable = line[startindex+1:endindex]
+			if (len(variable) < 1):
+				return 0
+			variable = TrimVariableName(variable)
+
+			inAnIfOrSelectStatement = 1 # possibly
+			
+			while (i < len(lines)):
+				line2 = lines[i]
+
+				if (line2.find('{') >= 0):
+					bracketdepth = bracketdepth + 1
+				if (line2.find('}') >= 0):
+					bracketdepth = bracketdepth - 1
+					inAnIfOrSelectStatement = 0
+					if (bracketdepth == 0):
+						return 0
+
+				varIndex = line2.find(variable)
+		# if a later line contains the variable...
+				while (varIndex <> -1):
+					if (isNonAlpha(line2[varIndex-1])):
+						if (isNonAlpha(line2[varIndex+len(variable)])):
+		# ...and delete, exit
+							if forgottoputptroncleanupstackDeleteOp.search(line2):
+								return 0
+	
+		# ...and an xxxLD() function, exit
+							if forgottoputptroncleanupstackLeaveAndDelete.search(line2):
+								return 0
+							
+		# ...and the variable is assigned to a member variable, exit
+							if forgottoputptroncleanupstackAssignToMember.search(line2):
+								return 0
+		
+		# ...and it is a Set...() call, exit (e.g. SetArray, SetAppUi)
+							if forgottoputptroncleanupstackSetFn.search(line2):
+								return 0
+
+		# ...and a return command, exit 
+							if forgottoputptroncleanupstackReturnCmd.search(line2):
+								return 0
+
+		# search this line again incase there are similarly named variables
+					line2 = line2[varIndex+1:]
+					varIndex = line2.find(variable)
+
+				line2 = lines[i]
+		# if a leaving function is called...
+				if forgottoputptroncleanupstackLeavingFunction.search(line2):
+		# ...if the leaving function is trapped, exit
+					if forgottoputptroncleanupstackTrapMacro.search(line2):
+						return 0
+		# ...if a Cleanup function is called, exit
+					if forgottoputptroncleanupstackCleanup.search(line2):
+						return 0
+		# ...otherwise this is a problem!
+					return 1
+
+		# if a User::Leave is called, this is a problem
+				if forgottoputptroncleanupstackLeave.search(line2):
+					return 1
+	
+		# if the variable is initialised in a branch of an 'if' or 'switch' statement, ignore other branches
+				if (inAnIfOrSelectStatement == 1):
+					if forgottoputptroncleanupstackBreak.search(line2):
+						atLine = i
+						inAnIfOrSelectStatement = 0
+						findSwitch = i
+						line3 = lines[findSwitch]
+						while (line3.find("switch") == -1):
+							findSwitch = findSwitch - 1
+							if (findSwitch <= 0):
+								return 0
+							line3 = lines[findSwitch]
+						switchBracketDepth = GetBracketDepth(lines, findSwitch)
+						i = atLine
+						while (bracketdepth > switchBracketDepth):
+							if (i >= len(lines)):
+								return 0
+							line2 = lines[i]
+							if (line2.find('{') >= 0):
+								bracketdepth = bracketdepth + 1
+							if (line2.find('}') >= 0):
+								bracketdepth = bracketdepth - 1
+							i = i + 1
+							
+					if forgottoputptroncleanupstackElse.search(line2):
+						inAnIfOrSelectStatement = 0
+						elseBracketDepth = bracketdepth
+						if (line2.find('{') >= 0):
+							elseBracketDepth = elseBracketDepth - 1
+						if (elseBracketDepth == GetBracketDepth(lines, currentline)):
+							while (line2.find(';') == -1):
+								i = i + 1
+								if (i >= len(lines)):
+									return 0
+								line2 = lines[i]
+						else:
+							while (bracketdepth > elseBracketDepth):
+								i = i + 1
+								if (i >= len(lines)):
+									return 0
+								line2 = lines[i]
+								if (line2.find('{') >= 0):
+									bracketdepth = bracketdepth + 1
+								if (line2.find('}') >= 0):
+									bracketdepth = bracketdepth - 1
+
+					if forgottoputptroncleanupstackIf.search(line2):
+						inAnIfOrSelectStatement = 0
+				i = i + 1
+			return 0
+
+	return 0
+
+script.iCompare	= findForgetCompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# friend.py
+#
+# Checks : Use of friends.
+#
+# Reason : The friend directive is often misused and can indicate 
+# problems in the OO design.
+#
+# #################################################################
+
+script = CScript("friend")
+script.iReString = "^\s*friend\s"
+script.iFileExts = ["cpp", "h", "hpp", "inl", "c"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# goto.py
+#
+# Checks : Use of goto.
+#
+# Reason : Goto should not be used if it can be avoided because 
+# it makes the program flow more difficult to follow.
+#
+# #################################################################
+
+script = CScript("goto")
+script.iReString = "(^|[^\w])goto\s+"	# a goto at the beginning of a line or after a non-alphanumeric char
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# ifassignments.py
+#
+# Checks : Assignment in an If statement.
+#
+# Reason : Assignments inside an If statement often indicate that 
+# the assignment was not intended. Even if the assignment was 
+# intended, it is clearer to separate out the assignment from the 
+# conditional. The script that detects such occurrences has a few 
+# false positives when the action statements are on the same line 
+# as the conditional check. However, this is also against the 
+# coding standards and the action should be on a separate line.
+#
+# #################################################################
+
+script = CScript("ifassignments")
+script.iReString = "^\s*if\s*\(\s*.*[A-Za-z0-9_]\s*=\s*[A-Za-z0-9_].*\)"
+script.iFileExts = ["h", "cpp", "c"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# ifpreprocessor.py
+#
+# Checks : Use of #if in .h files.
+#
+# Reason : #if in header files should only be used before the 
+# main include guards and not around #include statements or around 
+# functional blocks in class definitions. The reason for the latter 
+# is to aid readability and to make BC breaks more difficult.
+#
+# #################################################################
+
+script = CScript("ifpreprocessor")
+script.iReString = "^\s*\#if(.*)"
+script.iFileExts = ["h"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+def ifpreprocessorcompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		text = m.group(1)
+		slashindex = filename.rfind("/")
+		if slashindex == -1 :
+			slashindex = filename.rfind("\\")			
+		if (slashindex <> -1) and (text.upper().find(filename[slashindex+1:-2].upper()) == -1):
+			return 1
+		else:
+			return 0
+
+script.iCompare = ifpreprocessorcompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# inheritaenceorder.py
+#
+# Checks : Incorrect inheritance order of M and C classes.
+#
+# Reason : If a C class inherits first from an M class and then a 
+# C class, a panic can occur when trying to pop a CBase pointer 
+# pointing to such a class from the cleanup stack when in fact a 
+# pointer pointing to the first predecessor, the mixin class, was 
+# popped instead.
+#
+# #################################################################
+
+script = CScript("inheritanceorder")
+script.iReString = r"""
+    ^\s*         # optional whitespace
+    class
+    \s+          # whitespace
+    (\w+::)?
+    (\w+)        # class name
+    \s*          # optional whitespace
+    :
+    (.*)         # inheritance list
+    """
+script.iFileExts = ["h", "cpp"]
+script.iCategory = KCategoryCanPanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+def inheritancecompare(lines, currentline, rematch, filename):
+    m = rematch.search(lines[currentline])
+    if m:
+        className = m.group(2)
+        if className[0] <> "C" or (len(className) == 1) or not className[1].isupper():
+            return 0
+
+        inheritanceString = m.group(3)
+
+        # check for inheritance list spanning multiple lines
+        i = currentline + 1
+        while (inheritanceString.find("{") == -1) and i < len(lines):
+            if (inheritanceString.find(";") <> -1):
+                return 0
+            inheritanceString += lines[i]
+            i += 1
+
+        # construct inheritance class list
+        inheritancelist = inheritanceString.split(",")
+        reclass = re.compile("[\s:]*(public|protected|private)?\s*([\w:]+)")
+        classlist = []
+        for inheritance in inheritancelist:
+            match = reclass.search(inheritance)
+            if match:
+                inheritclass = match.group(2)
+                colonpos = inheritclass.rfind(":")
+                if (colonpos <> -1):
+                    inheritclass = inheritclass[colonpos + 1:]
+                classlist.append(inheritclass)
+
+        # check the order of M and C classes in inheritance class list 
+        mclassIndex = -1
+        cclassIndex = -1
+        for classname in classlist:
+            if (len(classname) > 2):
+                if classname[0] == "M" and classname[1].isupper() and mclassIndex == -1:
+                    mclassIndex = classlist.index(classname)
+                if classname[0] == "C" and classname[1].isupper() and cclassIndex == -1:
+                    cclassIndex = classlist.index(classname)
+        if mclassIndex != -1 and cclassIndex != -1 and mclassIndex < cclassIndex:
+            return 1
+        else:
+            return 0
+
+    return 0
+
+script.iCompare = inheritancecompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# intleaves.py
+#
+# Checks : Methods that leave AND return a TInt error.
+#
+# Reason : Returning an error code as well as being able to leave 
+# is problematical for the caller. It is preferable to adhere to 
+# one method of returning the error. Note: CodeScanner is likely to 
+# return false positives for this situation, because some returned 
+# TInt values will not be error codes.
+#
+# #################################################################
+
+script = CScript("intleaves")
+script.iReString = "TInt\s+\w+::\w+LC?\s*\("
+script.iFileExts = ["h", "cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# jmp.py
+#
+# Checks : Use of setjmp and/or longjmp.
+#
+# Reason : Using setjmp and/or longjmp makes code less maintainable.
+#
+# #################################################################
+
+script = CScript("jmp")
+script.iReString = r"""
+	(set|long)jmp
+	"""
+script.iFileExts = ["cpp", "h"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# leave.py
+#
+# Checks : Leaving functions called in non-leaving functions.
+#
+# Reason : Non-leaving functions should not call leaving functions. 
+# Note: Operator functions are considered to be able to leave when 
+# scanning the code inside them.
+#
+# #################################################################
+
+script = CScript("leave")
+script.iReString = KReStringLeavingLine
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCanPanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+reLeavingMethod = re.compile("""
+	(
+	\s*operator
+	|
+	\w*
+	[a-z]
+	\w*
+	L
+	(C(C*|[2-9])|D|P|X)?
+	$
+	)
+""", re.VERBOSE)
+
+def leavecompare(lines, currentline, rematch, filename):
+	currentMethod = scanner.iCurrentMethodName
+	if (currentMethod <> "") and (currentMethod[:5] <> "Leave"):
+		m = rematch.search(lines[currentline])
+		if m and not reLeavingMethod.search(currentMethod):
+			line = lines[currentline]
+			startline = currentline
+			if (lines[currentline].find("TRAP") != -1):
+				return 0
+
+			bracketCount = line.count("(") - line.count(")")
+			startBracketCount = bracketCount
+
+			while (currentline > startline - 40) and (currentline >= 0):
+				currentline -= 1
+				line = lines[currentline]
+				bracketCount += line.count("(") - line.count(")")
+				if (lines[currentline].find("TRAP") != -1) and (bracketCount == startBracketCount + 1):
+					return 0
+			return 1
+
+	return 0
+
+script.iCompare = leavecompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# LeaveNoError.py
+#
+# Checks : Leaving with KErrNone.
+#
+# Reason : Leaving with KErrNone usually indicates that there is a 
+# makeshift way around a design issue rather than a true and proper 
+# fix to the architecture.
+#
+# #################################################################
+
+script = CScript("LeaveNoError")
+script.iReString = "User\s*::\s*Leave\(\s*KErrNone\s*\)"
+script.iFileExts = ["cpp", "h", "c", "inl"]
+script.iCategory = KCategoryWrongFunctionality
+script.iIgnore = KIgnoreComments
+script.iSeverity = KSeverityMedium
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# leavingoperators.py
+#
+# Checks : Leaving functions called in operator functions.
+#
+# Reason : It is not obvious that operator functions can leave. 
+# Calling leaving functions in operator functions should be 
+# considered carefully.
+#
+# #################################################################
+
+script = CScript("leavingoperators")
+script.iReString = "(\w*[a-z]\w*L(C*|D|P))\s*\(|ELeave|User::Leave|tream\s+<<|tream\s+>>"
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+reOperatorMethod = re.compile("""
+	operator
+	""", re.VERBOSE)
+
+def leavecompare(lines, currentline, rematch, filename):
+	currentMethod = scanner.iCurrentMethodName
+	if (currentMethod <> "") and (currentMethod[:5] <> "Leave"):
+		m = rematch.search(lines[currentline])
+		if m and reOperatorMethod.search(currentMethod):
+			line = lines[currentline]
+			startline = currentline
+			if (lines[currentline].find("TRAP") != -1):
+				return 0
+
+			bracketCount = line.count("(") - line.count(")")
+			startBracketCount = bracketCount
+
+			while (currentline > startline - 20) and (currentline >= 0):
+				currentline -= 1
+				line = lines[currentline]
+				bracketCount += line.count("(") - line.count(")")
+				if (lines[currentline].find("TRAP") != -1) and (bracketCount == startBracketCount + 1):
+					return 0
+			return 1
+
+	return 0
+
+script.iCompare = leavecompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# LFunctionCantLeave.py
+#
+# Checks : L-functions that cannot leave.
+#
+# Reason : A function should not be named with an 'L' if it cannot 
+# leave. The only exception is in virtual functions where the 
+# function name is defined in the base class so the L cannot be 
+# emoved. For example, RunL().
+#
+# #################################################################
+
+script = CScript("LFunctionCantLeave")
+script.iReString = r"""
+	[A-Za-z0-9]+			# return type
+	\s+
+	[C|T|R][A-Za-z0-9]+		# class name
+	::
+	([A-Za-z0-9]+L(C|D)*)	# leaving function name (possible LC or LD function)
+	\s*						# optional whitespace
+	\(						# open bracket
+	.*						# parameters
+	\)						# close bracket
+	\s*
+	[^;]					# no semicolon after function definition
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+lfunctioncantleaveLeavingMethod = re.compile("""
+	[A-Za-z0-9]+
+	L
+	(C|D)*
+	\(
+""", re.VERBOSE)
+
+lfunctioncantleaveUserLeave = re.compile("""
+	User::Leave
+	""", re.VERBOSE)
+
+lfunctioncantleaveNewELeave = re.compile("""
+	new
+	\s*
+	\(
+	\s*
+	ELeave
+	\s*
+	\)
+""", re.VERBOSE)
+
+reLFunctionIgnoreStr = "RunL"
+scriptNode = script.ScriptConfig()
+if (scriptNode <> None):
+	for wordNode in scriptNode.getElementsByTagName("LFunctionIgnoreRE"):
+		reLFunctionIgnoreStr = wordNode.firstChild.nodeValue
+		print "Note: ignoring the following functions when checking for L-functions that cannot leave: " + reLFunctionIgnoreStr
+		break
+if len(reLFunctionIgnoreStr) > 0:
+	reLFunctionIgnores = re.compile(reLFunctionIgnoreStr, re.IGNORECASE)
+else :
+	reLFunctionIgnores = None
+
+def lfunctioncantleavecompare(lines, currentline, rematch, filename):
+	line = lines[currentline]
+	m = rematch.search(line)
+
+	if m:
+		#ignore functions on the ignored list
+		functionName = m.group(1)
+		if reLFunctionIgnores:
+			if reLFunctionIgnores.match(functionName):
+				return 0
+
+		i = currentline
+
+		# find opening { in function
+		while (line.count("{") == 0):
+			i = i + 1
+			if (i >= len(lines)):
+				return 1
+			line = lines[i]
+
+		# if empty function (or one-line function?)
+		if (line.count("}") > 0):
+			return 1
+
+		i = i + 1
+		bracketDepth = 1
+
+		while (i < len(lines)):
+			line = lines[i]
+			if lfunctioncantleaveLeavingMethod.search(line):
+				return 0
+			if lfunctioncantleaveUserLeave.search(line):
+				return 0
+			if lfunctioncantleaveNewELeave.search(line):
+				return 0 
+
+			bracketDepth += line.count("{") - line.count("}")
+			if (bracketDepth == 0):
+				return 1
+			i = i + 1
+	return 0
+
+script.iCompare = lfunctioncantleavecompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# longlines.py
+#
+# Checks : Overly long lines of code.
+#
+# Reason : Lines longer than about 100 characters can indicate 
+# messy or badly-structured code that is hard to maintain.
+#
+# #################################################################
+
+script = CScript("longlines")
+# use configured line length, if available
+scriptNode = script.ScriptConfig()
+attrInt = 100
+if (scriptNode <> None):
+	attr = scriptNode.getAttribute("length")
+	attrStr = str(attr)
+	attrInt = 0
+	if (attrStr.isdigit()):
+		attrInt = int(attrStr)
+	if (attrInt < 10):
+		attrInt = 100
+		print "Warning: Invalid line length configured; using default of 100: " + attr
+	else:
+		print "Note: 'long' line length configured as: " + str(attrInt)
+script.iReString = r""".{"""+str(attrInt)+r"""}"""
+
+script.iFileExts = ["cpp", "h", "rss", "rls", "loc", "ra","mmp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# magicnumbers.py
+#
+# Checks : Use of magic numbers.
+#
+# Reason : Magic numbers - that is, numbers that are hard-coded 
+# into the source code and instead of being presented as constants 
+# - make code difficult to maintain and give no indication of why 
+# a calculation is the way it is. Magic numbers should be replaced 
+# with named constants.
+#
+# #################################################################
+
+script = CScript("magicnumbers")
+script.iReString = "(.*[^a-zA-Z0-9_])([0-9]+)"
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+reEnum = re.compile("^\s*E\w+\s*=\s*");
+
+def magiccompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		pretext = m.group(1)
+		number = m.group(2)
+		if (number == "0") or (number == "1") or (number == '2'):
+			return 0
+		elif (pretext.find("const") <> -1):
+			return 0
+		else:
+			m2 = reEnum.search(pretext)
+			if m2:
+				return 0
+			else:
+				return 1
+
+script.iCompare = magiccompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# mclassdestructor.py
+#
+# Checks : M class has destructor.
+#
+# Reason : M classes should not contain a destructor.
+#
+# #################################################################
+
+script = CScript("mclassdestructor")
+script.iReString = r"""
+	::
+	\s*				# optional whitespace
+	~M[A-Z]			# destructor
+	"""
+script.iFileExts = ["cpp", "h"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# memberlc.py
+#
+# Checks : Assigning LC methods to member variables.
+#
+# Reason : Objects on the cleanup stack should not be assigned to 
+# member variables.
+#
+# #################################################################
+
+script = CScript("memberlc")
+script.iReString = r"""
+	^\s*
+	i[A-Z]\w*
+	\s*
+	=
+	\s*
+	[\w:]+
+	LC
+	\s*
+	\(
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCanPanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+reMemberLCPop = re.compile("\s*CleanupStack::Pop\s*\(")
+
+def memberlccompare(lines, currentline, rematch, filename):
+	if rematch.search(lines[currentline]):
+		if (currentline + 1) < len(lines):
+			if reMemberLCPop.search(lines[currentline + 1]):
+				return 0	# next line is a Pop
+			else:
+				return 1
+		else:					
+			return 1
+	else:
+		return 0
+
+script.iCompare = memberlccompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# membervariablecallld.py
+#
+# Checks : Calling LD function on member variable.
+#
+# Reason : LD functions should not be called on a member variable 
+# because ownership can be unclear and may lead to double deletes.
+#
+# #################################################################
+
+script = CScript("membervariablecallld")
+script.iReString = r"""
+	i[A-Z]			# instance variable
+	\w+				# rest of the instance variable name
+	\s*				# optional whitespace
+	(.|->)			# operator
+	\s*				# optional whitespace
+	[A-Z]			# classname
+	\w+				# rest of the instance variable name
+	LD\(			# LD function
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# missingcancel.py
+#
+# Checks : Cancel() not called in active object's destructor.
+# 
+# Reason : Cancel() should always be called in active object's 
+# destructor to cancel an outstanding request if there is one. 
+# If there is no request pending then Cancel() just does nothing, 
+# but if we do not call Cancel() when having an outstanding request 
+# a panic will be raised. CodeScanner occasionally gives false 
+# positives for this issue. Individual cases should be 
+# investigated.
+#
+# #################################################################
+
+script = CScript("missingcancel")
+script.iReString = r"""
+    ::
+    \s*        # optional whitespace
+    ~C(\w+)
+    """
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+# possible active and timer object types
+activeObjectType = re.compile("\w+Active$")
+timerObjectType = re.compile("\w+Timer$")
+
+cancelFunction = re.compile("""
+    Cancel
+    \s*
+    \(
+    """, re.VERBOSE)
+
+def isActiveDestructor(destructorType):
+    if (activeObjectType.match(destructorType)) or (timerObjectType.match(destructorType)):
+        return True
+    return False
+
+def cancelcompare(lines, currentline, rematch, filename):
+    line = lines[currentline]
+    m = rematch.search(line)
+
+    if m:
+        destructorType = m.group(1)
+        # skip non-active types
+        if (not isActiveDestructor(destructorType)):
+            return 0
+
+        i = currentline
+
+        # find opening { in function
+        while (line.count("{") == 0):
+            i = i + 1
+            if (i >= len(lines)):
+                return 1
+            line = lines[i]
+
+        # if one-line or empty function
+        if (line.count("}") > 0):
+            if (cancelFunction.search(line)):
+                return 0
+            else:
+                return 1
+
+        i = i + 1
+        bracketDepth = 1
+        while (i < len(lines)):
+            line = lines[i]
+            if (cancelFunction.search(line)):
+                return 0
+
+            bracketDepth += line.count("{") - line.count("}")
+            if (bracketDepth == 0):
+                return 1
+            i = i + 1
+    return 0
+
+script.iCompare = cancelcompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# missingcclass.py
+#
+# Checks : C class not inheriting from another C class.
+#
+# Reason : All C classes should inherit from another C class to 
+# ensure that all data members are zeroed.
+#
+# #################################################################
+
+script = CScript("missingcclass")
+script.iReString = r"""
+	^\s*
+	class
+	\s+
+	(\w+::)?
+	(\w+)
+	\s*
+	(.*)"""
+script.iFileExts = ["h", "cpp"]
+script.iCategory = KCategoryCanPanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+reCClassIgnoreStr = ""
+scriptNode = script.ScriptConfig()
+if (scriptNode <> None):
+	for wordNode in scriptNode.getElementsByTagName("cclassIgnoreRE"):
+		reCClassIgnoreStr = wordNode.firstChild.nodeValue
+		print "Note: ignoring the following classes when checking for C class not inheriting from another C class: " + reCClassIgnoreStr
+		break
+if len(reCClassIgnoreStr) > 0:
+	reCClassIgnores = re.compile(reCClassIgnoreStr, re.IGNORECASE)
+else :
+	reCClassIgnores = None
+
+def missingcclasscompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		className = m.group(2)
+		if className[0] <> "C" or (len(className) == 1) or not className[1].isupper():
+			return 0
+
+		#ignore classes on the ignored list
+		if reCClassIgnores:
+			if reCClassIgnores.search(className):
+				return 0
+
+		inheritanceString = m.group(3)
+		i = currentline + 1
+		while (inheritanceString.find("{") == -1) and i < len(lines):
+			if (inheritanceString.find(";") <> -1):
+				return 0
+			inheritanceString += lines[i]
+			i += 1
+		
+		inheritancelist = inheritanceString.split(",")
+
+		reclass = re.compile("[\s:]*(public|protected|private)?\s*([\w:]+)")
+		classlist = []
+		for inheritance in inheritancelist:
+			match = reclass.search(inheritance)
+			if match:
+				inheritclass = match.group(2)
+				colonpos = inheritclass.rfind(":")
+				if (colonpos <> -1):
+					inheritclass = inheritclass[colonpos + 1:]
+				classlist.append(inheritclass)
+
+		ccount = 0
+		for classname in classlist:
+			if (len(classname) > 2) and classname[0] == "C" and classname[1].isupper():
+				ccount += 1
+				
+		if ccount == 0:
+			return 1
+		else:
+			return 0
+	else:
+		return 0
+
+script.iCompare = missingcclasscompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# mmpsourcepath.py
+#
+# Checks : Use of absolute path names in MMP files.
+#
+# Reason : Use of absolute paths in MMP files makes it impossible 
+# to relocate the source. Relative paths should be used instead.
+#
+# #################################################################
+
+script = CScript("mmpsourcepath")
+script.iReString = "^\s*[Ss][Oo][Uu][Rr][Cc][Ee][Pp][Aa][Tt][Hh]\s*\\\\"
+script.iFileExts = ["mmp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# multilangrsc.py
+#
+# Checks : Not using BaflUtils::NearestLanguageFile() when loading 
+# a resource file.
+#
+# Reason : If AddResourceFileL() is used without first using 
+# BaflUtils::NearestLanguageFile(), then not all language versions 
+# of resources will be picked up.
+#
+# #################################################################
+
+script = CScript("multilangrsc")
+script.iReString = """
+	AddResourceFileL
+	\s*
+	\(
+	\s*\w+.*
+	\)
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+reBaflNearestLanguage = re.compile("""
+	\s*
+	BaflUtils::NearestLanguageFile
+	\s*
+	\(
+	\s*\w+.*
+	\)
+	""", re.VERBOSE)
+
+def multilangrsccompare(lines, currentline, rematch, filename):
+	if (scanner.iCurrentMethodName <> ""):
+		m = rematch.search(lines[currentline])
+		if m:
+			scanLineNum = currentline
+			while (scanLineNum>scanner.iCurrentMethodStart):
+				addResMatch = reBaflNearestLanguage.search(lines[scanLineNum])
+				if addResMatch:
+					return 0
+				scanLineNum = scanLineNum - 1
+			return 1
+	return 0
+
+script.iCompare = multilangrsccompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# multipledeclarations.py
+#
+# Checks : Multiple declarations on one line.
+#
+# Reason : Multiple declarations on one line can be confusing. 
+# Separate them out so that each declaration is on its own separate 
+# line.
+#
+# #################################################################
+
+script = CScript("multipledeclarations")
+script.iReString = r"""
+	\w+		# variable name
+	\s*		# optional whitespace
+	=
+	\s*		# optional whitespace
+	\w+		# variable value
+	\s*		# optional whitespace
+	,
+	\s*		# optional whitespace
+	\w+		# variable name
+	\s*		# optional whitespace
+	=
+	\s*		# optional whitespace
+	\w+		# variable value
+	\s*		# optional whitespace
+	;
+	"""
+script.iFileExts = ["h", "cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# multipleinheritance.py
+#
+# Checks : Non M-class multiple inheritance.
+#
+# Reason : It is bad Symbian OS practice to derive from two classes 
+# that have implemented functions. Complex behaviour that was not 
+# intended can result.
+#
+# #################################################################
+
+script = CScript("multipleinheritance")
+script.iReString = r"""
+	^\s*
+	class
+	\s+
+	(\w+::)?
+	(\w+)
+	\s*
+	:
+	(.*)"""
+script.iFileExts = ["h", "cpp"]
+script.iCategory = KCategoryWrongFunctionality
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+def classcompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		className = m.group(2)
+		if className[0] <> "C" or (len(className) == 1) or not className[1].isupper():
+			return 0
+
+		inheritanceString = m.group(3)
+		i = currentline + 1
+		while (inheritanceString.find("{") == -1) and i < len(lines):
+			if (inheritanceString.find(";") <> -1):
+				return 0
+			inheritanceString += lines[i]
+			i += 1
+		
+		inheritancelist = inheritanceString.split(",")
+
+		reclass = re.compile("[\s:]*(public|protected|private)?\s*([\w:]+)")
+		classlist = []
+		for inheritance in inheritancelist:
+			match = reclass.search(inheritance)
+			if match:
+				inheritclass = match.group(2)
+				colonpos = inheritclass.rfind(":")
+				if (colonpos <> -1):
+					inheritclass = inheritclass[colonpos + 1:]
+				classlist.append(inheritclass)
+
+		ccount = 0
+		for classname in classlist:
+			if (len(classname) > 2) and classname[0] == "C" and classname[1].isupper():
+				ccount += 1
+				
+		if ccount > 1:
+			return 1
+		else:
+			return 0
+	else:
+		return 0
+
+script.iCompare = classcompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# mydocs.py
+#
+# Checks : Hard-coded mydocs directory strings.
+# 
+# Reason : The mydocs directory is subject to change so should not 
+# be referenced directly. Note: @    This issue will only occur in 
+# code developed for the Nokia Series 90 platform.
+#
+# #################################################################
+
+script = CScript("mydocs")
+script.iReString = """".*[Mm][Yy][Dd][Oo][Cc][Ss]"""
+script.iFileExts = ["cpp", "h", "rss", "rls", "loc", "ra"]
+script.iCategory = KCategoryWrongFunctionality
+script.iIgnore = KIgnoreComments
+script.iSeverity = KSeverityMedium
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# namespace.py
+#
+# Checks : Use of namespace.
+#
+# Reason : Namespaces are often used to work around a poor naming 
+# convention.
+#
+# #################################################################
+
+script = CScript("namespace")
+script.iReString = "^\s*namespace\s*"
+script.iFileExts = ["cpp", "h", "hpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# newlreferences.py
+#
+# Checks : NewL() returning a reference.
+#
+# Reason : NewL() and NewLC() functions should return a pointer to 
+# an object created on the heap.
+#
+# #################################################################
+
+script = CScript("newlreferences")
+script.iReString = "&\s*NewL"
+script.iFileExts = ["cpp", "h", "hpp", "inl", "c"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# noleavetrap.py
+#
+# Checks : TRAP used with no leaving functions.
+#
+# Reason : A TRAP is unnecessary if there are no leaving functions.
+#
+# #################################################################
+
+script = CScript("noleavetrap")
+script.iReString = "^\s*TRAPD?"
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+reLeave = re.compile("(L[CDP]?\s*\(|ELeave|\)\s*\(|<<|>>)")
+
+def noleavetrapcompare(lines, currentline, rematch, filename):
+    line = lines[currentline]
+    m = rematch.search(line)
+    if m:
+    	if (line.find("(") == -1) and (currentline + 1 < len(lines)):
+    		currentline += 1
+    		line = lines[currentline]
+
+        bracketCount = line.count("(") - line.count(")")
+        found = reLeave.search(line) 
+
+        while (bracketCount > 0) and (currentline + 1 < len(lines)):
+            currentline += 1
+            line = lines[currentline]
+            bracketCount += line.count("(") - line.count(")")
+            if not found:
+                found = reLeave.search(line) 
+
+        if found:
+            return 0
+        else:
+        	return 1
+
+    return 0
+
+script.iCompare = noleavetrapcompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# nonconsthbufc.py
+#
+# Checks : Non-const HBufC* parameter passing.
+#
+# Reason : HBufC* parameters should almost always be passed as a 
+# const pointer.
+#
+# #################################################################
+
+script = CScript("nonconsthbufc")
+script.iReString = """
+    (\(|,)?        # open bracket or preceeding comma
+    \s*            # whitespace
+    (\w+)?
+    \s*            # whitespace
+    HBufC
+    \s*            # whitespace
+    \*
+    \s*            # whitespace
+    (\w+)          # parameter name
+    (=|\w|\s)*     # optional parameter initialization or whitespace
+    (\)|,)         # close bracket or trailing comma
+    """
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+def consthbufccompare(lines, currentline, rematch, filename):
+    # make sure const HBufC* parameters are skipped
+    line = lines[currentline]
+    m = rematch.search(line)
+    if m:
+        isConst = (m.group(0).find("const") <> -1)
+        while m and isConst:
+            line = line[m.end():]
+            m = rematch.search(line)
+            if m:
+                isConst = (m.group(0).find("const") <> -1)
+        if isConst:
+            return 0
+        else:
+            return DefaultFuncParamCompare(lines, currentline, rematch, filename)
+    return 0
+
+script.iCompare = consthbufccompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# nonconsttdesc.py
+#
+# Checks : Non-const TDesC& parameter passing.
+#
+# Reason : TDesC& parameters should be passed as a const. If it is 
+# not, it may indicate that the coder does not understand 
+# descriptors, for example, passing descriptors by value.
+#
+# #################################################################
+
+script = CScript("nonconsttdesc")
+script.iReString = """
+    (\(|,)?        # open bracket or preceeding comma
+    \s*            # whitespace
+    (\w+)?
+    \s*            # whitespace
+    (TDesC)
+    \s*            # whitespace
+    &
+    \s*            # whitespace
+    (\w+)          # parameter name
+    (=|\w|\s)*     # optional parameter initialization or whitespace
+    (\)|,)         # close bracket or trailing comma
+    """
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+def consttdesccompare(lines, currentline, rematch, filename):
+    # make sure const TDesC& parameters are skipped
+    line = lines[currentline]
+    m = rematch.search(line)
+    if m:
+        isConst = (m.group(0).find("const") <> -1)
+        while m and isConst:
+            line = line[m.end():]
+            m = rematch.search(line)
+            if m:
+                isConst = (m.group(0).find("const") <> -1)
+        if isConst:
+            return 0
+        else:
+            return DefaultFuncParamCompare(lines, currentline, rematch, filename)
+    return 0
+
+script.iCompare = consttdesccompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# nonleavenew.py
+#
+# Checks : Use of new without (ELeave).
+#
+# Reason : Using new without (ELeave) is only used in special 
+# circumstances. The leaving variant should typically be used in 
+# preference. A common exception is for application creation, 
+# where NULL is returned for failed creation.
+#
+# #################################################################
+
+script = CScript("nonleavenew")
+script.iReString = r"""
+	(=|\(|,)		# equals, open bracket or comma
+	\s*				# optional whitespace
+	new\s+			# "new" plus at least one whitespace char
+	([^\(\s]		# a character other than a bracket
+	.*)
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+currentfilename = ""
+iswindowsfile = 0
+rewindows = re.compile("^\s*#include\s+<(windows|wchar).h>", re.IGNORECASE)
+
+def checkforwindowsinclude(lines, filename):
+	global currentfilename
+	global iswindowsfile
+	global rewindows
+
+	if (currentfilename <> filename):
+		currentfilename = filename
+		iswindowsfile = 0
+		for line in lines:
+			m = rewindows.search(line)
+			if m:
+				iswindowsfile = 1
+				break
+
+	return iswindowsfile
+
+def nonleavenewcompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		if (m.group(2).find("Application") <> -1):
+			return 0
+		else:				
+			return not checkforwindowsinclude(lines, filename)
+
+	return 0
+
+script.iCompare = nonleavenewcompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# nonunicodeskins.py
+#
+# Checks : Non-Unicode skins.
+#
+# Reason : Skin definition files (SKN, SKE) must be Unicode. 
+# Note: Code that causes this issue only needs attention if it is 
+# found in code developed for Nokia Series 90 code.
+#
+# #################################################################
+
+script = CScript("nonunicodeskins")
+script.iReString = r"""
+	^\s*
+	(//|/\*|A-Z|a-z|\#|\[)
+"""
+script.iFileExts = ["skn", "ske"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreNothing
+script.iSeverity = KSeverityLow
+
+def nonunicodecompare(lines, currentline, rematch, filename):
+	return (currentline == 0) and rematch.search(lines[currentline])
+
+script.iCompare = nonunicodecompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# null.py
+#
+# Checks : NULL equality check.
+#
+# Reason : There is no need to compare pointer variables to NULL. 
+# Use If(ptr).
+#
+# #################################################################
+
+script = CScript("null")
+script.iReString = r"""
+	[!=]=\s*NULL
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+def nullcompare(lines, currentline, rematch, filename):
+    # It's OK to compare against NULL in return statement
+    line = lines[currentline]
+    m = rematch.search(line)
+    if m:
+    	if (line.find("return") > -1):
+    		return 0
+    	if (line.find("ASSERT") > -1):
+    		return 0
+    	return 1
+
+    return 0
+
+script.iCompare = nullcompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# open.py
+#
+# Checks : Ignoring Open() return value.
+#
+# Reason : Ignoring the return value from Open() functions 
+# (due to OOM, etc.) means that when the resource is accessed next, 
+# a panic will result.
+#
+# #################################################################
+
+script = CScript("open")
+script.iReString = "^\s*(\w+)(\.|->)Open\s*\("
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCanPanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+reOpenIgnoreStr = ""
+scriptNode = script.ScriptConfig()
+if (scriptNode <> None):
+	for wordNode in scriptNode.getElementsByTagName("openIgnoreRE"):
+		reOpenIgnoreStr = wordNode.firstChild.nodeValue
+		print "Note: ignoring the following objects and classes when checking for open() return value: " + reOpenIgnoreStr
+		break
+if len(reOpenIgnoreStr) > 0:
+	reOpenIgnores = re.compile(reOpenIgnoreStr, re.IGNORECASE)
+else :
+	reOpenIgnores = None
+
+reOpenAssignStr = "=\s+$"
+reOpenAssign = re.compile(reOpenAssignStr, re.IGNORECASE)
+
+def streamcompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		# ignore objects with the word "tream" in object name or object type
+		objectName = m.group(1)
+		if (objectName.find("tream") <> -1):
+			return 0
+		objectType = GetLocalVariableType(lines, currentline, objectName)
+		if (objectType.find("tream") <> -1):
+			return 0
+
+		#ignore objects with either object name or object type on the ignored list
+		if reOpenIgnores:
+			if reOpenIgnores.search(objectName):
+				return 0
+			if reOpenIgnores.search(objectType):
+				return 0
+
+		# look for handler of Open() return value on a different line
+		i = currentline - 1
+		if (i > 0) and (i >= scanner.iCurrentMethodStart):
+			line = lines[i]
+			bracketCount = line.count("(") - line.count(")")
+			if (bracketCount > 0):
+				return 0
+			r = reOpenAssign.search(line)
+			if r:
+				return 0
+		return 1
+	else:
+		return 0
+
+script.iCompare = streamcompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# pointertoarrays.py
+#
+# Checks : Pointer to arrays as members of a C class.
+#
+# Reason : In C classes, there is no need to use pointers to arrays 
+# as data members. Instead, use the arrays themselves. Using 
+# pointers leads to obscure notation like \"(*array)[n]\" for the 
+# more usual \"array[n]\". It also makes it necessary to explicitly 
+# delete the arrays in the destructor. Using the arrays themselves 
+# also simplifies notation, reduces indirection, and reduces heap 
+# fragmentation.
+#
+# #################################################################
+
+script = CScript("pointertoarrays")
+script.iReString = r"""
+	^\s*				# start of line plus optional whitespace
+	[CR]\w*Array\w*		# class name e.g. RPointerArray
+    (|<\w*>)			# optional "<Xxxx>" part
+	\s*\*				# "*" (with optional whitespace)
+	\s*i[A-Z]			# optional whitespace followed by the starting i of the member variable and then a capital letter
+	"""
+script.iFileExts = ["h", "cpp"]
+script.iCategory = KCategoryPerformance
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+def pointerToArraysCompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		if (len(scanner.iCurrentClassName) > 1)  and (scanner.iCurrentClassName[0]=="C"):
+			return 1    # only a problem with C classes
+		else:
+			return 0    
+	else:
+		return 0
+
+script.iCompare = pointerToArraysCompare
+script.iDisplayMethodName = 0
+script.iDisplayClassName = 1
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# pragmadisable.py
+#
+# Checks : Use of #pragma warning.
+#
+# Reason : Disabling warnings can lead to problems, because the 
+# warnings are probably there for a reason.
+#
+# #################################################################
+
+script = CScript("pragmadisable")
+script.iReString = "\#pragma\s+warning"
+script.iFileExts = ["h","cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# pragmamessage.py
+#
+# Checks : Use of #pragma message.
+#
+# Reason : #pragma messages during the build stage can interfere 
+# with the build log parsing.
+#
+# #################################################################
+
+script = CScript("pragmamessage")
+script.iReString = "\#pragma\s+message"
+script.iFileExts = ["h","cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# pragmaother.py
+#
+# Checks : Use of #pragma other than warning and message.
+#
+# Reason : #pragma directives should only be used in very edge 
+# cases (for example, functions consisting of inline assembler 
+# without explicit return statements) because, typically, their 
+# usage masks valid build warnings and error messages.
+#
+# #################################################################
+
+script = CScript("pragmaother")
+script.iReString = "\#pragma\s+[^warning|message]"
+script.iFileExts = ["h","cpp", "c", "inl"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# privateinheritance.py
+#
+# Checks : Use of private inheritance.
+#
+# Reason : Classes should not be inherited privately. If public or 
+# protected inheritance is not appropriate, consider using an 
+# amalgamation; that is, have an object of that type as a 
+# member variable.
+#
+# #################################################################
+
+script = CScript("privateinheritance")
+script.iReString = r"""
+	^\s*				# start of line plus optional whitespace
+	class
+	\s+					# whitespace
+	\w+					# class name
+	\s*					# optional whitespace
+	:
+	(.*)
+	"""
+script.iFileExts = ["cpp", "h"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+def privatecompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		searchtext = m.group(1)
+		if (searchtext.find("private") == -1):
+			return 0
+		else:
+			return 1
+	else:
+		return 0
+
+script.iCompare = privatecompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# pushaddrvar.py
+#
+# Checks : Pushing address of a variable onto the cleanup stack.
+#
+# Reason : If the variable is owned by the code pushing it, it 
+# should be stored as a pointer. If it is not, it should not be 
+# pushed onto the cleanup stack.
+#
+# #################################################################
+
+script = CScript("pushaddrvar")
+script.iReString = r"""
+	::
+	PushL\s*		# "PushL" plus optional whitespace
+	\(				# open bracket
+	\s*				# optional whitespace
+	&				# taking the address?
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCanPanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# pushmember.py
+#
+# Checks : Pushing data members onto the cleanup stack.
+#
+# Reason : Pushing member variables is likely to lead to double 
+# deletes or leakage in certain circumstances and so should be 
+# avoided. Even if no panic can result, it is bad practice and 
+# makes maintenance more difficult.
+#
+# #################################################################
+
+script = CScript("pushmember")
+script.iReString = r"""
+	::
+	PushL\s*		# "PushL" plus optional whitespace
+	\(				# open bracket
+	\s*				# optional whitespace
+	i[A-Z]			# i variable
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCanPanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# readresource.py
+#
+# Checks : Using ReadResource() instead of ReadResourceL().
+#
+# Reason : ReadResourceL() should always be used in preference to 
+# ReadResource() because in an error scenario ReadResource() 
+# effectively fails silently. If no check is performed on the 
+# resulting descriptor afterwards, unexpected states can ensue. 
+# These states are often characterized by buffer overflows.
+#
+# #################################################################
+
+script = CScript("readresource")
+# matching against a line like this: iCoeEnv->ReadResource( buffer, R_RESOURCE_ID );
+script.iReString = r"""
+	^\s*				# start of line plus optional whitespace
+	\w+					# variable name
+	(\.|->)				# "." or "->"
+	ReadResource\s*\(.*\)
+	\s*;
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCanPanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# resourcenotoncleanupstack.py
+#
+# Checks : Neglected to put resource objects on cleanup stack.
+#
+# Reason : If a stack-based resource object is not put on the 
+# cleanup stack with CleanupResetAndDestroyPushL() or 
+# CleanupClosePushL(), and a leaving function or ELeave is called, 
+# a memory leak occurs. CodeScanner occasionally gives false 
+# positives for this issue. Individual cases should be investigated.
+#
+# #################################################################
+
+script = CScript("resourcenotoncleanupstack")
+script.iReString = r"""
+	^\s*					# start of line plus optional whitespace
+	R\w+					# resource type
+	\s*						# optional whitespace
+	(<.*>)?					# optional class in angle brackets
+	\s+						# whitespace
+	(\w+)					# object name
+	\s*						# optional whitespace
+	;
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+cleanupFunction = re.compile("""
+	\s*						# optional whitespace
+	(CleanupClosePushL|CleanupResetAndDestroyPushL)
+	\s*						# optional whitespace
+	\(
+	\s*						# optional whitespace
+	(\w+)					# object name
+	\s*						# optional whitespace
+	\)
+	\s*						# optional whitespace
+	;
+	""", re.VERBOSE)
+
+def resourcecompare(lines, currentline, rematch, filename):
+    m = rematch.search(lines[currentline])
+    if m:
+    	objectName = m.group(2)
+    	bracketdepth = GetBracketDepth(lines, currentline)
+    	i = currentline
+
+    	# search for CleanupClosePushL() or CleanupResetAndDestroyPushL() 
+    	# with the resource object at parameter
+    	while (i < len(lines)):
+    		nextLine = lines[i]
+    		
+    		match = cleanupFunction.search(nextLine)
+    		if (match):
+    			if objectName == match.group(2):
+    				return 0
+
+    		if (nextLine.find('{') >= 0):
+    			bracketdepth = bracketdepth + 1
+    		if (nextLine.find('}') >= 0):
+    			bracketdepth = bracketdepth - 1
+    			if (bracketdepth == 0):
+    				return 1
+
+    		i += 1
+
+	return 0
+
+script.iCompare = resourcecompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# resourcesonheap.py
+#
+# Checks : Resource objects on the heap.
+#
+# Reason : There is very rarely any real need to put R classes on 
+# the heap (unless they are not real R classes!).  Doing so can 
+# lead to inefficiency and cleanup stack problems.
+#
+# #################################################################
+
+script = CScript("resourcesonheap")
+script.iReString = "new\s*(|\(ELeave\))\s+R[A-Z]"
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# returndescriptoroutofscope.py
+#
+# Checks : Return descriptor out of scope.
+#
+# Reason : Returning a TBuf descriptor that is declared locally 
+# takes it out of scope. This can cause a crash on WINSCW, although 
+# not on WINS.
+#
+# #################################################################
+
+script = CScript("returndescriptoroutofscope")
+script.iReString = r"""
+	TBuf
+	\s*
+	<
+	[A-Za-z0-9]+
+	>
+	\s*
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCanPanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+reReturnValue = re.compile("""
+	return
+	\s*
+	""", re.VERBOSE)
+
+reOpenCurlyBracket = re.compile("""
+	{
+	""", re.VERBOSE)
+
+reCloseCurlyBracket = re.compile("""
+	}
+	""", re.VERBOSE)
+
+def finddescriptor(line, descriptor):
+	startindex = line.find(descriptor)
+	if (startindex <> -1):
+		if (line[startindex] == " "):
+			if (line[startindex + len(descriptor)] == ";"):
+				return 1
+	return 0
+
+def returnvaluecompare(lines, currentline, rematch, filename):
+	line = lines[currentline]
+	m = rematch.search(line)
+
+	if m:
+		startindex = line.find(">");
+		endindex = line.find(";");
+
+		if (startindex <> -1):
+			descriptor = line[startindex+1:endindex]
+
+			i = currentline
+			bracketdepth = 1
+			while (i+1 < len(lines)):
+				i = i + 1
+				line2 = lines[i]
+
+				if reReturnValue.search(line2):
+					if (finddescriptor(line2, descriptor)):
+						return 1
+
+				if reOpenCurlyBracket.search(line2):
+					bracketdepth = bracketdepth + 1
+
+				if reCloseCurlyBracket.search(line2):
+					bracketdepth = bracketdepth - 1
+					if (bracketdepth == 0):
+						return 0
+
+	return 0
+
+script.iCompare	= returnvaluecompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# rfs.py
+#
+# Checks : Use of non-pointer/reference RFs.
+#
+# Reason : Connecting to an RFs is a time-consuming operation. 
+# (It can take approximately 0.1 seconds on some devices.) 
+# To minimise wasted time and resources, use the already-connected 
+# one in EikonEnv or elsewhere, if possible.
+#
+# #################################################################
+
+script = CScript("rfs")
+script.iReString = r"""
+	RFs
+	\s+					# at least one whitespace char
+	\w+					# variable name
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# rssnames.py
+#
+# Checks : Duplicate RSS names.
+#
+# Reason : Resource files with clashing NAME fields can cause the 
+# wrong resource file to be accessed. This can lead to incorrect 
+# functionality or panics.
+#
+# #################################################################
+
+script = CScript("rssnames")
+script.iReString = "^\s*NAME\s+(\w+)"
+script.iFileExts = ["rss"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+rssnames = []
+
+def rsscompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		text = m.group(1).lower()
+		shortfilename = filename[filename.rfind("/") + 1:].lower()
+		for pair in rssnames:
+			if (pair[0] == text):
+			 	if (pair[1] == shortfilename):
+					return 0
+				else:
+					scanner.iRendererManager.ReportAnnotation(pair[2])
+					return 1
+
+		rssnames.append([text, shortfilename, filename])
+		return 0
+	else:
+		return 0
+
+script.iCompare = rsscompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# stringliterals.py
+#
+# Checks : Use of _L string literals.
+#
+# Reason : _L() string literals should be replaced by the _LIT() 
+# macro.
+#
+# #################################################################
+
+script = CScript("stringliterals")
+script.iReString = r"""
+	_L
+	(16|8)?			# optional "16" or "8"
+	\(
+	"""
+script.iFileExts = ["h", "cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+def stringliteralscompare(lines, currentline, rematch, filename):
+	if (lines[currentline].find("RDebug::Print(") != -1):
+		return 0
+	else:
+		m = rematch.search(lines[currentline])
+		if m:
+			return 1
+		else:
+			return 0
+
+script.iCompare = stringliteralscompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# stringsinresourcefiles.py
+#
+# Checks : Strings in RSS or RA files.
+#
+# Reason : Strings should not be defined in RSS or RA files. 
+# Instead, they should be put in RLS or other localisable files.
+#
+# #################################################################
+
+script = CScript("stringsinresourcefiles")
+script.iReString = "=\s*\"[^\"]+\""
+script.iFileExts = ["rss", "ra"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreComments
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# struct.py
+#
+# Checks : Use of struct.
+#
+# Reason : C-style structs should not generally be used. 
+# The correct idiom is to use a class with public members. 
+# A permissible use of a C-style struct is if it is used to group 
+# non-semantically related entities together for convenience, and 
+# if a class-related hierarchy would be too heavy-weight.
+#
+# #################################################################
+
+script = CScript("struct")
+script.iReString = "^\s*struct\s*"
+script.iFileExts = ["cpp", "h", "hpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# tcclasses.py
+#
+# Checks : T classes inheriting from C classes.
+#
+# Reason : T classes that are derived from C classes may have a 
+# complex constructor and so need to be handled differently. 
+# It is better to make the T class into a C class, which will make 
+# the code easier to maintain.
+#
+# #################################################################
+
+script = CScript("tcclasses")
+script.iReString = r"""
+	class
+	\s+					# at least one whitespace char
+	(\w+::)?
+	(\w+)				# T class
+	\s*					# optional whitespace
+	:
+	(.*)				# save inheritance text as group 1
+	"""
+script.iFileExts = ["h", "cpp"]
+script.iCategory = KCategoryWrongFunctionality
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+def tcclasscompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		className = m.group(2)
+		if className[0] <> "T" or (len(className) == 1) or not className[1].isupper():
+			return 0
+
+		inheritanceString = m.group(3)
+		i = currentline + 1
+		while (inheritanceString.find("{") == -1) and i < len(lines):
+			if (inheritanceString.find(";") <> -1):
+				return 0
+			inheritanceString += lines[i]
+			i += 1	
+
+		inheritancelist = inheritanceString.split(",")
+		reclass = re.compile("[\s:]*(public|protected|private)?\s*([\w:]+)")
+		classlist = []
+		for inheritance in inheritancelist:
+			match = reclass.search(inheritance)
+			if match:
+				inheritclass = match.group(2)
+				colonpos = inheritclass.rfind(":")
+				if (colonpos <> -1):
+					inheritclass = inheritclass[colonpos + 1:]
+				classlist.append(inheritclass)
+
+		for classname in classlist:
+			if (len(classname) > 2) and classname[0] == "C" and classname[1].isupper():
+				return 1
+	return 0
+
+script.iCompare = tcclasscompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# tclassdestructor.py
+#
+# Checks : T class has destructor.
+#
+# Reason : T classes should not have a destructor.
+#
+# #################################################################
+
+script = CScript("tclassdestructor")
+script.iReString = r"""
+	::
+	\s*				# optional whitespace
+	~T[A-Z]			# destructor
+	"""
+script.iFileExts = ["cpp", "h"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# todocomments.py
+#
+# Checks : "To do" comments.
+#
+# Reason : "To do" comments in code suggest that it is not finished.
+#
+# #################################################################
+
+script = CScript("todocomments")
+script.iReString = r"""
+	/(/|\*)						# "//" or "/*"
+	.*(t|T)(o|O)(d|D)(o|O)		# skip to Todo
+	"""
+script.iFileExts = ["h", "cpp", "c"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreQuotes
+script.iSeverity = KSeverityLow
+
+def todocommentcodecompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		line = lines[currentline]
+		i = 0
+		inCommentBlock = 0
+
+		while i < len(line):
+			if not inCommentBlock:
+				if (line[i] == "/"):
+					if (line[i + 1] == "/"):
+						return 1
+					elif (line[i + 1] == "*"):
+						inCommentBlock = 1
+						i += 2
+						continue
+			else:
+				endIndex = line[i:].find("*/")
+				if (endIndex <> -1):
+					inCommentBlock = 0
+					# note, that first character is ignored in comments as can be direction to the in-source documentation tool
+					if (line[i+1:i + endIndex + 2].lower().find("todo") <> -1):
+						return 1
+					i += endIndex + 2
+					continue
+				else:
+					return 1			
+			i += 1		
+	return 0
+
+script.iCompare = todocommentcodecompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# trapcleanup.py
+#
+# Checks : Use of LC function in TRAPs.
+#
+# Reason : You cannot trap something that leaves something on the 
+# cleanup stack because it will panic.
+#
+# #################################################################
+
+script = CScript("trapcleanup")
+script.iReString = "^\s*TRAPD?"
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryDefinitePanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+reCMethod = re.compile("""
+	\w*
+	[a-z]
+	\w*
+	LC\(
+""", re.VERBOSE)
+
+def trapcleanupcompare(lines, currentline, rematch, filename):
+	line = lines[currentline]
+	m = rematch.search(line)
+	if m:
+		bracketCount = line.count("(") - line.count(")")
+		cMethod = reCMethod.search(line) 
+		pop = line.find("Pop")			
+						 
+		while (bracketCount > 0) and (currentline + 1 < len(lines)):
+			currentline += 1
+			line = lines[currentline]
+			bracketCount += line.count("(") - line.count(")")
+			if not cMethod:
+				cMethod = reCMethod.search(line) 
+			if (pop == -1):
+				pop = line.find("Pop")			
+
+		if cMethod and (pop == -1):
+			return 1
+	
+	return 0
+
+script.iCompare = trapcleanupcompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# trapeleave.py
+#
+# Checks : Trapping new(ELeave).
+#
+# Reason : The trapping of a "new(ELeave) CXxx" call is redundant 
+# and wasteful as the code to support TRAP is surprisingly large. 
+# If the instantiation process really needs not to leave, use 
+# "new CXxx" and check for NULL.
+#
+# #################################################################
+
+script = CScript("trapeleave")
+script.iReString = "^\s*TRAPD?"
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryPerformance
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+reELeave = re.compile("""
+    new
+    \s*        # whitespace
+    \(         # open bracket
+    \s*        # whitespace
+    ELeave
+    \s*        # whitespace
+    \)         # close bracket
+""", re.VERBOSE)
+
+def trapeleavecompare(lines, currentline, rematch, filename):
+    line = lines[currentline]
+    m = rematch.search(line)
+    if m:
+        if (line.find("(") == -1) and (currentline + 1 < len(lines)):
+            currentline += 1
+            line = lines[currentline]
+
+        bracketCount = line.count("(") - line.count(")")
+        found = reELeave.search(line) 
+
+        while (bracketCount > 0) and (currentline + 1 < len(lines)):
+            currentline += 1
+            line = lines[currentline]
+            bracketCount += line.count("(") - line.count(")")
+            if not found:
+                found = reELeave.search(line) 
+
+        if found:
+            return 1
+
+    return 0
+
+script.iCompare = trapeleavecompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# traprunl.py
+#
+# Checks : Trapping of (Do)RunL() rather than using RunError().
+#
+# Reason : The RunError() function should be used rather than the 
+# CActive derivative using its own TRAPD solution within a RunL().
+#
+# #################################################################
+
+script = CScript("traprunl")
+script.iReString = "^\s*TRAPD?"
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+reRunL = re.compile("""
+    RunL
+    \s*        # whitespace
+    \(         # open bracket
+""", re.VERBOSE)
+
+def traprunlcompare(lines, currentline, rematch, filename):
+    line = lines[currentline]
+    m = rematch.search(line)
+    if m:
+        if (line.find("(") == -1) and (currentline + 1 < len(lines)):
+            currentline += 1
+            line = lines[currentline]
+
+        bracketCount = line.count("(") - line.count(")")
+        found = reRunL.search(line) 
+
+        while (bracketCount > 0) and (currentline + 1 < len(lines)):
+            currentline += 1
+            line = lines[currentline]
+            bracketCount += line.count("(") - line.count(")")
+            if not found:
+                found = reRunL.search(line) 
+
+        if found:
+            return 1
+
+    return 0
+
+script.iCompare = traprunlcompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# trspassing.py
+#
+# Checks : Passing TRequestStatus parameters by value.
+#
+# Reason : TRequestStatus parameters should be passed by reference. 
+# If TRequestStatus is just being used as an error code, then 
+# convert it to a TInt.
+#
+# #################################################################
+
+script = CScript("trspassing")
+script.iReString = r"""
+    (\(|,)?				# open bracket or preceeding comma
+    \s*					# whitespace
+	TRequestStatus
+    \s*					# whitespace
+	[^&*]				# matches any character except '&' and '*'
+    \s*					# whitespace
+	(\w+)				# parameter name
+    (=|\w|\s)*          # optional parameter initialization or whitespace
+    (\)|,)				# close bracket or trailing comma
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryWrongFunctionality
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+script.iCompare = DefaultFuncParamCompare
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# uids.py
+#
+# Checks : Duplicate UIDs.
+#
+# Reason : UIDs must be unique.
+#
+# #################################################################
+
+script = CScript("uids")
+script.iReString = r"""
+	^\s*			# whitespace
+	[Uu][Ii][Dd]	# uid			
+	\s+				# at least one whitespace char
+	\w+
+	\s+				# at least one whitespace char
+	(\w+)
+	"""
+script.iFileExts = ["mmp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+uids = []
+
+def uidcompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		text = m.group(1).lower()
+		shortfilename = filename[filename.rfind("/") + 1:].lower()
+		for pair in uids:
+			if (pair[0] == text):
+			 	if (pair[1] == shortfilename):
+					return 0
+				else:
+					scanner.iRendererManager.ReportAnnotation(pair[2])
+					return 1
+
+		uids.append([text, shortfilename, filename])
+		return 0
+	else:
+		return 0
+
+script.iCompare = uidcompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# uncompressedaif.py
+#
+# Checks : Uncompressed AIFs in ROM.
+#
+# Reason : AIF files should be referenced as "AIF=" rather than 
+# "data=" or "file=" otherwise they can bloat the ROM size and 
+# slow down application loading.
+#
+# #################################################################
+
+script = CScript("uncompressedaif")
+script.iReString = r"""
+			(
+			^
+			\s*
+			(data|file)
+			\s*
+			=
+			.*
+			\.aif
+			)
+			"""
+script.iFileExts = ["iby", "hby", "oby"]
+script.iCategory = KCategoryPerformance
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# uncompressedbmp.py
+#
+# Checks : Uncompressed bitmaps in ROM.
+#
+# Reason : Using uncompressed bitmaps can significantly bloat the 
+# size of ROM images. All occurrences of "bitmap=" in iby/hby files 
+# should be replaced with "auto-bitmap=". Also, including bitmaps 
+# using "data=" or "file=" causes bloat and load-speed reductions.
+#
+# #################################################################
+
+script = CScript("uncompressedbmp")
+script.iReString = r"""
+			(
+
+			^
+			\s*
+			bitmap
+			\s*
+			=
+			
+			|
+
+			^
+			\s*
+			(data|file)
+			\s*
+			=
+			.*
+			\.mbm
+			)
+			"""
+script.iFileExts = ["iby", "hby", "oby"]
+script.iCategory = KCategoryPerformance
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# unicodesource.py
+#
+# Checks : Unicode source files.
+#
+# Reason : Having Unicode source files (CPP, H, RLS, LOC, RSS, and 
+# RA) will break most build systems.
+#
+# #################################################################
+
+script = CScript("unicodesource")
+script.iReString = r"""
+	^
+	\xFF\xFE	
+	"""
+script.iFileExts = ["cpp", "h", "rls", "loc", "rss", "ra"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+def unicodesourcecompare(lines, currentline, rematch, filename):
+	return (currentline == 0) and rematch.search(lines[currentline])
+
+script.iCompare = unicodesourcecompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# userafter.py
+#
+# Checks : Use of User::After.
+#
+# Reason : Generally, User::After() functions are used to skirt 
+# around timing problems. Typically, they should be removed and the 
+# defects fixed properly: that is, by waiting for the correct event 
+# to continue execution.
+#
+# #################################################################
+
+script = CScript("userafter")
+script.iReString = "User::After\s*\("
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryPerformance
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# userfree.py
+#
+# Checks : Using User::Free directly.
+#
+# Reason : User::Free() should never be called, because all objects 
+# free their memory on deletion; their destructors are not called 
+# and further resources cannot be freed or closed. This function 
+# should be removed and replaced by explicit deletes.
+#
+# #################################################################
+
+script = CScript("userfree")
+script.iReString = "User::Free\s*\("
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# userWaitForRequest.py
+#
+# Checks : Use of User::WaitForRequest.
+#
+# Reason : User::WaitForRequest() should not generally be used in 
+# UI code because the UI will not respond to redraw events while 
+# its thread is stopped.
+#
+# #################################################################
+
+script = CScript("userWaitForRequest")
+script.iReString = "User::WaitForRequest\s*\(\s*"
+script.iFileExts = ["cpp","inl"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# variablenames.py
+#
+# Checks : Local variables with member/argument names.
+#
+# Reason : Local variable names should be of the form localVariable 
+# and not aLocalVar or iLocalVar. Badly-named variables can be 
+# misleading and cause maintenance and coding errors.
+#
+# #################################################################
+
+script = CScript("variablenames")
+script.iReString = r"""
+	^\s*				# start of line plus optional whitespace
+	[A-Z]\w*			# class name e.g. TInt, CActive
+	\s*[\*&\s]\s*		# optional "*" or "&" plus at least one whitespace char
+	[ai][A-Z]\w*\s*		# a or i variable name plus optional whitespace
+	[;\(=]				# ";" or "(" or "="
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+def bracecompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		checkline = currentline - 1
+		bracecount = 1
+		while (bracecount > 0) and (checkline >= 0):
+			bracecount -= lines[checkline].count("{")
+			bracecount += lines[checkline].count("}")
+			checkline -= 1
+
+		while (bracecount == 0) and (checkline >= 0):
+			if (lines[checkline].upper().find("CLASS") <> -1) or (lines[checkline].upper().find("STRUCT") <> -1):
+				return 0
+			
+			bracecount -= lines[checkline].count("{")
+			bracecount += lines[checkline].count("}")
+			checkline -= 1
+
+		return 1
+	else:
+		return 0
+
+script.iCompare = bracecompare
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# voidparameter.py
+#
+# Checks : Void parameter explicitly declared.
+#
+# Reason : Declaring a void parameter is unnecessary. A function 
+# declared as DoSomething(void) may as well be declared as 
+# DoSomething(). Void casts are also unnecessary.
+#
+# #################################################################
+
+script = CScript("voidparameter")
+script.iReString = r"""
+	\(				# opening bracket
+	\s*				# optional whitespace
+	void			# void paramater declaration
+	\s*				# optional whitespace
+	\)				# closing bracket
+	.*;				# skip to semicolon
+	"""
+script.iFileExts = ["h", "cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# worryingcomments.py
+#
+# Checks : Worrying comments.
+#
+# Reason : Typically, exclamation and question marks in comments 
+# indicate that something odd is in the code or that it is 
+# unfinished or not understood fully.
+#
+# #################################################################
+
+script = CScript("worryingcomments")
+script.iFileExts = ["h", "cpp", "c"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreQuotes
+script.iSeverity = KSeverityLow
+
+reWordsStr = r"""\!|\?|[Zz]{3}|kludge|workaround|\scrap|hack"""
+scriptNode = script.ScriptConfig()
+if (scriptNode <> None):
+	for wordNode in scriptNode.getElementsByTagName("worryRE"):
+		reWordsStr = wordNode.firstChild.nodeValue
+		print "Note: 'worrying comments' pattern configured as: " + reWordsStr
+		break
+script.iReString = r"""
+	/(/|\*)						# "//" or "/*"
+	.*("""+reWordsStr+r""")		# skip to "!", "?", "zzz", "kludge", "workaround", " crap" or "hack"
+	"""
+
+def worryingcommentcodecompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		line = lines[currentline]
+		i = 0
+		inCommentBlock = 0
+
+		while i < len(line):
+			if not inCommentBlock:
+				if (line[i] == "/"):
+					if (line[i + 1] == "/"):
+						# note i+3 to bypass the character after the start of the comment as can be an in-source documentation directive
+						return (line[i+3:].find("!")<>-1) or (line[i+3:].find("?")<>-1)
+					elif (line[i + 1] == "*"):
+						inCommentBlock = 1
+						i += 2
+						continue
+			else:
+				endIndex = line[i:].find("*/")
+				if (endIndex <> -1):
+					inCommentBlock = 0
+					# note, that first character is ignored in comments as can be direction to the in-source documentation tool
+					if (line[i+1:i + endIndex + 2].find("!") <> -1) or (line[i+1:i + endIndex + 2].find("?") <> -1):
+						return 1
+					i += endIndex + 2
+					continue
+				else:
+					return 1			
+			i += 1		
+	return 0
+
+script.iCompare = worryingcommentcodecompare
+scanner.AddScript(script)
+
+#!PARSE
+
+if (scanner.iVerbose):
+	scanner.iCategoriedScripts.PrintListOfTestScripts()
+	scanner.iRendererManager.PrintListOfRenderers()
+
+print
+print "Scanning inititated : " + scanner.iStartTime
+
+if scanner.iInputFilenames <> "":
+	scanner.iComponentManager.iUseFullComponentPath = True
+	#additional input files
+	inputFiles = scanner.iInputFilenames.split("::")
+	for inputFile in inputFiles:
+		if inputFile <> "":
+			ScanDirOrFile(inputFile)
+
+argument = args[0]
+ScanDirOrFile(argument)
+
+print "Scanning finished   : " + scanner.iEndTime
+scanner.iLog.Close()
+
+if (scanner.iDomConfig <> None):
+	scanner.iDomConfig.unlink()
+
+sys.exit(0)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/codescanner.spec	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,16 @@
+a = Analysis([os.path.join(HOMEPATH,'support\\_mountzlib.py'), os.path.join(HOMEPATH,'support\\useUnicode.py'), 'codescanner.py'],
+             pathex=['S:\\codescanner'])
+pyz = PYZ(a.pure)
+exe = EXE(pyz,
+          a.scripts,
+          exclude_binaries=1,
+          name='buildcodescanner/codescanner.exe',
+          debug=False,
+          strip=False,
+          upx=False,
+          console=True )
+coll = COLLECT( exe,
+               a.binaries,
+               strip=False,
+               upx=False,
+               name='distcodescanner')
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/config.bat	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,18 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem 
+@rem Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+@rem 
+@rem * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+@rem * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+@rem * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+@rem 
+@rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+@rem THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+@rem BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+@rem SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+@rem CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.@rem
+@rem
+
+python pyinstaller/configure.py
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/cs_config.xml	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,166 @@
+<!-- This is a configuration file for Codescanner from Nokia. -->
+<codescannerConfig>
+
+	<sources>
+		<!-- source files matching any of the exclude patterns below will not be scanned -->
+
+		<!-- binary files -->
+		<exclude>.*\.au</exclude>
+		<exclude>.*\.avi</exclude>
+		<exclude>.*\.bmp</exclude>
+		<exclude>.*\.dll</exclude>
+		<exclude>.*\.doc</exclude>
+		<exclude>.*\.exe</exclude>
+		<exclude>.*\.gif</exclude>
+		<exclude>.*\.jpg</exclude>
+		<exclude>.*\.mbm</exclude>
+		<exclude>.*\.mp3</exclude>
+		<exclude>.*\.mpg</exclude>
+		<exclude>.*\.png</exclude>
+		<exclude>.*\.raw</exclude>
+		<exclude>.*\.rtf</exclude>
+		<exclude>.*\.tif</exclude>
+		<exclude>.*\.wav</exclude>
+		<exclude>.*\.wbmp</exclude>
+		<exclude>.*\.wmf</exclude>
+		<exclude>.*\.xls</exclude>
+	</sources>
+
+	<scripts>
+		<!-- Every element in this section corresponds to a Codescanner script -->
+		<!-- Every element has the following common attributes: -->
+		<!--    enable="true" or "false" -->
+		<!-- Some scripts have additional attributes or elements. -->
+
+		<accessArrayElementWithoutCheck enable="true"/>
+		<accessArrayElementWithoutCheck2 enable="true"/>
+		<activestart enable="true"/>
+		<activestop enable="true"/>
+		<arraypassing enable="true"/>
+		<arrayptrcleanup enable="true"/>
+		<assertdebuginvariant enable="true"/>
+		<baddefines enable="true"/>
+		<baseconstruct enable="true"/>
+		<callActiveObjectWithoutCheckingOrStopping enable="true"/>
+		<changenotification enable="true"/>
+		<cleanup enable="true"/>
+		<commentcode enable="true"/>
+		<connect enable="true"/>
+		<ConnectAndDontCloseMemberVariable enable="true"/>
+		<constnames enable="true"/>
+		<consttdescptr enable="true"/>
+		<controlornull enable="true"/>
+		<ctltargettype enable="true"/>
+		<debugrom enable="true"/>
+		<declarename enable="true"/>
+		<deleteMemberVariable enable="true"/>
+		<destructor enable="true"/>
+		<doubleSemiColon enable="true"/>
+		<driveletters enable="true"/>
+		<eikbuttons enable="true"/>
+		<eikonenvstatic enable="true"/>
+		<enummembers enable="true"/>
+		<enumnames enable="true"/>
+		<exportinline enable="true"/>
+		<exportpurevirtual enable="true"/>
+		<externaldriveletters enable="true"/>
+		<foff enable="true"/>
+		<forbiddenwords enable="true">
+			<!-- the following regular expression specifies the forbidden words detected by this script -->
+			<wordsRE>Typhoon|Hurricane|HelloWorld|Calypso|Rubik|Epoc|Nokia Mobile Phones|NMP|Mobile Innovation|(^|\s)S90|(^|\s)S80|(^|\s)S60</wordsRE>
+		</forbiddenwords>
+		<forgottoputptroncleanupstack enable="true"/>
+		<friend enable="true"/>
+		<goto enable="true"/>
+		<ifassignments enable="true"/>
+		<ifpreprocessor enable="true"/>
+		<intleaves enable="true"/>
+		<jmp enable="true"/>
+		<leave enable="true"/>
+		<LeaveNoError enable="true"/>
+		<leavingoperators enable="true"/>
+		<LFunctionCantLeave enable="true"/>
+		<!-- the length attribute specifies the largest number of characters permitted by this script -->
+		<longlines enable="true" length="160" />
+		<magicnumbers enable="true"/>
+		<mclassdestructor enable="true"/>
+		<memberlc enable="true"/>
+		<membervariablecallld enable="true"/>
+		<missingcclass enable="true"/>
+		<mmpsourcepath enable="true"/>
+		<multilangrsc enable="true"/>
+		<multipledeclarations enable="true"/>
+		<multipleinheritance enable="true"/>
+		<mydocs enable="true"/>
+		<namespace enable="true"/>
+		<newlreferences enable="true"/>
+		<noleavetrap enable="true"/>
+		<nonconsthbufc enable="true"/>
+		<nonconsttdesc enable="true"/>
+		<nonleavenew enable="true"/>
+		<nonunicodeskins enable="true"/>
+		<null enable="true"/>
+		<open enable="true"/>
+		<pointertoarrays enable="true"/>
+		<pragmadisable enable="true"/>
+		<pragmamessage enable="true"/>
+		<pragmaother enable="true"/>
+		<privateinheritance enable="true"/>
+		<pushaddrvar enable="true"/>
+		<pushmember enable="true"/>
+		<readresource enable="true"/>
+		<resourcesonheap enable="true"/>
+		<returndescriptoroutofscope enable="true"/>
+		<rfs enable="true"/>
+		<rssnames enable="true"/>
+		<stringliterals enable="true"/>
+		<stringsinresourcefiles enable="true"/>
+		<struct enable="true"/>
+		<tcclasses enable="true"/>
+		<tclassdestructor enable="true"/>
+		<todocomments enable="true"/>
+		<trapcleanup enable="true"/>
+		<trapeleave enable="true"/>
+		<traprunl enable="true"/>
+		<trspassing enable="true"/>
+		<uids enable="true"/>
+		<uncompressedaif enable="true"/>
+		<uncompressedbmp enable="true"/>
+		<unicodesource enable="true"/>
+		<userafter enable="true"/>
+		<userfree enable="true"/>
+		<userWaitForRequest enable="true"/>
+		<variablenames enable="true"/>
+		<voidparameter enable="true"/>
+		<worryingcomments enable="true">
+			<!-- the following regular expression specifies the worrying comments detected by this script -->
+			<worryRE>\!|\?|[Zz]{3}|kludge|workaround|\scrap|hack</worryRE>
+		</worryingcomments>
+	</scripts>
+
+	<severities>
+		<!-- Group scripts based on severity level: -->
+		<!--    enable="true" or "false" -->
+
+		<high enable="true"/>
+		<medium enable="true"/>
+		<low enable="true"/>
+	</severities>
+
+	<categories>
+		<!-- Group scripts based on category: -->
+		<!--    enable="true" or "false" -->
+
+		<legal enable="true"/>
+		<panic enable="true"/>
+		<canpanic enable="true"/>
+		<functionality enable="true"/>
+		<localisation enable="true"/>
+		<performance enable="true"/>
+		<codingstandards enable="true"/>
+		<documentation enable="true"/>
+		<codereview enable="true"/>
+		<other enable="true"/>
+	</categories>
+
+</codescannerConfig>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/cs_version.rc	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,51 @@
+/*********************************************
+File: C:\WORKSPACE\CODE_SCANNER\NOKIA_VERSION\CS_VERSION.RC
+Generated by Resource Builder (2.6.1.1).
+*********************************************/
+/*
+OutputExt=res
+*/
+
+//MS Visual C++ compatible header
+#define APSTUDIO_READONLY_SYMBOLS
+#include "afxres.h"
+#undef APSTUDIO_READONLY_SYMBOLS
+//end of MS Visual C++ compatible header
+
+// Version Info
+1 VERSIONINFO
+FILEVERSION 2,0,1,0
+PRODUCTVERSION 
+FILEOS VOS_UNKNOWN
+FILETYPE VFT_APP
+{
+ BLOCK "StringFileInfo"
+  {
+  BLOCK "040904E4"
+   {
+VALUE "CompanyName", "Nokia Corporation"
+
+VALUE "FileVersion", "2.0.1a"
+
+VALUE "FileDescription", "Nokia CodeScanner CLI"
+
+VALUE "InternalName", "CodeScanner"
+
+VALUE "LegalCopyright", "Copyright (C) 2007, Nokia Corporation. All rights reserved."
+
+VALUE "LegalTrademarks", "Nokia CodeScanner"
+
+VALUE "OriginalFilename", "CodeScanner.exe"
+
+VALUE "ProductName", "Nokia CodeScanner"
+
+VALUE "ProductVersion", " 2.0.1a"
+
+   }
+  }
+ BLOCK "VarFileInfo"
+ {
+  VALUE "Translation", 1033, 1252
+ }
+}
+
Binary file srcanamdw/codescanner/cs_version.res has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/distcodescanner/MIT_license.txt	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,13 @@
+
+Copyright 1991 by the Massachusetts Institute of Technology
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation, and that the name of M.I.T. not be used in advertising or
+publicity pertaining to distribution of the software without specific,
+written prior permission.  M.I.T. makes no representations about the
+suitability of this software for any purpose.  It is provided "as is"
+without express or implied warranty.
+
Binary file srcanamdw/codescanner/distcodescanner/MSVCR71.dll has changed
Binary file srcanamdw/codescanner/distcodescanner/_hashlib.pyd has changed
Binary file srcanamdw/codescanner/distcodescanner/_socket.pyd has changed
Binary file srcanamdw/codescanner/distcodescanner/_ssl.pyd has changed
Binary file srcanamdw/codescanner/distcodescanner/bz2.pyd has changed
Binary file srcanamdw/codescanner/distcodescanner/codescanner.exe has changed
Binary file srcanamdw/codescanner/distcodescanner/psyco._psyco.pyd has changed
Binary file srcanamdw/codescanner/distcodescanner/pyexpat.pyd has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/distcodescanner/python 2_5_1 licenses.txt	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,2006 @@
+Copyright 1995-1996 by Fred L. Drake, Jr., Reston, Virginia, USA, and
+Virginia Polytechnic Institute and State University, Blacksburg,
+Virginia, USA.  Portions of the software copyright 1991-1995 by
+Stichting Mathematisch Centrum, Amsterdam, The Netherlands.  Copying is
+permitted under the terms associated with the main Python distribution,
+with the additional restriction that this additional notice be included
+and maintained on all distributed copies.
+
+                        All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the names of Fred L. Drake, Jr. and
+Virginia Polytechnic Institute and State University not be used in
+advertising or publicity pertaining to distribution of the software
+without specific, written prior permission.
+
+FRED L. DRAKE, JR. AND VIRGINIA POLYTECHNIC INSTITUTE AND STATE
+UNIVERSITY DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+EVENT SHALL FRED L. DRAKE, JR. OR VIRGINIA POLYTECHNIC INSTITUTE AND
+STATE UNIVERSITY BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+
+--
+
+Copyright notice
+================
+
+The Python source is copyrighted, but you can freely use and copy it
+as long as you don't change or remove the copyright notice:
+
+----------------------------------------------------------------------
+Copyright (c) 2000-2007 Python Software Foundation.
+All rights reserved.
+
+Copyright (c) 2000 BeOpen.com.
+All rights reserved.
+
+Copyright (c) 1995-2000 Corporation for National Research Initiatives.
+All rights reserved.
+
+Copyright (c) 1991-1995 Stichting Mathematisch Centrum.
+All rights reserved.
+
+See the file "commontex/license.tex" for information on usage and
+redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+----------------------------------------------------------------------
+
+--
+\section{History of the software}
+
+Python was created in the early 1990s by Guido van Rossum at Stichting
+Mathematisch Centrum (CWI, see \url{http://www.cwi.nl/}) in the Netherlands
+as a successor of a language called ABC.  Guido remains Python's
+principal author, although it includes many contributions from others.
+
+In 1995, Guido continued his work on Python at the Corporation for
+National Research Initiatives (CNRI, see \url{http://www.cnri.reston.va.us/})
+in Reston, Virginia where he released several versions of the
+software.
+
+In May 2000, Guido and the Python core development team moved to
+BeOpen.com to form the BeOpen PythonLabs team.  In October of the same
+year, the PythonLabs team moved to Digital Creations (now Zope
+Corporation; see \url{http://www.zope.com/}).  In 2001, the Python
+Software Foundation (PSF, see \url{http://www.python.org/psf/}) was
+formed, a non-profit organization created specifically to own
+Python-related Intellectual Property.  Zope Corporation is a
+sponsoring member of the PSF.
+
+All Python releases are Open Source (see
+\url{http://www.opensource.org/} for the Open Source Definition).
+Historically, most, but not all, Python releases have also been
+GPL-compatible; the table below summarizes the various releases.
+
+\begin{tablev}{c|c|c|c|c}{textrm}%
+  {Release}{Derived from}{Year}{Owner}{GPL compatible?}
+  \linev{0.9.0 thru 1.2}{n/a}{1991-1995}{CWI}{yes}
+  \linev{1.3 thru 1.5.2}{1.2}{1995-1999}{CNRI}{yes}
+  \linev{1.6}{1.5.2}{2000}{CNRI}{no}
+  \linev{2.0}{1.6}{2000}{BeOpen.com}{no}
+  \linev{1.6.1}{1.6}{2001}{CNRI}{no}
+  \linev{2.1}{2.0+1.6.1}{2001}{PSF}{no}
+  \linev{2.0.1}{2.0+1.6.1}{2001}{PSF}{yes}
+  \linev{2.1.1}{2.1+2.0.1}{2001}{PSF}{yes}
+  \linev{2.2}{2.1.1}{2001}{PSF}{yes}
+  \linev{2.1.2}{2.1.1}{2002}{PSF}{yes}
+  \linev{2.1.3}{2.1.2}{2002}{PSF}{yes}
+  \linev{2.2.1}{2.2}{2002}{PSF}{yes}
+  \linev{2.2.2}{2.2.1}{2002}{PSF}{yes}
+  \linev{2.2.3}{2.2.2}{2002-2003}{PSF}{yes}
+  \linev{2.3}{2.2.2}{2002-2003}{PSF}{yes}
+  \linev{2.3.1}{2.3}{2002-2003}{PSF}{yes}
+  \linev{2.3.2}{2.3.1}{2003}{PSF}{yes}
+  \linev{2.3.3}{2.3.2}{2003}{PSF}{yes}
+  \linev{2.3.4}{2.3.3}{2004}{PSF}{yes}
+  \linev{2.3.5}{2.3.4}{2005}{PSF}{yes}
+  \linev{2.4}{2.3}{2004}{PSF}{yes}
+  \linev{2.4.1}{2.4}{2005}{PSF}{yes}
+  \linev{2.4.2}{2.4.1}{2005}{PSF}{yes}
+  \linev{2.4.3}{2.4.2}{2006}{PSF}{yes}
+  \linev{2.5}{2.4}{2006}{PSF}{yes}
+  \linev{2.5.1}{2.5}{2007}{PSF}{yes}
+\end{tablev}
+
+\note{GPL-compatible doesn't mean that we're distributing
+Python under the GPL.  All Python licenses, unlike the GPL, let you
+distribute a modified version without making your changes open source.
+The GPL-compatible licenses make it possible to combine Python with
+other software that is released under the GPL; the others don't.}
+
+Thanks to the many outside volunteers who have worked under Guido's
+direction to make these releases possible.
+
+
+\section{Terms and conditions for accessing or otherwise using Python}
+
+\centerline{\strong{PSF LICENSE AGREEMENT FOR PYTHON \version}}
+
+\begin{enumerate}
+\item
+This LICENSE AGREEMENT is between the Python Software Foundation
+(``PSF''), and the Individual or Organization (``Licensee'') accessing
+and otherwise using Python \version{} software in source or binary
+form and its associated documentation.
+
+\item
+Subject to the terms and conditions of this License Agreement, PSF
+hereby grants Licensee a nonexclusive, royalty-free, world-wide
+license to reproduce, analyze, test, perform and/or display publicly,
+prepare derivative works, distribute, and otherwise use Python
+\version{} alone or in any derivative version, provided, however, that
+PSF's License Agreement and PSF's notice of copyright, i.e.,
+``Copyright \copyright{} 2001-2006 Python Software Foundation; All
+Rights Reserved'' are retained in Python \version{} alone or in any
+derivative version prepared by Licensee.
+
+\item
+In the event Licensee prepares a derivative work that is based on
+or incorporates Python \version{} or any part thereof, and wants to
+make the derivative work available to others as provided herein, then
+Licensee hereby agrees to include in any such work a brief summary of
+the changes made to Python \version.
+
+\item
+PSF is making Python \version{} available to Licensee on an ``AS IS''
+basis.  PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
+IMPLIED.  BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON \version{} WILL
+NOT INFRINGE ANY THIRD PARTY RIGHTS.
+
+\item
+PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
+\version{} FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR
+LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON
+\version, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE
+POSSIBILITY THEREOF.
+
+\item
+This License Agreement will automatically terminate upon a material
+breach of its terms and conditions.
+
+\item
+Nothing in this License Agreement shall be deemed to create any
+relationship of agency, partnership, or joint venture between PSF and
+Licensee.  This License Agreement does not grant permission to use PSF
+trademarks or trade name in a trademark sense to endorse or promote
+products or services of Licensee, or any third party.
+
+\item
+By copying, installing or otherwise using Python \version, Licensee
+agrees to be bound by the terms and conditions of this License
+Agreement.
+\end{enumerate}
+
+
+\centerline{\strong{BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0}}
+
+\centerline{\strong{BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1}}
+
+\begin{enumerate}
+\item
+This LICENSE AGREEMENT is between BeOpen.com (``BeOpen''), having an
+office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the
+Individual or Organization (``Licensee'') accessing and otherwise
+using this software in source or binary form and its associated
+documentation (``the Software'').
+
+\item
+Subject to the terms and conditions of this BeOpen Python License
+Agreement, BeOpen hereby grants Licensee a non-exclusive,
+royalty-free, world-wide license to reproduce, analyze, test, perform
+and/or display publicly, prepare derivative works, distribute, and
+otherwise use the Software alone or in any derivative version,
+provided, however, that the BeOpen Python License is retained in the
+Software, alone or in any derivative version prepared by Licensee.
+
+\item
+BeOpen is making the Software available to Licensee on an ``AS IS''
+basis.  BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
+IMPLIED.  BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND
+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT
+INFRINGE ANY THIRD PARTY RIGHTS.
+
+\item
+BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE
+SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS
+AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY
+DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
+
+\item
+This License Agreement will automatically terminate upon a material
+breach of its terms and conditions.
+
+\item
+This License Agreement shall be governed by and interpreted in all
+respects by the law of the State of California, excluding conflict of
+law provisions.  Nothing in this License Agreement shall be deemed to
+create any relationship of agency, partnership, or joint venture
+between BeOpen and Licensee.  This License Agreement does not grant
+permission to use BeOpen trademarks or trade names in a trademark
+sense to endorse or promote products or services of Licensee, or any
+third party.  As an exception, the ``BeOpen Python'' logos available
+at http://www.pythonlabs.com/logos.html may be used according to the
+permissions granted on that web page.
+
+\item
+By copying, installing or otherwise using the software, Licensee
+agrees to be bound by the terms and conditions of this License
+Agreement.
+\end{enumerate}
+
+
+\centerline{\strong{CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1}}
+
+\begin{enumerate}
+\item
+This LICENSE AGREEMENT is between the Corporation for National
+Research Initiatives, having an office at 1895 Preston White Drive,
+Reston, VA 20191 (``CNRI''), and the Individual or Organization
+(``Licensee'') accessing and otherwise using Python 1.6.1 software in
+source or binary form and its associated documentation.
+
+\item
+Subject to the terms and conditions of this License Agreement, CNRI
+hereby grants Licensee a nonexclusive, royalty-free, world-wide
+license to reproduce, analyze, test, perform and/or display publicly,
+prepare derivative works, distribute, and otherwise use Python 1.6.1
+alone or in any derivative version, provided, however, that CNRI's
+License Agreement and CNRI's notice of copyright, i.e., ``Copyright
+\copyright{} 1995-2001 Corporation for National Research Initiatives;
+All Rights Reserved'' are retained in Python 1.6.1 alone or in any
+derivative version prepared by Licensee.  Alternately, in lieu of
+CNRI's License Agreement, Licensee may substitute the following text
+(omitting the quotes): ``Python 1.6.1 is made available subject to the
+terms and conditions in CNRI's License Agreement.  This Agreement
+together with Python 1.6.1 may be located on the Internet using the
+following unique, persistent identifier (known as a handle):
+1895.22/1013.  This Agreement may also be obtained from a proxy server
+on the Internet using the following URL:
+\url{http://hdl.handle.net/1895.22/1013}.''
+
+\item
+In the event Licensee prepares a derivative work that is based on
+or incorporates Python 1.6.1 or any part thereof, and wants to make
+the derivative work available to others as provided herein, then
+Licensee hereby agrees to include in any such work a brief summary of
+the changes made to Python 1.6.1.
+
+\item
+CNRI is making Python 1.6.1 available to Licensee on an ``AS IS''
+basis.  CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
+IMPLIED.  BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND
+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT
+INFRINGE ANY THIRD PARTY RIGHTS.
+
+\item
+CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
+1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
+A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1,
+OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
+
+\item
+This License Agreement will automatically terminate upon a material
+breach of its terms and conditions.
+
+\item
+This License Agreement shall be governed by the federal
+intellectual property law of the United States, including without
+limitation the federal copyright law, and, to the extent such
+U.S. federal law does not apply, by the law of the Commonwealth of
+Virginia, excluding Virginia's conflict of law provisions.
+Notwithstanding the foregoing, with regard to derivative works based
+on Python 1.6.1 that incorporate non-separable material that was
+previously distributed under the GNU General Public License (GPL), the
+law of the Commonwealth of Virginia shall govern this License
+Agreement only as to issues arising under or with respect to
+Paragraphs 4, 5, and 7 of this License Agreement.  Nothing in this
+License Agreement shall be deemed to create any relationship of
+agency, partnership, or joint venture between CNRI and Licensee.  This
+License Agreement does not grant permission to use CNRI trademarks or
+trade name in a trademark sense to endorse or promote products or
+services of Licensee, or any third party.
+
+\item
+By clicking on the ``ACCEPT'' button where indicated, or by copying,
+installing or otherwise using Python 1.6.1, Licensee agrees to be
+bound by the terms and conditions of this License Agreement.
+\end{enumerate}
+
+\centerline{ACCEPT}
+
+
+
+\centerline{\strong{CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2}}
+
+Copyright \copyright{} 1991 - 1995, Stichting Mathematisch Centrum
+Amsterdam, The Netherlands.  All rights reserved.
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Stichting Mathematisch
+Centrum or CWI not be used in advertising or publicity pertaining to
+distribution of the software without specific, written prior
+permission.
+
+STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
+THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
+FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+\section{Licenses and Acknowledgements for Incorporated Software}
+
+This section is an incomplete, but growing list of licenses and
+acknowledgements for third-party software incorporated in the
+Python distribution.
+
+
+\subsection{Mersenne Twister}
+
+The \module{_random} module includes code based on a download from
+\url{http://www.math.keio.ac.jp/~matumoto/MT2002/emt19937ar.html}.
+The following are the verbatim comments from the original code:
+
+\begin{verbatim}
+A C-program for MT19937, with initialization improved 2002/1/26.
+Coded by Takuji Nishimura and Makoto Matsumoto.
+
+Before using, initialize the state by using init_genrand(seed)
+or init_by_array(init_key, key_length).
+
+Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+
+ 3. The names of its contributors may not be used to endorse or promote
+    products derived from this software without specific prior written
+    permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+Any feedback is very welcome.
+http://www.math.keio.ac.jp/matumoto/emt.html
+email: matumoto@math.keio.ac.jp
+\end{verbatim}
+
+
+
+\subsection{Sockets}
+
+The \module{socket} module uses the functions, \function{getaddrinfo},
+and \function{getnameinfo}, which are coded in separate source files
+from the WIDE Project, \url{http://www.wide.ad.jp/about/index.html}.
+
+\begin{verbatim}      
+Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
+All rights reserved.
+ 
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+GAI_ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR GAI_ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON GAI_ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN GAI_ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+\end{verbatim}
+
+
+
+\subsection{Floating point exception control}
+
+The source for the \module{fpectl} module includes the following notice:
+
+\begin{verbatim}
+     ---------------------------------------------------------------------  
+    /                       Copyright (c) 1996.                           \ 
+   |          The Regents of the University of California.                 |
+   |                        All rights reserved.                           |
+   |                                                                       |
+   |   Permission to use, copy, modify, and distribute this software for   |
+   |   any purpose without fee is hereby granted, provided that this en-   |
+   |   tire notice is included in all copies of any software which is or   |
+   |   includes  a  copy  or  modification  of  this software and in all   |
+   |   copies of the supporting documentation for such software.           |
+   |                                                                       |
+   |   This  work was produced at the University of California, Lawrence   |
+   |   Livermore National Laboratory under  contract  no.  W-7405-ENG-48   |
+   |   between  the  U.S.  Department  of  Energy and The Regents of the   |
+   |   University of California for the operation of UC LLNL.              |
+   |                                                                       |
+   |                              DISCLAIMER                               |
+   |                                                                       |
+   |   This  software was prepared as an account of work sponsored by an   |
+   |   agency of the United States Government. Neither the United States   |
+   |   Government  nor the University of California nor any of their em-   |
+   |   ployees, makes any warranty, express or implied, or  assumes  any   |
+   |   liability  or  responsibility  for the accuracy, completeness, or   |
+   |   usefulness of any information,  apparatus,  product,  or  process   |
+   |   disclosed,   or  represents  that  its  use  would  not  infringe   |
+   |   privately-owned rights. Reference herein to any specific  commer-   |
+   |   cial  products,  process,  or  service  by trade name, trademark,   |
+   |   manufacturer, or otherwise, does not  necessarily  constitute  or   |
+   |   imply  its endorsement, recommendation, or favoring by the United   |
+   |   States Government or the University of California. The views  and   |
+   |   opinions  of authors expressed herein do not necessarily state or   |
+   |   reflect those of the United States Government or  the  University   |
+   |   of  California,  and shall not be used for advertising or product   |
+    \  endorsement purposes.                                              / 
+     ---------------------------------------------------------------------
+\end{verbatim}
+
+
+
+\subsection{MD5 message digest algorithm}
+
+The source code for the \module{md5} module contains the following notice:
+
+\begin{verbatim}
+  Copyright (C) 1999, 2002 Aladdin Enterprises.  All rights reserved.
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+  L. Peter Deutsch
+  ghost@aladdin.com
+
+  Independent implementation of MD5 (RFC 1321).
+
+  This code implements the MD5 Algorithm defined in RFC 1321, whose
+  text is available at
+http://www.ietf.org/rfc/rfc1321.txt
+  The code is derived from the text of the RFC, including the test suite
+  (section A.5) but excluding the rest of Appendix A.  It does not include
+  any code or documentation that is identified in the RFC as being
+  copyrighted.
+
+  The original and principal author of md5.h is L. Peter Deutsch
+  <ghost@aladdin.com>.  Other authors are noted in the change history
+  that follows (in reverse chronological order):
+
+  2002-04-13 lpd Removed support for non-ANSI compilers; removed
+references to Ghostscript; clarified derivation from RFC 1321;
+now handles byte order either statically or dynamically.
+  1999-11-04 lpd Edited comments slightly for automatic TOC extraction.
+  1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5);
+added conditionalization for C++ compilation from Martin
+Purschke <purschke@bnl.gov>.
+  1999-05-03 lpd Original version.
+\end{verbatim}
+
+
+
+\subsection{Asynchronous socket services}
+
+The \module{asynchat} and \module{asyncore} modules contain the
+following notice:
+
+\begin{verbatim}      
+ Copyright 1996 by Sam Rushing
+
+                         All Rights Reserved
+
+ Permission to use, copy, modify, and distribute this software and
+ its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that copyright notice and this permission
+ notice appear in supporting documentation, and that the name of Sam
+ Rushing not be used in advertising or publicity pertaining to
+ distribution of the software without specific, written prior
+ permission.
+
+ SAM RUSHING DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ NO EVENT SHALL SAM RUSHING BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+\end{verbatim}
+
+
+\subsection{Cookie management}
+
+The \module{Cookie} module contains the following notice:
+
+\begin{verbatim}
+ Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu>
+
+                All Rights Reserved
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that copyright notice and this permission
+ notice appear in supporting documentation, and that the name of
+ Timothy O'Malley  not be used in advertising or publicity
+ pertaining to distribution of the software without specific, written
+ prior permission.
+
+ Timothy O'Malley DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+ SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS, IN NO EVENT SHALL Timothy O'Malley BE LIABLE FOR
+ ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ PERFORMANCE OF THIS SOFTWARE.
+\end{verbatim}      
+
+
+
+\subsection{Profiling}
+
+The \module{profile} and \module{pstats} modules contain
+the following notice:
+
+\begin{verbatim}
+ Copyright 1994, by InfoSeek Corporation, all rights reserved.
+ Written by James Roskind
+
+ Permission to use, copy, modify, and distribute this Python software
+ and its associated documentation for any purpose (subject to the
+ restriction in the following sentence) without fee is hereby granted,
+ provided that the above copyright notice appears in all copies, and
+ that both that copyright notice and this permission notice appear in
+ supporting documentation, and that the name of InfoSeek not be used in
+ advertising or publicity pertaining to distribution of the software
+ without specific, written prior permission.  This permission is
+ explicitly restricted to the copying and modification of the software
+ to remain in Python, compiled Python, or other languages (such as C)
+ wherein the modified or derived code is exclusively imported into a
+ Python module.
+
+ INFOSEEK CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+ SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS. IN NO EVENT SHALL INFOSEEK CORPORATION BE LIABLE FOR ANY
+ SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+\end{verbatim}
+
+
+
+\subsection{Execution tracing}
+
+The \module{trace} module contains the following notice:
+
+\begin{verbatim}
+ portions copyright 2001, Autonomous Zones Industries, Inc., all rights...
+ err...  reserved and offered to the public under the terms of the
+ Python 2.2 license.
+ Author: Zooko O'Whielacronx
+ http://zooko.com/
+ mailto:zooko@zooko.com
+
+ Copyright 2000, Mojam Media, Inc., all rights reserved.
+ Author: Skip Montanaro
+
+ Copyright 1999, Bioreason, Inc., all rights reserved.
+ Author: Andrew Dalke
+
+ Copyright 1995-1997, Automatrix, Inc., all rights reserved.
+ Author: Skip Montanaro
+
+ Copyright 1991-1995, Stichting Mathematisch Centrum, all rights reserved.
+
+
+ Permission to use, copy, modify, and distribute this Python software and
+ its associated documentation for any purpose without fee is hereby
+ granted, provided that the above copyright notice appears in all copies,
+ and that both that copyright notice and this permission notice appear in
+ supporting documentation, and that the name of neither Automatrix,
+ Bioreason or Mojam Media be used in advertising or publicity pertaining to
+ distribution of the software without specific, written prior permission.
+\end{verbatim} 
+
+
+
+\subsection{UUencode and UUdecode functions}
+
+The \module{uu} module contains the following notice:
+
+\begin{verbatim}
+ Copyright 1994 by Lance Ellinghouse
+ Cathedral City, California Republic, United States of America.
+                        All Rights Reserved
+ Permission to use, copy, modify, and distribute this software and its
+ documentation for any purpose and without fee is hereby granted,
+ provided that the above copyright notice appear in all copies and that
+ both that copyright notice and this permission notice appear in
+ supporting documentation, and that the name of Lance Ellinghouse
+ not be used in advertising or publicity pertaining to distribution
+ of the software without specific, written prior permission.
+ LANCE ELLINGHOUSE DISCLAIMS ALL WARRANTIES WITH REGARD TO
+ THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS, IN NO EVENT SHALL LANCE ELLINGHOUSE CENTRUM BE LIABLE
+ FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+ Modified by Jack Jansen, CWI, July 1995:
+ - Use binascii module to do the actual line-by-line conversion
+   between ascii and binary. This results in a 1000-fold speedup. The C
+   version is still 5 times faster, though.
+ - Arguments more compliant with python standard
+\end{verbatim}
+
+
+
+\subsection{XML Remote Procedure Calls}
+
+The \module{xmlrpclib} module contains the following notice:
+
+\begin{verbatim}
+     The XML-RPC client interface is
+
+ Copyright (c) 1999-2002 by Secret Labs AB
+ Copyright (c) 1999-2002 by Fredrik Lundh
+
+ By obtaining, using, and/or copying this software and/or its
+ associated documentation, you agree that you have read, understood,
+ and will comply with the following terms and conditions:
+
+ Permission to use, copy, modify, and distribute this software and
+ its associated documentation for any purpose and without fee is
+ hereby granted, provided that the above copyright notice appears in
+ all copies, and that both that copyright notice and this permission
+ notice appear in supporting documentation, and that the name of
+ Secret Labs AB or the author not be used in advertising or publicity
+ pertaining to distribution of the software without specific, written
+ prior permission.
+
+ SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
+ TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
+ ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
+ BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
+ DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ OF THIS SOFTWARE.
+\end{verbatim}
+
+--
+
+python2.5-2.5.1/Doc/html/about.dat
+
+<p> <a
+    href="http://saftsack.fs.uni-bayreuth.de/;SPMtilde;latex2ht/">
+    <strong>LaTeX</strong>2<tt>HTML</tt></a> is Copyright &copy;
+  1993, 1994, 1995, 1996, 1997, <a
+    href="http://cbl.leeds.ac.uk/nikos/personal.html">Nikos
+    Drakos</a>, Computer Based Learning Unit, University of
+  Leeds, and Copyright &copy; 1997, 1998, <a
+    href="http://www.maths.mq.edu.au/;SPMtilde;ross/">Ross
+    Moore</a>, Mathematics Department, Macquarie University,
+  Sydney.
+
+
+python2.5-2.5.1/Doc/html/stdabout.dat
+
+<p> <a
+    href="http://saftsack.fs.uni-bayreuth.de/;SPMtilde;latex2ht/">
+    <strong>LaTeX</strong>2<tt>HTML</tt></a> is Copyright &copy;
+  1993, 1994, 1995, 1996, 1997, <a
+    href="http://cbl.leeds.ac.uk/nikos/personal.html">Nikos
+    Drakos</a>, Computer Based Learning Unit, University of
+  Leeds, and Copyright &copy; 1997, 1998, <a
+    href="http://www.maths.mq.edu.au/;SPMtilde;ross/">Ross
+    Moore</a>, Mathematics Department, Macquarie University,
+  Sydney.
+
+--
+
+% Copyright 1995 Virginia Polytechnic Institute and State University
+% and Fred L. Drake, Jr.  This copyright notice must be distributed on
+% all copies, but this document otherwise may be distributed as part
+% of the Python distribution.  No fee may be charged for this document
+% in any representation, either on paper or electronically.  This
+% restriction does not affect other elements in a distributed package
+% in any way.
+
+--
+
+Written by James Roskind.\footnote{
+  Updated and converted to \LaTeX\ by Guido van Rossum.
+  Further updated by Armin Rigo to integrate the documentation for the new
+  \module{cProfile} module of Python 2.5.}
+
+Permission to use, copy, modify, and distribute this Python software
+and its associated documentation for any purpose (subject to the
+restriction in the following sentence) without fee is hereby granted,
+provided that the above copyright notice appears in all copies, and
+that both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of InfoSeek not be used in
+advertising or publicity pertaining to distribution of the software
+without specific, written prior permission.  This permission is
+explicitly restricted to the copying and modification of the software
+to remain in Python, compiled Python, or other languages (such as C)
+wherein the modified or derived code is exclusively imported into a
+Python module.
+
+INFOSEEK CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS. IN NO EVENT SHALL INFOSEEK CORPORATION BE LIABLE FOR ANY
+SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+--
+
+% Piet van Oostrum, Dept of Computer Science, University of Utrecht
+% Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands
+% Telephone: +31 30 2532180. Email: piet@cs.ruu.nl
+% ========================================================================
+% LICENCE: This is free software. You are allowed to use and distribute
+% this software in any way you like. You are also allowed to make modified
+% versions of it, but you can distribute a modified version only if you
+% clearly indicate that it is a modified version and the person(s) who
+% modified it. This indication should be in a prominent place, e.g. in the
+% top of the file. If possible a contact address, preferably by email,
+% should be given for these persons. If that is feasible the modifications
+% should be indicated in the source code.
+% ========================================================================
+
+--
+
+ Copyright (C) 1997-1998 Greg Stein. All Rights Reserved.
+
+ This module is provided under a BSD-ish license. See
+   http://www.opensource.org/licenses/bsd-license.html
+ and replace OWNER, ORGANIZATION, and YEAR as appropriate.
+
+--
+
+License: Any components of the py2app suite may be distributed under
+the MIT or PSF open source licenses.
+
+--
+
+python2.5-2.5.1/Lib/robotparser.py
+""" robotparser.py
+
+    Copyright (C) 2000  Bastian Kleineidam
+
+    You can choose between two licenses when using this package:
+    1) GNU GPLv2
+    2) PSF license for Python 2.2
+
+    The robots.txt Exclusion Protocol is implemented as specified in
+    http://info.webcrawler.com/mak/projects/robots/norobots-rfc.html
+
+--
+
+ Copyright (C) 1986 Gary S. Brown.  You may use this program, or
+ code or tables extracted from it, as desired without restriction.
+
+--
+
+python2.5-2.5.1/Modules/expat/ascii.h
+/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
+   See the file COPYING for copying permission.
+*/
+
+--
+
+python2.5-2.5.1/Modules/expat/macconfig.h
+/*================================================================
+** Copyright 2000, Clark Cooper
+** All rights reserved.
+**
+** This is free software. You are permitted to copy, distribute, or modify
+** it under the terms of the MIT/X license (contained in the COPYING file
+** with this distribution.)
+**
+*/
+
+--
+
+python2.5-2.5.1/Modules/expat/pyexpatns.h
+/* Copyright (c) 2005-2006 ActiveState Software Inc.
+
+--
+
+python2.5-2.5.1/Modules/zlib/Makefile.in
+ Makefile for zlib
+ Copyright (C) 1995-2005 Jean-loup Gailly.
+ For conditions of distribution and use, see copyright notice in zlib.h
+
+python 2.5.1 - python2.5-2.5.1/Modules/zlib/zlib.h
+
+/* zlib.h -- interface of the 'zlib' general purpose compression library
+  version 1.2.3, July 18th, 2005
+
+  Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+  Jean-loup Gailly        Mark Adler
+  jloup@gzip.org          madler@alumni.caltech.edu
+
+
+--
+
+%%% Copyright   Ulf A. Lindgren
+%%%             Department of Applied Electronics
+%%%             Chalmers University of Technology
+%%%             S-412 96 Gothenburg, Sweden
+%%%             E-mail lindgren@ae.chalmers.se
+%%%
+%%% Note        Permission is granted to modify this file under
+%%%             the condition that it is saved using another
+%%%             file and package name.
+
+--
+
+% Copyright 1998,2001 Donald Arseneau;  Distribute freely if unchanged.
+% Instructions follow after the definitions.
+
+--
+
+  Copyright (C) 2000  Luke Kenneth Casson Leighton <lkcl@samba.org>
+
+--
+
+----------------------------------------------------------------------
+  Copyright (c) 1999-2001, Digital Creations, Fredericksburg, VA, USA
+  and Andrew Kuchling. All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions are
+  met:
+
+    o Redistributions of source code must retain the above copyright
+      notice, this list of conditions, and the disclaimer that follows.
+
+    o Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions, and the following disclaimer in
+      the documentation and/or other materials provided with the
+      distribution.
+
+    o Neither the name of Digital Creations nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+  THIS SOFTWARE IS PROVIDED BY DIGITAL CREATIONS AND CONTRIBUTORS *AS
+  IS* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+  PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL DIGITAL
+  CREATIONS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+  DAMAGE.
+----------------------------------------------------------------------
+
+--
+
+ (C) Copyright 2001  Autonomous Zone Industries
+
+ License:  This is free software.  You may use this software for any
+           purpose including modification/redistribution, so long as
+           this header remains intact and that you do not claim any
+           rights of ownership or authorship of this software.  This
+           software has been tested, but no warranty is expressed or
+           implied.
+
+--
+
+------------------------------------------------------------------------
+           Copyright (c) 1997-2001 by Total Control Software
+                         All Rights Reserved
+------------------------------------------------------------------------
+
+ Module Name:  dbShelve.py
+
+ Description:  A reimplementation of the standard shelve.py that
+               forces the use of cPickle, and DB.
+
+ Creation Date:    11/3/97 3:39:04PM
+
+ License:      This is free software.  You may use this software for any
+               purpose including modification/redistribution, so long as
+               this header remains intact and that you do not claim any
+               rights of ownership or authorship of this software.  This
+               software has been tested, but no warranty is expressed or
+               implied.
+
+--
+-----------------------------------------------------------------------
+
+ Copyright (C) 2000, 2001 by Autonomous Zone Industries
+ Copyright (C) 2002 Gregory P. Smith
+
+ License:      This is free software.  You may use this software for any
+               purpose including modification/redistribution, so long as
+               this header remains intact and that you do not claim any
+               rights of ownership or authorship of this software.  This
+               software has been tested, but no warranty is expressed or
+               implied.
+
+--
+
+(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
+(c) Copyright 2000 Guido van Rossum.
+
+--
+
+ Copyright (c) 1997 by Fredrik Lundh
+
+ fredrik@pythonware.com
+ http://www.pythonware.com
+
+
+ --------------------------------------------------------------------
+
+--
+
+ Copyright 2001-2007 by Vinay Sajip. All Rights Reserved.
+
+ Permission to use, copy, modify, and distribute this software and its
+ documentation for any purpose and without fee is hereby granted,
+ provided that the above copyright notice appear in all copies and that
+ both that copyright notice and this permission notice appear in
+ supporting documentation, and that the name of Vinay Sajip
+ not be used in advertising or publicity pertaining to distribution
+ of the software without specific, written prior permission.
+ VINAY SAJIP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+ VINAY SAJIP BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
+ IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+--
+
+Copyright (c) 2001-2006 Gregory P. Ward.  All rights reserved.
+Copyright (c) 2002-2006 Python Software Foundation.  All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+  * Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+  * Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+
+  * Neither the name of the author nor the names of its
+    contributors may be used to endorse or promote products derived from
+    this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+--
+
+    Copyright (c) 1999-2000, Marc-Andre Lemburg; mailto:mal@lemburg.com
+    Copyright (c) 2000-2003, eGenix.com Software GmbH; mailto:info@egenix.com
+
+    Permission to use, copy, modify, and distribute this software and its
+    documentation for any purpose and without fee or royalty is hereby granted,
+    provided that the above copyright notice appear in all copies and that
+    both that copyright notice and this permission notice appear in
+    supporting documentation or portions thereof, including modifications,
+    that you make.
+
+    EGENIX.COM SOFTWARE GMBH DISCLAIMS ALL WARRANTIES WITH REGARD TO
+    THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+    FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
+    INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+    FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+    NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+    WITH THE USE OR PERFORMANCE OF THIS SOFTWARE !
+
+--
+
+ Copyright (C) 2002 Lars Gust?bel <lars@gustaebel.de>
+ All rights reserved.
+
+ Permission  is  hereby granted,  free  of charge,  to  any person
+ obtaining a  copy of  this software  and associated documentation
+ files  (the  "Software"),  to   deal  in  the  Software   without
+ restriction,  including  without limitation  the  rights to  use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies  of  the  Software,  and to  permit  persons  to  whom the
+ Software  is  furnished  to  do  so,  subject  to  the  following
+ conditions:
+
+ The above copyright  notice and this  permission notice shall  be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS  IS", WITHOUT WARRANTY OF ANY  KIND,
+ EXPRESS OR IMPLIED, INCLUDING  BUT NOT LIMITED TO  THE WARRANTIES
+ OF  MERCHANTABILITY,  FITNESS   FOR  A  PARTICULAR   PURPOSE  AND
+ NONINFRINGEMENT.  IN  NO  EVENT SHALL  THE  AUTHORS  OR COPYRIGHT
+ HOLDERS  BE LIABLE  FOR ANY  CLAIM, DAMAGES  OR OTHER  LIABILITY,
+ WHETHER  IN AN  ACTION OF  CONTRACT, TORT  OR OTHERWISE,  ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+
+--
+
+ Copyright 1994 by Lance Ellinghouse
+ Cathedral City, California Republic, United States of America.
+                        All Rights Reserved
+ Permission to use, copy, modify, and distribute this software and its
+ documentation for any purpose and without fee is hereby granted,
+ provided that the above copyright notice appear in all copies and that
+ both that copyright notice and this permission notice appear in
+ supporting documentation, and that the name of Lance Ellinghouse
+ not be used in advertising or publicity pertaining to distribution
+ of the software without specific, written prior permission.
+ LANCE ELLINGHOUSE DISCLAIMS ALL WARRANTIES WITH REGARD TO
+ THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS, IN NO EVENT SHALL LANCE ELLINGHOUSE CENTRUM BE LIABLE
+ FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+--
+
+Metadata-Version: 1.0
+Name: wsgiref
+Version: 0.1.2
+Summary: WSGI (PEP 333) Reference Library
+Author: Phillip J. Eby
+Author-email: web-sig@python.org
+License: PSF or ZPL
+Platform: UNKNOWN
+
+--
+
+python 2.5.1 - python2.5-2.5.1/Lib/wsgiref/validate.py
+
+ (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
+ Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
+ Also licenced under the Apache License, 2.0: http://opensource.org/licenses/apache2.0.php
+ Licensed to PSF under a Contributor Agreement
+
+--
+
+/******************************************************************
+Copyright 1998 by Just van Rossum, Den Haag, The Netherlands.
+
+                        All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Just van Rossum not be 
+used in advertising or publicity pertaining to distribution of the 
+software without specific, written prior permission.
+
+JUST VAN ROSSUM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 
+EVENT SHALL JUST VAN ROSSUM BE LIABLE FOR ANY SPECIAL, INDIRECT OR 
+CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF 
+USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+
+******************************************************************/
+
+--
+
+;; Copyright (C) 1992,1993,1994  Tim Peters
+
+;; Author: 1995-2002 Barry A. Warsaw
+;;         1992-1994 Tim Peters
+;; Maintainer: python-mode@python.org
+;; Created:    Feb 1992
+;; Keywords:   python languages oop
+
+(defconst py-version "$Revision: 1.1 $"
+  "`python-mode' version number.")
+
+;; This software is provided as-is, without express or implied
+;; warranty.  Permission to use, copy, modify, distribute or sell this
+;; software, without fee, for any purpose and by any individual or
+;; organization, is hereby granted, provided that the above copyright
+;; notice and this paragraph appear in all copies.
+
+--
+
+/*----------------------------------------------------------------------
+  Copyright (c) 1999-2001, Digital Creations, Fredericksburg, VA, USA
+  and Andrew Kuchling. All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions are
+  met:
+
+    o Redistributions of source code must retain the above copyright
+      notice, this list of conditions, and the disclaimer that follows.
+
+    o Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions, and the following disclaimer in
+      the documentation and/or other materials provided with the
+      distribution.
+
+    o Neither the name of Digital Creations nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+  THIS SOFTWARE IS PROVIDED BY DIGITAL CREATIONS AND CONTRIBUTORS *AS
+  IS* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+  PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL DIGITAL
+  CREATIONS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+  DAMAGE.
+------------------------------------------------------------------------*/
+
+--
+
+Copyright (c) 2002 Jorge Acereda  <jacereda@users.sourceforge.net> &
+                   Peter O'Gorman <ogorman@users.sourceforge.net>
+                   
+Portions may be copyright others, see the AUTHORS file included with this
+distribution.
+
+Maintained by Peter O'Gorman <ogorman@users.sourceforge.net>
+
+Bug Reports and other queries should go to <ogorman@users.sourceforge.net>
+
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+--
+
+/*
+Copyright (c) 2002 Peter O'Gorman <ogorman@users.sourceforge.net>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+--
+
+libffi - Copyright (c) 1996-2003  Red Hat, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+``Software''), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+--
+
+/* -----------------------------------------------------------------------
+   ffi.c - Copyright (c) 1998 Cygnus Solutions
+           Copyright (c) 2004 Simon Posnjak
+   Copyright (c) 2005 Axis Communications AB
+
+   CRIS Foreign Function Interface
+
+   Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this software and associated documentation files (the
+   ``Software''), to deal in the Software without restriction, including
+   without limitation the rights to use, copy, modify, merge, publish,
+   distribute, sublicense, and/or sell copies of the Software, and to
+   permit persons to whom the Software is furnished to do so, subject to
+   the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+   IN NO EVENT SHALL SIMON POSNJAK BE LIABLE FOR ANY CLAIM, DAMAGES OR
+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
+   ----------------------------------------------------------------------- */
+
+--
+
+/* -----------------------------------------------------------------------
+   eabi.S - Copyright (c) 2004  Anthony Green
+   
+   FR-V Assembly glue.
+
+   $Id: python\0402_5_1\040licenses.txt,v 1.1 2009/02/05 00:27:50 wpaul Exp $
+
+   Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this software and associated documentation files (the
+   ``Software''), to deal in the Software without restriction, including
+   without limitation the rights to use, copy, modify, merge, publish,
+   distribute, sublicense, and/or sell copies of the Software, and to
+   permit persons to whom the Software is furnished to do so, subject to
+   the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+   IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
+   ----------------------------------------------------------------------- */
+
+--
+
+/* -----------------------------------------------------------------------
+   ffi.c - Copyright (c) 1998 Red Hat, Inc.
+   Copyright (c) 2000 Hewlett Packard Company
+   
+   IA64 Foreign Function Interface 
+
+   Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this software and associated documentation files (the
+   ``Software''), to deal in the Software without restriction, including
+   without limitation the rights to use, copy, modify, merge, publish,
+   distribute, sublicense, and/or sell copies of the Software, and to
+   permit persons to whom the Software is furnished to do so, subject to
+   the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+   IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
+   ----------------------------------------------------------------------- */
+
+--
+
+/* -----------------------------------------------------------------------
+   ffi.c - Copyright (c) 2004  Renesas Technology
+   
+   M32R Foreign Function Interface 
+
+   Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this software and associated documentation files (the
+   ``Software''), to deal in the Software without restriction, including
+   without limitation the rights to use, copy, modify, merge, publish,
+   distribute, sublicense, and/or sell copies of the Software, and to
+   permit persons to whom the Software is furnished to do so, subject to
+   the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+   IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR
+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
+   ----------------------------------------------------------------------- */
+
+--
+
+/* -----------------------------------------------------------------------
+   asm.h - Copyright (c) 1998 Geoffrey Keating
+
+   PowerPC Assembly glue.
+
+   Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this software and associated documentation files (the
+   ``Software''), to deal in the Software without restriction, including
+   without limitation the rights to use, copy, modify, merge, publish,
+   distribute, sublicense, and/or sell copies of the Software, and to
+   permit persons to whom the Software is furnished to do so, subject to
+   the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+   IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
+   ----------------------------------------------------------------------- */
+
+--
+
+/* -----------------------------------------------------------------------
+   darwin.S - Copyright (c) 2000 John Hornkvist
+      Copyright (c) 2004 Free Software Foundation, Inc.
+
+   PowerPC Assembly glue.
+
+   Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this software and associated documentation files (the
+   ``Software''), to deal in the Software without restriction, including
+   without limitation the rights to use, copy, modify, merge, publish,
+   distribute, sublicense, and/or sell copies of the Software, and to
+   permit persons to whom the Software is furnished to do so, subject to
+   the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+   IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
+   ----------------------------------------------------------------------- */
+
+--
+
+/* -----------------------------------------------------------------------
+   darwin_closure.S - Copyright (c) 2002, 2003, 2004, Free Software Foundation,
+   Inc. based on ppc_closure.S
+
+   PowerPC Assembly glue.
+
+   Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this software and associated documentation files (the
+   ``Software''), to deal in the Software without restriction, including
+   without limitation the rights to use, copy, modify, merge, publish,
+   distribute, sublicense, and/or sell copies of the Software, and to
+   permit persons to whom the Software is furnished to do so, subject to
+   the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+   IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
+   ----------------------------------------------------------------------- */
+
+--
+
+/* -----------------------------------------------------------------------
+   ffi.c - Copyright (c) 1998 Geoffrey Keating
+
+   PowerPC Foreign Function Interface
+
+   Darwin ABI support (c) 2001 John Hornkvist
+   AIX ABI support (c) 2002 Free Software Foundation, Inc.
+
+   Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this software and associated documentation files (the
+   ``Software''), to deal in the Software without restriction, including
+   without limitation the rights to use, copy, modify, merge, publish,
+   distribute, sublicense, and/or sell copies of the Software, and to
+   permit persons to whom the Software is furnished to do so, subject to
+   the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+   IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
+   ----------------------------------------------------------------------- */
+
+--
+
+/* -----------------------------------------------------------------------
+   sysv.h - Copyright (c) 2003 Jakub Jelinek <jakub@redhat.com>
+
+   PowerPC64 Assembly glue.
+
+   Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this software and associated documentation files (the
+   ``Software''), to deal in the Software without restriction, including
+   without limitation the rights to use, copy, modify, merge, publish,
+   distribute, sublicense, and/or sell copies of the Software, and to
+   permit persons to whom the Software is furnished to do so, subject to
+   the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+   IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
+   ----------------------------------------------------------------------- */
+
+--
+
+/* -----------------------------------------------------------------------
+   ffi.c - Copyright (c) 2000 Software AG
+ 
+   S390 Foreign Function Interface
+ 
+   Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this software and associated documentation files (the
+   ``Software''), to deal in the Software without restriction, including
+   without limitation the rights to use, copy, modify, merge, publish,
+   distribute, sublicense, and/or sell copies of the Software, and to
+   permit persons to whom the Software is furnished to do so, subject to
+   the following conditions:
+ 
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+ 
+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+   IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
+   ----------------------------------------------------------------------- */
+
+--
+
+/* -----------------------------------------------------------------------
+   ffi.c - Copyright (c) 2002, 2003, 2004, 2005 Kaz Kojima
+   
+   SuperH Foreign Function Interface 
+
+   Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this software and associated documentation files (the
+   ``Software''), to deal in the Software without restriction, including
+   without limitation the rights to use, copy, modify, merge, publish,
+   distribute, sublicense, and/or sell copies of the Software, and to
+   permit persons to whom the Software is furnished to do so, subject to
+   the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+   IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
+   ----------------------------------------------------------------------- */
+
+--
+
+/* -----------------------------------------------------------------------
+   ffi.c - Copyright (c) 1996, 1998, 1999, 2001  Red Hat, Inc.
+           Copyright (c) 2002  Ranjit Mathew
+           Copyright (c) 2002  Bo Thorsen
+           Copyright (c) 2002  Roger Sayle
+   
+   x86 Foreign Function Interface 
+
+   Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this software and associated documentation files (the
+   ``Software''), to deal in the Software without restriction, including
+   without limitation the rights to use, copy, modify, merge, publish,
+   distribute, sublicense, and/or sell copies of the Software, and to
+   permit persons to whom the Software is furnished to do so, subject to
+   the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+   IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
+   ----------------------------------------------------------------------- */
+
+--
+
+/***********************************************************
+Copyright (C) 1997, 2002, 2003 Martin von Loewis
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies.
+
+This software comes with no warranty. Use at your own risk.
+
+******************************************************************/
+
+--
+
+   The code in this module was based on a download from:
+  http://www.math.keio.ac.jp/~matumoto/MT2002/emt19937ar.html
+
+   It was modified in 2002 by Raymond Hettinger as follows:
+
+* the principal computational lines untouched except for tabbing.
+
+* renamed genrand_res53() to random_random() and wrapped
+  in python calling/return code.
+
+* genrand_int32() and the helper functions, init_genrand()
+  and init_by_array(), were declared static, wrapped in
+  Python calling/return code.  also, their global data
+  references were replaced with structure references.
+
+* unused functions from the original were deleted.
+  new, original C python code was added to implement the
+  Random() interface.
+
+   The following are the verbatim comments from the original code:
+
+   A C-program for MT19937, with initialization improved 2002/1/26.
+   Coded by Takuji Nishimura and Makoto Matsumoto.
+
+   Before using, initialize the state by using init_genrand(seed)
+   or init_by_array(init_key, key_length).
+
+   Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+     1. Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+
+     2. Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+
+     3. The names of its contributors may not be used to endorse or promote
+products derived from this software without specific prior written
+permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+--
+
+ * Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org>
+ *
+ * This file is part of psycopg and was adapted for pysqlite. Federico Di
+ * Gregorio gave the permission to use it within pysqlite under the following
+ * license:
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty.  In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ *    claim that you wrote the original software. If you use this software
+ *    in a product, an acknowledgment in the product documentation would be
+ *    appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ *    misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+
+--
+
+/***********************************************************
+Copyright (C) 1994 Steen Lumholt.
+
+                        All Rights Reserved
+
+******************************************************************/
+
+--
+
+/*
+ * Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+--
+
+ * Copyright 1992-1994, David Gottner
+ *
+ *                    All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its 
+ * documentation for any purpose and without fee is hereby granted, 
+ * provided that the above copyright notice, this permission notice and
+ * the following disclaimer notice appear unmodified in all copies.
+ *
+ * I DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL I
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
+ * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA, OR PROFITS, WHETHER
+ * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Nevertheless, I would like to know about bugs in this library or
+ * suggestions for improvment.  Send bug reports and feedback to
+ * davegottner@delphi.com.
+
+--
+
+Copyright (c), 1997-2006, Marc-Andre Lemburg (mal@lemburg.com)
+Copyright (c), 2000-2006, eGenix.com Software GmbH (info@egenix.com)
+
+                   All Rights Reserved.
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee or royalty is hereby
+granted, provided that the above copyright notice appear in all copies
+and that both that copyright notice and this permission notice appear
+in supporting documentation or portions thereof, including
+modifications, that you make.
+
+THE AUTHOR MARC-ANDRE LEMBURG DISCLAIMS ALL WARRANTIES WITH REGARD TO
+THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
+INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+WITH THE USE OR PERFORMANCE OF THIS SOFTWARE !
+
+--
+
+/***********************************************************
+Copyright 1994 by Lance Ellinghouse,
+Cathedral City, California Republic, United States of America.
+
+                        All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its 
+documentation for any purpose and without fee is hereby granted, 
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in 
+supporting documentation, and that the name of Lance Ellinghouse
+not be used in advertising or publicity pertaining to distribution 
+of the software without specific, written prior permission.
+
+LANCE ELLINGHOUSE DISCLAIMS ALL WARRANTIES WITH REGARD TO
+THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS, IN NO EVENT SHALL LANCE ELLINGHOUSE BE LIABLE FOR ANY SPECIAL, 
+INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING 
+FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 
+NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 
+WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+******************************************************************/
+
+--
+
+Copyright:Copyright ? 1999 by Apple Computer, Inc., all rights reserved.
+
+You may incorporate this Apple sample source code into your program(s) without
+restriction. This Apple sample source code has been provided "AS IS" and the
+responsibility for its operation is yours. You are not permitted to redistribute
+this Apple sample source code as "Apple sample source code" after having made
+changes. If you're going to re-distribute the source, we require that you make
+it clear in the source that the code was descended from Apple sample source
+code, but that you've made changes.
+
+--
+
+  Copyright (C) 1999, 2000, 2002 Aladdin Enterprises.  All rights reserved.
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+--
+
+/*
+ * Copyright (c) 1993 George V. Neville-Neil
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *This product includes software developed by George V. Neville-Neil
+ * 4. The name, George Neville-Neil may not be used to endorse or promote 
+ *    products derived from this software without specific prior 
+ *    written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+--
+
+ Copyright 2000, Mojam Media, Inc., all rights reserved.
+ Author: Skip Montanaro
+
+ Copyright 1999, Bioreason, Inc., all rights reserved.
+ Author: Andrew Dalke
+
+ Copyright 1995-1997, Automatrix, Inc., all rights reserved.
+ Author: Skip Montanaro
+
+ Copyright 1991-1995, Stichting Mathematisch Centrum, all rights reserved.
+
+
+ Permission to use, copy, modify, and distribute this Python software and
+ its associated documentation for any purpose without fee is hereby
+ granted, provided that the above copyright notice appears in all copies,
+ and that both that copyright notice and this permission notice appear in
+ supporting documentation, and that the name of neither Automatrix,
+ Bioreason or Mojam Media be used in advertising or publicity pertaining to
+ distribution of the software without specific, written prior permission.
+
+--
+/* Author: Toby Dickenson <htrd90@zepler.org>
+ *
+ * Copyright (c) 1999 Toby Dickenson
+ *
+ * Permission to use this software in any way is granted without
+ * fee, provided that the copyright notice above appears in all
+ * copies. This software is provided "as is" without any warranty.
+ */
+
+--
+python2.5-2.5.1/Modules/linuxaudiodev.c
+ ******************************************************************************
+ * linuxaudiodev.c -- Linux audio device for python.
+ * 
+ * Author          : Peter Bosch
+ * Created On      : Thu Mar  2 21:10:33 2000
+ * Status          : Unknown, Use with caution!
+ * 
+linuxaudiodev.c
+ * (C) 2000 Peter Bosch, all rights reserved.
+ ******************************************************************************
+ */
+
+--
+
+
+python2.5-2.5.1/Modules/ossaudiodev.c
+ *                flavours of BSD [XXX which ones?]; it is also available
+ *                for a wide range of commercial Unices.
+ *
+ * Originally written by Peter Bosch, March 2000, as linuxaudiodev.
+ *
+ * Renamed to ossaudiodev and rearranged/revised/hacked up
+ * by Greg Ward <gward@python.net>, November 2002.
+ossaudiodev.c
+ * (c) 2000 Peter Bosch.  All Rights Reserved.
+ * (c) 2002 Gregory P. Ward.  All Rights Reserved.
+ * (c) 2002 Python Software Foundation.  All Rights Reserved.
+  Copyright (c) 1998-2002 John Aycock
+
+  Permission is hereby granted, free of charge, to any person obtaining
+  a copy of this software and associated documentation files (the
+  "Software"), to deal in the Software without restriction, including
+  without limitation the rights to use, copy, modify, merge, publish,
+  distribute, sublicense, and/or sell copies of the Software, and to
+  permit persons to whom the Software is furnished to do so, subject to
+  the following conditions:
+
+  The above copyright notice and this permission notice shall be
+  included in all copies or substantial portions of the Software.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.W s9AL
\ No newline at end of file
Binary file srcanamdw/codescanner/distcodescanner/python25.dll has changed
Binary file srcanamdw/codescanner/distcodescanner/pywintypes25.dll has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/distcodescanner/release_notes.txt	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,498 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# #################################################################
+
+Nokia CodeScanner Command Line Tool Release Notes
+=================================================
+
+Version 2.1.4
+=============
+- Copyright changes done.
+
+Version 2.1.3
+=============
+- Updated the function parser in CodeScanner to improve check for
+leaving functions called in non-leaving functions. There should
+be less false positives now.
+
+
+Version 2.1.2
+=============
+- Added new IAD rule to check flag usage. IA must not use R&D flags 
+nor feature flags via preprocessor statements in the source code. 
+This means bldvariant.hrh and productvariant.hrh should not be used.
+This new rule is set to low severity in the "Other" category by 
+default. It can be configured by adding a <flags> script element 
+in the configuration file. 
+Example :
+<codescannerConfig>
+  <scripts>
+    <flags category="other" 
+           enable="true" 
+           severity="low"/>
+  </scripts>
+</codescannerConfig>
+
+- Added new IAD rule to check Central Repository usage. IA cannot 
+assume that the Central Repository is set up fully. This means the 
+return value of CRepository::get() cannot be ignored.
+This new rule is set to low severity in the "Other" category by 
+default. It can be configured by adding a <crepository> script 
+element in the configuration file. 
+Example :
+<codescannerConfig>
+  <scripts>
+    <crepository category="other" 
+                 enable="true" 
+                 severity="low"/>
+  </scripts>
+</codescannerConfig>
+
+- Added new IAD rule to check customizable icons. Due to device 
+customization requirements, IA must not remove any customization 
+done by the variant team. This means IA cannot include customizable 
+icons.
+This new rule is set to low severity in the "Other" category by 
+default. It can be configured by adding a <customizableicons> 
+script element in the configuration file. Names of icons can be 
+specified in the <iconsRE> element.
+Example :
+<codescannerConfig>
+  <scripts>
+    <customizableicons category="other" 
+                       enable="true" 
+                       severity="low">
+      <iconsRE>iconA.bmp|iconB.svg|iconC</iconsRE>
+    </customizableicons>
+  </scripts>
+</codescannerConfig>
+
+
+Version 2.1.1
+=============
+- Added support for user-defined rules. This can be done by
+adding a <customrules> element to the configuration file.
+Example :
+<codescannerConfig>
+  <customrules>
+    <customrule>
+      <name>myOwnRule</name>
+      <keyword type=”class”>CMyOwnClass</keyword>
+      <filetype>h</filetype>
+      <severity>low</severity>
+      <title>My CodeScanner rule targeting CMyOwnClass</title>
+      <description>Locate definition of CMyOwnClass</description>
+    </customrule>
+  </customrules>
+</codescannerConfig>
+More information on the syntax of this new element can be found in 
+the document "CodeScanner_XML_ConfigFile_Spec.doc".
+
+- When scanning with low severity rules, CodeScanner now 
+generates informative messages instead of warnings when the 
+StdOut output format is selected.
+
+- Added support to disable individual error/warning via
+CodeScanner commands embedded in comments. The command has the 
+following format : 
+  codescanner(::<rule name>)+
+Example :
+void CTestCase::Foo()
+{
+  array->At(a); // codescanner::accessArrayElementWithoutCheck
+  User::Leave(KErrNone); /* codescanner::LeaveNoError */
+}
+A complete list of CodeScanner rule names can be found in the 
+document "CodeScanner_Rules.doc".
+
+- Added new rule to check whether Cancel() function is called 
+in active object's destructor.
+Cancel() should always be called in active object's destructor 
+to cancel an outstanding request if there is one. If there is 
+no request pending then Cancel() just does nothing, but if we 
+do not call Cancel() when having an outstanding request a panic 
+will be raised.
+This new rule is set to low severity in the "Coding Standards"
+category by default. It can be configured by adding a 
+<missingcancel> script element in the configuration
+file. 
+Example :
+<codescannerConfig>
+  <scripts>
+    <missingcancel category="codingstandards" 
+                   enable="true" 
+                   severity="low"/>
+  </scripts>
+</codescannerConfig>
+
+-Updated the function parser in CodeScanner to filter out constant 
+initialization.
+
+- Updated active object checking rule to ignore After() from 
+RTimer type member variables.
+
+- Updated to skip excluded folders specified in configuration file 
+when generating component summary reports.
+
+
+Version 2.1.0
+=============
+- Previously CodeScanner has been distributed as a single-file
+executable which packs all the DLLs and library modules it needed 
+into an archive attached to itself. During runtime, it creates a 
+directory (_MEI<id>) in the user's temp directory, and extract 
+these files there. When execution is complete, it recursively 
+removes the entire directory it created. 
+Unfortunately the cleanup process sometimes fail. So over time 
+user's temp directory can be littered with these directories, 
+which can cause CodeScanner to fail if it tries to reuse a 
+directory that was created from a previous run.
+To address this problem, we separated all these modules from 
+CodeScanner.exe and shipping them "as is". This change should be
+transparent from user's point of view, except when copying
+CodeScanner to other locations on user's system.
+
+- Updated configuration file format to allow passing arguments 
+to CodeScanner. One can now add an <arguments> element to the 
+configuration file with one or more of the following 
+child elements :
+<input> - specify additional directory/file to scan
+<outputformat> (html|xml|std) - specify output format
+<lxr> - url to lxr site
+<lxrversion> - lxr version
+<timestampedoutput> (on/off) - create time-stamped output directory 
+Example:
+<codescannerConfig>
+  <arguments>
+    <input>C:\Testing\CodeScanner_Tests\Bug_6393\Includes</input>
+    <outputformat>html|xml</outputformat>
+    <lxr>http://s60lxr/source/</lxr>
+    <lxrversion>S60_3_2_200736</lxrversion>
+    <timestampedoutput>on</timestampedoutput>
+  </arguments>
+</codescannerConfig>
+
+- Added new rule to check stack-based resource objects not put 
+on the cleanup stack.
+If a stack-based resource object is not put on the cleanup stack 
+with CleanupClosePushL() or CleanupResetAndDestroyPushL(), and 
+a leaving function or ELeave is called, a memory leak occurs. 
+CodeScanner occasionally gives false positives for this issue. 
+Individual cases should be investigated.
+This new rule is set to low severity in the "Code Review"
+category by default. It can be configured by adding a 
+<resourcenotoncleanupstack> script element in the configuration
+file. 
+Example :
+<codescannerConfig>
+  <scripts>
+    <resourcenotoncleanupstack category="codereview" 
+                               enable="true" 
+                               severity="low"/>
+  </scripts>
+</codescannerConfig>
+
+- Added new rule to check inheritance order of M and C classes. 
+If a C class inherits first from an M class and then a C class,
+a panic can occur when trying to pop a CBase pointer pointing 
+to such a class from the cleanup stack when in fact a pointer 
+pointing to the first predecessor, the mixin class, was popped 
+instead.
+This new rule is set to high severity in the "Can Panic"
+category by default. It can be configured by adding a 
+<inheritanceorder> script element in the configuration file. 
+Example :
+<codescannerConfig>
+  <scripts>
+    <inheritanceorder category="canpanic" 
+                      enable="true" 
+                      severity="high"/>
+  </scripts>
+</codescannerConfig>
+
+- Updated rule for L-functions that cannot leave. It is now
+possible to specify functions to be ignored by this rule in the
+configuration file. This is done by adding a <LFunctionIgnoreRE> 
+element to the <LFunctionCantLeave> script element.
+Example:
+<codescannerConfig>
+  <scripts>
+    <LFunctionCantLeave enable="true">
+      <LFunctionIgnoreRE>RunL</LFunctionIgnoreRE>
+    </LFunctionCantLeave>
+  </scripts>
+</codescannerConfig>
+
+- Updated description of rule for badly-named enum members.
+
+- Updated NULL equality check rule to ignore pointer comparisons 
+with NULL inside various __ASSERT_XXX() macros.
+
+- Removed duplicate rule for hard-coded external drive letters. 
+There is now only 1 rule that check for this problem and it is 
+a low severity rule in the Coding Standard category.
+
+- Improved rule for accessing array element by [] without 
+checking range.
+
+
+Version 2.0.9
+=============
+- Updated check for Open() to allow assignment of return value on 
+a different line.
+Example :
+  TInt error = 
+    myFile.Open();
+
+
+Version 2.0.8
+=============
+- Updated check for C class not inheriting from another C class.
+It is now possible to specify C class that does not inherit from
+another C class in the configuration file. This is done by adding
+a <cclassIgnoreRE> element to the <missingcclass> script element.
+Example :
+<missingcclass enable="true">
+  <cclassIgnoreRE>CLogger|CKeypadData</cclassIgnoreRE>
+</missingcclass>
+
+- Updated check for ignored Open() return value.
+It is now possible to specify object or class with Open() method
+that does not return any value in the configuration file. 
+This is done by adding an <openIgnoreRE> element to the 
+<open> script element. For a local variable, one can specify 
+either the type or variable name in the <openIgnoreRE> element. 
+For other types of object, one should specify the object name in 
+the <openIgnoreRE> element. 
+Example:
+<open enable="true">
+  <openIgnoreRE>CKeyStore|iKeyStore|lKeyStore</openIgnoreRE>
+</open>
+
+- Fixed a bug where some scripts cannot be disabled from the
+configuration file.
+
+
+Version 2.0.7
+=============
+- Updated standard console output to include severity level and
+category information in the error/warning messages.
+
+- Incorporated Psyco module to improve scanning performance. Please
+refer to the document "MIT license.txt" for licensing info.
+
+
+Version 2.0.6
+=============
+- Updated check for CleanupStack::Pop(AndDestroy)() to ignore
+CleanupStack::Pop(TInt, TAny*) and 
+CleanupStack::PopAndDestroy(TInt, TAny*)
+
+- Updated check for Open() to allow handler of return value on a 
+different line.
+Example :
+  User::LeaveIfError(
+    myFile.Open());
+
+- Updated check for At() to ignore timer objects.
+Example :
+  TTime now;
+  iTimer.At(iStatus, now);
+
+- Improved handling of scanning of code with #ifdef/#else/#endif
+preprocessor commands. CodeScanner sometimes can be confused by
+code surrounded by these preprocessor commands, e.g. generating
+warnings on member variable deleted incorrectly, even when it 
+happens inside a destructor. This has been fixed.
+
+
+Version 2.0.5
+=============
+- Added new option to specify additional source directory/file :
+"-i <source dir/file>" -- specify additional directory/file to scan
+Example : codescanner -i C:\resources -i C:\includes
+          C:\sources C:\results
+
+
+Version 2.0.4
+=============
+- Updated HTML generation to use '/' instead of '\' when generating
+links; this change is needed for Mozilla Firefox compatibility.
+
+- Added new option to toggle creation of time-stamped directory for
+results :
+"-t on/off" -- create a time-stamped directory for results; default
+               is on
+Example : codescanner -t off C:\sources C:\results
+
+- Added new option to configure output format of results:
+"-o html|xml|std" -- specify output format : HTML, XML or StdOut;
+                     default output format is HTML
+Multiple output formats can be specified at the same time.
+Example : codescanner -o xml,html C:\sources C:\results
+
+- Updated configuration file format to allow user setting the
+category and severity of scripts individually. Each <scripts> element
+contains one or more Script elements, each of which corresponds to a
+CodeScanner rule. Each Script element has the following attributes:
+enable (boolean) – specifies whether a script is enabled by CodeScanner.
+severity (string) – specifies the severity level of a script.
+category (string) – specifies the category of a script.
+Example :
+<codescannerConfig>
+  <scripts>
+    <baddefines enable="true" severity="low" category="codingstandards"/>
+    <friend enable="true" severity="low" category="codereview"/>
+    <leave enable="true" severity="high" category="canpanic"/>
+  </scripts>
+</codescannerConfig>
+
+
+Version 2.0.3
+=============
+- Updated HTML generation so that links with the '#' character can be
+opened by Mozilla Firefox correctly.
+
+- Added new options to generate links to LXR server instead of local 
+file system. The new options are :
+"-x" -- specify URL of LXR site
+"-r" -- specify LXR version
+
+Example : codescanner -x http://some.lxr.server/sources/ -r S60_3_2_12
+C:\sources C:\results
+
+Once scanning is completed, the results will point to the remote 
+LXR server instead of the local "C:\sources" folder.
+*****This new feature has been contributed by James Uther of Nokia*****
+
+
+Version 2.0.2
+=============
+- Updated HTML generation so that source file links can be opened by
+Mozilla Firefox.
+
+- Improved handling of function parameter list spanning multiple lines.
+Example :
+void CMenuBar::MyMenu (const HBufC* a,
+                       const TDesC& b)
+{ ... }
+
+- Improved handling of TRAP block spanning multiple lines.
+Example :
+  TRAPD(
+    err,
+    WaitDialogL(aErrorCode)
+  );
+
+- Updated handling of NULL equality check to allow comparison with NULL
+in return statement. 
+Example :
+  return (ptr != NULL);
+
+- Updated handling of hard-coded numbers so that '2' is no longer 
+considered a 'magic number'.
+
+
+Version 2.0.1b
+==============
+- When checking for leaving functions called in non-leaving functions,
+Cases where macros are used for class declarations are now filtered out.
+Example :
+NONSHARABLE_CLASS(CMyClass) : public CActive 
+{ ... }
+
+- When generating individual component report, text containing HTML tags
+(eg. <s>, <i>) are now cleaned up before written to file. This
+prevents unintended text formatting.
+
+- Corrected spelling mistake in usage info.
+
+
+Version 2.0.0a
+==============
+- This is the first development release of Nokia's version of CodeScanner CLI. 
+Our goals for this release are to :
+1) support feature-functions available in Mobile Innovation's CodeScanner v 1.11
+2) address reported issues
+
+The following are known issues from CodeScanner v 1.11 :
+1) CodeScanner output is not entirely compatible with Mozilla Firefox. 
+For security reasons, Mozila Firefox and Mozilla Suite do not allow links to 
+local files (and directories). This includes linking to files on the hard drive, 
+on mapped network drives, and those accessible via UNC paths.
+2) CodeScanner treats 2 as a ‘magic number’. In User Interface code, '2' is 
+often used to calculate offsets and should not always be replaced by variable.
+3) CodeScanner does not ignore CleanupStack::Pop() without parameters 
+if CleanupClosePushL() or similar utility is used.
+4) CodeScanner flags all use of #if in .h files irrespective of context.
+
+Licensing Notes
+===============
+CodeScanner is built with Python 2.5.1 but does NOT use any of the following
+files or modules :
+python2.5-2.5.1/Lib/test/decimaltestdata/abs.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/add.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/base.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/clamp.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/compare.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/decimal128.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/decimal32.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/decimal64.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/divide.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/divideint.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/inexact.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/max.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/min.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/minus.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/multiply.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/normalize.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/plus.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/power.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/quantize.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/randomBound32.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/randoms.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/remainder.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/remainderNear.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/rescale.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/rounding.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/samequantum.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/squareroot.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/subtract.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/testall.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/tointegral.decTest 
+/Demo/curses/tclock.py python2.5-2.5.1/Modules/expat/ascii.h 
+python2.5-2.5.1/Modules/expat/asciitab.h 
+python2.5-2.5.1/Modules/expat/expat.h 
+python2.5-2.5.1/Modules/expat/expat_external.h 
+python2.5-2.5.1/Modules/expat/iasciitab.h 
+python2.5-2.5.1/Modules/expat/latin1tab.h 
+python2.5-2.5.1/Modules/expat/utf8tab.h 
+python2.5-2.5.1/Modules/expat/xmlparse.c 
+python2.5-2.5.1/Modules/expat/xmlrole.c 
+python2.5-2.5.1/Modules/expat/xmlrole.h 
+python2.5-2.5.1/Modules/expat/xmltok.c 
+python2.5-2.5.1/Modules/expat/xmltok.h 
+python2.5-2.5.1/Modules/expat/xmltok_impl.c 
+python2.5-2.5.1/Modules/expat/xmltok_impl.h 
+python2.5-2.5.1/Doc/html/about.dat 
+python2.5-2.5.1/Doc/html/stdabout.dat 
+python2.5-2.5.1/Modules/expat/pyexpatns.h 
+python2.5-2.5.1/Lib/robotparser.py 
+python2.5-2.5.1/Lib/ctypes/macholib/README.ctypes 
+python2.5-2.5.1/Lib/wsgiref.egg-info
+
+Please refer to the document "python 2_5_1 licenses.txt" for licensing info.
Binary file srcanamdw/codescanner/distcodescanner/unicodedata.pyd has changed
Binary file srcanamdw/codescanner/distcodescanner/win32api.pyd has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/makeGraphics/EncodedFile.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,63 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# #################################################################
+
+import base64
+import zlib
+import os
+
+# #######################################################
+
+class CEncodedFile:
+    def Extract( self, aBaseDirectory ):
+        outputFileHandle = open( os.path.join( aBaseDirectory, self.iFilename ), 'wb' )
+        outputFileBinary = zlib.decompress( base64.decodestring( self.iFileBody ) )
+        outputFileHandle.write( outputFileBinary )
+        outputFileHandle.close()
+
+	iFilename = ""
+	iFileBody = ""
+
+# #######################################################
+
+class CEncodedFileList:
+    def AddEncodedFile( self, aEncodedFile ):
+        # we can't have same different files in here with the same name
+        # relative path bits should be fine
+        self.iEncodedFileList[ aEncodedFile.iFilename.lower() ] = aEncodedFile
+
+    def ExtractEncodedFile( self, aFilename, aBaseDirectory ):
+        # look for the filename in our list of files
+        filename = aFilename.lower()
+        if( self.iEncodedFileList.has_key( filename ) ):
+                self.iEncodedFileList[ filename ].Extract( aBaseDirectory )
+                return
+
+    def ExtractAllEncodedFiles( self, aBaseDirectory ):
+        # run through associative array and extract everything
+        for filename in self.iEncodedFileList.keys():
+            self.ExtractEncodedFile( filename, aBaseDirectory )
+
+
+    # declare iEncodedFileList is an associative array
+    iEncodedFileList = {}
+
+# #######################################################
+
+# create array of encoded files
+encodedFileList = CEncodedFileList()
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/makeGraphics/extractor.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,19 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# #################################################################
+
+encodedFileList.ExtractAllEncodedFiles( "." )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/makeGraphics/makeGraphicsScriptFile.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,51 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# #################################################################
+#!/usr/bin/python
+
+import sys
+import base64
+import zlib
+
+# sort out args
+inputFilename = sys.argv[1]
+outputFilename = sys.argv[2]
+
+# read in file
+inputFileHandle = open( inputFilename, 'rb' )
+inputFileBinary = inputFileHandle.read()
+inputFileHandle.close()
+
+
+# apply ZLib compression and then convert to base64
+outputFileBase64 = base64.encodestring( zlib.compress( inputFileBinary ) )
+
+# output to file
+outputFileHandle = open( outputFilename, 'w' )
+outputFileHandle.write( "# ##############################################################\n# " + inputFilename + "\n\n" )
+outputFileHandle.write( "encodedFile = CEncodedFile()\n" );
+outputFileHandle.write( "encodedFile.iFilename = \"" + inputFilename + "\"\n" )
+outputFileHandle.write( "encodedFile.iFileBody = \"\"\"\n" )
+outputFileHandle.write( outputFileBase64 )
+outputFileHandle.write( "\"\"\"\n\n" )
+outputFileHandle.write( "encodedFileList.AddEncodedFile( encodedFile )\n\n" )
+outputFileHandle.write( "# ##############################################################\n\n\n" )
+
+
+outputFileHandle.close()
+
+
Binary file srcanamdw/codescanner/makeGraphics/mi_codescanner.jpg has changed
Binary file srcanamdw/codescanner/makeGraphics/mi_logo.jpg has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/makeGraphics/test.bat	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,45 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem 
+@rem Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+@rem 
+@rem * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+@rem * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+@rem * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+@rem 
+@rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+@rem THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+@rem BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+@rem SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+@rem CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.@rem
+@rem
+@echo off
+
+
+echo delete left overs
+del test_*
+
+echo make test cases
+copy mi_codescanner.jpg test_codescanner.jpg
+copy mi_logo.jpg        test_logo.jpg
+
+makeGraphicsScriptFile.py test_codescanner.jpg test_codescanner.py
+makeGraphicsScriptFile.py test_logo.jpg test_logo.py
+
+dir test_* /b
+pause
+
+del test_*.jpg
+
+
+echo build embedded script
+cat EncodedFile.py test_codescanner.py test_logo.py extractor.py > images.py
+
+echo run script
+images.py
+
+
+echo verify files
+diff mi_codescanner.jpg test_codescanner.jpg
+diff mi_logo.jpg        test_logo.jpg
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/new_cs_config.xml	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,192 @@
+<!-- This is a configuration file for Codescanner from Nokia. -->
+
+<codescannerConfig>
+
+	<arguments>
+		<!-- Arguments being passed to CodeScanner -->
+
+		<outputformat>html</outputformat>
+		<timestampedoutput>on</timestampedoutput>
+	</arguments>
+
+	<sources>
+		<!-- Source files matching any of the exclude patterns below will not be scanned -->
+
+		<exclude>.*\.au</exclude>
+		<exclude>.*\.avi</exclude>
+		<exclude>.*\.bat</exclude>
+		<exclude>.*\.bin</exclude>
+		<exclude>.*\.bmp</exclude>
+		<exclude>.*\.cmd</exclude>
+		<exclude>.*\.dll</exclude>
+		<exclude>.*\.doc</exclude>
+		<exclude>.*\.exe</exclude>
+		<exclude>.*\.gif</exclude>
+		<exclude>.*\.jpg</exclude>
+		<exclude>.*\.lib</exclude>
+		<exclude>.*\.log</exclude>
+		<exclude>.*\.mbm</exclude>
+		<exclude>.*\.mp3</exclude>
+		<exclude>.*\.mpg</exclude>
+		<exclude>.*\.png</exclude>
+		<exclude>.*\.raw</exclude>
+		<exclude>.*\.rtf</exclude>
+		<exclude>.*\.tif</exclude>
+		<exclude>.*\.wav</exclude>
+		<exclude>.*\.wbmp</exclude>
+		<exclude>.*\.wmf</exclude>
+		<exclude>.*\.xls</exclude>
+		<exclude>.*\.zip</exclude>
+	</sources>
+
+	<scripts>
+		<!-- Every element in this section corresponds to a Codescanner script -->
+		<!-- Every element has the following common attributes: -->
+		<!--    category="canpanic", "codereview", "codingstandards", -->
+		<!--             "documentation", "functionality", "legal", -->
+		<!--             "localisation", "other", "panic" or "perfromance" -->
+		<!--    enable="true" or "false" -->
+		<!--	severity="high", "medium" or "low" -->
+		<!-- Some scripts have additional attributes or elements. -->
+
+		<accessArrayElementWithoutCheck category="codereview" enable="true" severity="low"/>
+		<accessArrayElementWithoutCheck2 category="codereview" enable="true" severity="low"/>
+		<activestart category="codereview" enable="true" severity="low"/>
+		<activestop category="codereview" enable="true" severity="low"/>
+		<arraypassing category="performance" enable="true" severity="medium"/>
+		<arrayptrcleanup category="codereview" enable="true" severity="low"/>
+		<assertdebuginvariant category="codingstandards" enable="true" severity="low"/>
+		<baddefines category="codingstandards" enable="true" severity="low"/>
+		<baseconstruct category="codereview" enable="true" severity="low"/>
+		<callActiveObjectWithoutCheckingOrStopping category="codereview" enable="true" severity="low"/>
+		<changenotification category="codereview" enable="true" severity="low"/>
+		<cleanup category="codingstandards" enable="true" severity="low"/>
+		<commentcode category="codereview" enable="true" severity="low"/>
+		<connect category="canpanic" enable="true" severity="high"/>
+		<ConnectAndDontCloseMemberVariable category="functionality" enable="true" severity="medium"/>
+		<constnames category="codingstandards" enable="true" severity="low"/>
+		<consttdescptr category="codingstandards" enable="true" severity="low"/>
+		<controlornull category="canpanic" enable="true" severity="high"/>
+		<crepository category="other" enable="true" severity="low"/>
+		<ctltargettype category="functionality" enable="true" severity="medium"/>
+		<customizableicons category="other" enable="true" severity="low">
+			<iconsRE></iconsRE>
+		</customizableicons>
+		<debugrom category="performance" enable="true" severity="medium"/>
+		<declarename category="codingstandards" enable="true" severity="low"/>
+		<deleteMemberVariable category="canpanic" enable="true" severity="high"/>
+		<destructor category="canpanic" enable="true" severity="high"/>
+		<doubleSemiColon category="codereview" enable="true" severity="low"/>
+		<driveletters category="codingstandards" enable="true" severity="low"/>
+		<eikbuttons category="localisation" enable="true" severity="medium"/>
+		<eikonenvstatic category="performance" enable="true" severity="medium"/>
+		<enummembers category="codingstandards" enable="true" severity="low"/>
+		<enumnames category="codingstandards" enable="true" severity="low"/>
+		<exportinline category="functionality" enable="true" severity="medium"/>
+		<exportpurevirtual category="functionality" enable="true" severity="medium"/>
+		<flags category="other" enable="true" severity="low"/>
+		<foff category="codereview" enable="true" severity="low"/>
+		<forbiddenwords category="codingstandards" enable="true" severity="low">
+			<wordsRE>Typhoon|Hurricane|HelloWorld|Calypso|Rubik|Epoc|Nokia Mobile Phones|NMP|Mobile Innovation|(^|\s)S90|(^|\s)S80|(^|\s)S60</wordsRE>
+		</forbiddenwords>
+		<forgottoputptroncleanupstack category="codereview" enable="true" severity="low"/>
+		<friend category="codereview" enable="true" severity="low"/>
+		<goto category="codingstandards" enable="true" severity="low"/>
+		<ifassignments category="codingstandards" enable="true" severity="low"/>
+		<ifpreprocessor category="codingstandards" enable="true" severity="low"/>
+		<inheritanceorder category="canpanic" enable="true" severity="high"/>
+		<intleaves category="codereview" enable="true" severity="low"/>
+		<jmp category="codingstandards" enable="true" severity="low"/>
+		<leave category="canpanic" enable="true" severity="high"/>
+		<LeaveNoError category="functionality" enable="true" severity="medium"/>
+		<leavingoperators category="codereview" enable="true" severity="low"/>
+		<LFunctionCantLeave category="codereview" enable="true" severity="low">
+			<LFunctionIgnoreRE>RunL</LFunctionIgnoreRE>
+		</LFunctionCantLeave>
+		<longlines category="codingstandards" enable="true" length="160" severity="low"/>
+		<magicnumbers category="codingstandards" enable="true" severity="low"/>
+		<mclassdestructor category="codingstandards" enable="true" severity="low"/>
+		<memberlc category="canpanic" enable="true" severity="high"/>
+		<membervariablecallld category="codingstandards" enable="true" severity="low"/>
+		<missingcancel category="codingstandards" enable="true" severity="low"/>
+		<missingcclass category="canpanic" enable="true" severity="high">
+			<cclassIgnoreRE>CBase</cclassIgnoreRE>
+		</missingcclass>
+		<mmpsourcepath category="codingstandards" enable="true" severity="low"/>
+		<multilangrsc category="codereview" enable="true" severity="low"/>
+		<multipledeclarations category="codingstandards" enable="true" severity="low"/>
+		<multipleinheritance category="functionality" enable="true" severity="medium"/>
+		<mydocs category="functionality" enable="true" severity="medium"/>
+		<namespace category="codingstandards" enable="true" severity="low"/>
+		<newlreferences category="codingstandards" enable="true" severity="low"/>
+		<noleavetrap category="codereview" enable="true" severity="low"/>
+		<nonconsthbufc category="codingstandards" enable="true" severity="low"/>
+		<nonconsttdesc category="codingstandards" enable="true" severity="low"/>
+		<nonleavenew category="codereview" enable="true" severity="low"/>
+		<nonunicodeskins category="codereview" enable="true" severity="low"/>
+		<null category="codingstandards" enable="true" severity="low"/>
+		<open category="canpanic" enable="true" severity="high">
+			<openIgnoreRE>RDesReadStream|RDesWriteStream</openIgnoreRE>
+		</open>
+		<pointertoarrays category="performance" enable="true" severity="medium"/>
+		<pragmadisable category="codingstandards" enable="true" severity="low"/>
+		<pragmamessage category="codingstandards" enable="true" severity="low"/>
+		<pragmaother category="codereview" enable="true" severity="low"/>
+		<privateinheritance category="codingstandards" enable="true" severity="low"/>
+		<pushaddrvar category="canpanic" enable="true" severity="high"/>
+		<pushmember category="canpanic" enable="true" severity="high"/>
+		<readresource category="canpanic" enable="true" severity="high"/>
+		<resourcenotoncleanupstack category="codereview" enable="true" severity="low"/>
+		<resourcesonheap category="codingstandards" enable="true" severity="low"/>
+		<returndescriptoroutofscope category="canpanic" enable="true" severity="high"/>
+		<rfs category="codereview" enable="true" severity="low"/>
+		<rssnames category="codereview" enable="true" severity="low"/>
+		<stringliterals category="codingstandards" enable="true" severity="low"/>
+		<stringsinresourcefiles category="codereview" enable="true" severity="low"/>
+		<struct category="codingstandards" enable="true" severity="low"/>
+		<tcclasses category="functionality" enable="true" severity="medium"/>
+		<tclassdestructor category="codingstandards" enable="true" severity="low"/>
+		<todocomments category="codereview" enable="true" severity="low"/>
+		<trapcleanup category="panic" enable="true" severity="high"/>
+		<trapeleave category="performance" enable="true" severity="medium"/>
+		<traprunl category="codingstandards" enable="true" severity="low"/>
+		<trspassing category="functionality" enable="true" severity="medium"/>
+		<uids category="codereview" enable="true" severity="low"/>
+		<uncompressedaif category="performance" enable="true" severity="medium"/>
+		<uncompressedbmp category="performance" enable="true" severity="medium"/>
+		<unicodesource category="codereview" enable="true" severity="low"/>
+		<userafter category="performance" enable="true" severity="medium"/>
+		<userfree category="codereview" enable="true" severity="low"/>
+		<userWaitForRequest category="codereview" enable="true" severity="low"/>
+		<variablenames category="codingstandards" enable="true" severity="low"/>
+		<voidparameter category="codingstandards" enable="true" severity="low"/>
+		<worryingcomments category="codereview" enable="true" severity="low">
+			<worryRE>\!|\?|[Zz]{3}|kludge|workaround|\scrap|hack</worryRE>
+		</worryingcomments>
+	</scripts>
+
+	<severities>
+		<!-- Group scripts based on severity level: -->
+		<!--    enable="true" or "false" -->
+
+		<high enable="true"/>
+		<medium enable="true"/>
+		<low enable="true"/>
+	</severities>
+
+	<categories>
+		<!-- Group scripts based on category: -->
+		<!--    enable="true" or "false" -->
+
+		<canpanic enable="true"/>
+		<codereview enable="true"/>
+		<codingstandards enable="true"/>
+		<documentation enable="true"/>
+		<functionality enable="true"/>
+		<legal enable="true"/>
+		<localisation enable="true"/>
+		<other enable="true"/>
+		<panic enable="true"/>
+		<performance enable="true"/>
+	</categories>
+</codescannerConfig>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/ArchiveViewer.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,155 @@
+#! /usr/bin/env python
+# Viewer for archives packaged by archive.py
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+import archive
+import carchive
+import sys, string, tempfile, os
+try:
+    import zlib
+except ImportError:
+    zlib = archive.DummyZlib()
+import pprint
+
+stack = []
+cleanup = []
+
+def main():
+    global stack
+    name = sys.argv[1]
+    arch = getArchive(name)
+    stack.append((name, arch))
+    show(name, arch)
+
+    while 1:
+        toks = string.split(raw_input('? '), ' ', 1)
+        if not toks:
+            usage()
+            continue
+        if len(toks) == 1:
+            cmd = toks[0]
+            arg = ''
+        else:
+            cmd, arg = toks
+        cmd = string.upper(cmd)
+        if cmd == 'U':
+            if len(stack) > 1:
+                arch = stack[-1][1]
+                arch.lib.close()
+                del stack[-1]
+            nm, arch = stack[-1]
+            show(nm, arch)
+        elif cmd == 'O':
+            if not arg:
+                arg = raw_input('open name? ')
+            arg = string.strip(arg)
+            arch = getArchive(arg)
+            if arch is None:
+                print arg, "not found"
+                continue
+            stack.append((arg, arch))
+            show(arg, arch)
+        elif cmd == 'X':
+            if not arg:
+                arg = raw_input('extract name? ')
+            arg = string.strip(arg)
+            data = getData(arg, arch)
+            if data is None:
+                print "Not found"
+                continue
+            fnm = raw_input('to filename? ')
+            if not fnm:
+                print `data`
+            else:
+                open(fnm, 'wb').write(data)
+        elif cmd == 'Q':
+            break
+        else:
+            usage()
+    for (nm, arch) in stack:
+        arch.lib.close()
+    stack = []
+    for fnm in cleanup:
+        try:
+            os.remove(fnm)
+        except Exception, e:
+            print "couldn't delete", fnm, e.args
+def usage():
+    print "U: go Up one level"
+    print "O <nm>: open embedded archive nm"
+    print "X <nm>: extract nm"
+    print "Q: quit"
+def getArchive(nm):
+    if not stack:
+        if string.lower(nm[-4:]) == '.pyz':
+            return ZlibArchive(nm)
+        return carchive.CArchive(nm)
+    parent = stack[-1][1]
+    try:
+        return parent.openEmbedded(nm)
+    except KeyError, e:
+        return None
+    except (ValueError, RuntimeError):
+        ndx = parent.toc.find(nm)
+        dpos, dlen, ulen, flag, typcd, nm = parent.toc[ndx]
+        x, data = parent.extract(ndx)
+        tfnm = tempfile.mktemp()
+        cleanup.append(tfnm)
+        open(tfnm, 'wb').write(data)
+        if typcd == 'z':
+            return ZlibArchive(tfnm)
+        else:
+            return carchive.CArchive(tfnm)
+
+def getData(nm, arch):
+    if type(arch.toc) is type({}):
+        (ispkg, pos, lngth) = arch.toc.get(nm, (0, None, 0))
+        if pos is None:
+            return None
+        arch.lib.seek(arch.start + pos)
+        return zlib.decompress(arch.lib.read(lngth))
+    ndx = arch.toc.find(nm)
+    dpos, dlen, ulen, flag, typcd, nm = arch.toc[ndx]
+    x, data = arch.extract(ndx)
+    return data
+
+def show(nm, arch):
+    if type(arch.toc) == type({}):
+        print " Name: (ispkg, pos, len)"
+        toc = arch.toc
+    else:
+        print " pos, length, uncompressed, iscompressed, type, name"
+        toc = arch.toc.data
+    pprint.pprint(toc)
+
+class ZlibArchive(archive.ZlibArchive):
+    def checkmagic(self):
+        """ Overridable.
+            Check to see if the file object self.lib actually has a file
+            we understand.
+        """
+        self.lib.seek(self.start)	#default - magic is at start of file
+        if self.lib.read(len(self.MAGIC)) != self.MAGIC:
+            raise RuntimeError, "%s is not a valid %s archive file" \
+              % (self.path, self.__class__.__name__)
+        if self.lib.read(len(self.pymagic)) != self.pymagic:
+            print "Warning: pyz is from a different Python version"
+        self.lib.read(4)
+
+if __name__ == '__main__':
+    main()
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/Build.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,843 @@
+#! /usr/bin/env python
+# Build packages using spec files
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 1999, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+import sys, os, shutil, mf, archive, iu, carchive, pprint, time, py_compile, bindepend, tempfile
+
+STRINGTYPE = type('')
+TUPLETYPE = type((None,))
+
+HOMEPATH = os.path.dirname(sys.argv[0])
+SPECPATH = None
+BUILDPATH = None
+WARNFILE = None
+rthooks = {}
+iswin = sys.platform[:3] == 'win'
+cygwin = sys.platform == 'cygwin'
+try:
+    config = eval(open(os.path.join(HOMEPATH, 'config.dat'), 'r').read())
+except IOError:
+    print "You must run Configure.py before building!"
+    sys.exit(1)
+
+if config['pythonVersion'] != sys.version:
+    print "The current version of Python is not the same with which PyInstaller was configured."
+    print "Please re-run Configure.py with this version."
+    sys.exit(1)
+
+if config['hasRsrcUpdate']:
+    import icon, versionInfo
+
+def setupUPXFlags():
+    f = os.environ.get("UPX", "")
+    is24 = hasattr(sys, "version_info") and sys.version_info[:2] >= (2,4)
+    if iswin and is24:
+        # Binaries built with Visual Studio 7.1 require --strip-loadconf
+        # or they won't compress. Configure.py makes sure that UPX is new
+        # enough to support --strip-loadconf.
+        f = "--strip-loadconf " + f
+    f = "--best " + f
+    os.environ["UPX"] = f
+
+if config['hasUPX']:
+    setupUPXFlags()
+
+def build(spec):
+    global SPECPATH, BUILDPATH, WARNFILE, rthooks
+    rthooks = eval(open(os.path.join(HOMEPATH, 'rthooks.dat'), 'r').read())
+    SPECPATH, specnm = os.path.split(spec)
+    specnm = os.path.splitext(specnm)[0]
+    if SPECPATH == '':
+        SPECPATH = os.getcwd()
+    WARNFILE = os.path.join(SPECPATH, 'warn%s.txt' % specnm)
+    BUILDPATH = os.path.join(SPECPATH, 'build%s' % specnm)
+    if '-o' in sys.argv:
+        bpath = sys.argv[sys.argv.index('-o')+1]
+        if os.path.isabs(bpath):
+            BUILDPATH = bpath
+        else:
+            BUILDPATH = os.path.join(SPECPATH, bpath)
+    if not os.path.exists(BUILDPATH):
+        os.mkdir(BUILDPATH)
+    exec open(spec, 'r').read()+'\n'
+
+def mtime(fnm):
+    try:
+        return os.stat(fnm)[8]
+    except:
+        return 0
+
+class Target:
+    invcnum = 0
+    def __init__(self):
+        self.invcnum = Target.invcnum
+        Target.invcnum = Target.invcnum + 1
+        self.out = os.path.join(BUILDPATH, 'out%d.toc' % self.invcnum)
+        self.dependencies = TOC()
+    def __postinit__(self):
+        print "checking %s" % (self.__class__.__name__,)
+        if self.check_guts(mtime(self.out)):
+            self.assemble()
+
+class Analysis(Target):
+    def __init__(self, scripts=None, pathex=None, hookspath=None, excludes=None):
+        Target.__init__(self)
+        self.inputs = scripts
+        for script in scripts:
+            if not os.path.exists(script):
+                raise ValueError, "script '%s' not found" % script
+        self.pathex = []
+        if pathex:
+            for path in pathex:
+                self.pathex.append(os.path.abspath(os.path.normpath(path)))
+        self.hookspath = hookspath
+        self.excludes = excludes
+        self.scripts = TOC()
+        self.pure = TOC()
+        self.binaries = TOC()
+        self.__postinit__()
+    def check_guts(self, last_build):
+        outnm = os.path.basename(self.out)
+        if last_build == 0:
+            print "building %s because %s non existent" % (self.__class__.__name__, outnm)
+            return 1
+        for fnm in self.inputs:
+            if mtime(fnm) > last_build:
+                print "building because %s changed" % fnm
+                return 1
+        try:
+            inputs, pathex, hookspath, excludes, scripts, pure, binaries = eval(open(self.out, 'r').read())
+        except:
+            print "building because %s disappeared" % outnm
+            return 1
+        if inputs != self.inputs:
+            print "building %s because inputs changed" % outnm
+            return 1
+        if pathex != self.pathex:
+            print "building %s because pathex changed" % outnm
+            return 1
+        if hookspath != self.hookspath:
+            print "building %s because hookspath changed" % outnm
+            return 1
+        if excludes != self.excludes:
+            print "building %s because excludes changed" % outnm
+            return 1
+        for (nm, fnm, typ) in scripts:
+            if mtime(fnm) > last_build:
+                print "building because %s changed" % fnm
+                return 1
+        for (nm, fnm, typ) in pure:
+            if mtime(fnm) > last_build:
+                print "building because %s changed" % fnm
+                return 1
+            elif mtime(fnm[:-1]) > last_build:
+                print "building because %s changed" % fnm[:-1]
+                return 1
+        for (nm, fnm, typ) in binaries:
+            if mtime(fnm) > last_build:
+                print "building because %s changed" % fnm
+                return 1
+        self.scripts = TOC(scripts)
+        self.pure = TOC(pure)
+        self.binaries = TOC(binaries)
+        return 0
+    def assemble(self):
+        print "running Analysis", os.path.basename(self.out)
+        paths = self.pathex
+        for i in range(len(paths)):
+            paths[i] = os.path.abspath(os.path.normpath(paths[i]))
+        dirs = {}
+        pynms = []
+        for script in self.inputs:
+            if not os.path.exists(script):
+                print "Analysis: script %s not found!" % script
+                sys.exit(1)
+            d, base = os.path.split(script)
+            if not d:
+                d = os.getcwd()
+            d = os.path.abspath(os.path.normpath(d))
+            pynm, ext = os.path.splitext(base)
+            dirs[d] = 1
+            pynms.append(pynm)
+        analyzer = mf.ImportTracker(dirs.keys()+paths, self.hookspath, self.excludes)
+        #print analyzer.path
+        scripts = []
+        for i in range(len(self.inputs)):
+            script = self.inputs[i]
+            print "Analyzing:", script
+            analyzer.analyze_script(script)
+            scripts.append((pynms[i], script, 'PYSOURCE'))
+        pure = []
+        binaries = []
+        rthooks = []
+        for modnm, mod in analyzer.modules.items():
+            if mod is not None:
+                hooks = findRTHook(modnm)  #XXX
+                if hooks:
+                    rthooks.extend(hooks)
+                if isinstance(mod, mf.BuiltinModule):
+                    pass
+                else:
+                    fnm = mod.__file__
+                    if isinstance(mod, mf.ExtensionModule):
+                        binaries.append((mod.__name__, fnm, 'EXTENSION'))
+                    elif modnm == '__main__':
+                        pass
+                    else:
+                        pure.append((modnm, fnm, 'PYMODULE'))
+        binaries.extend(bindepend.Dependencies(binaries))
+        scripts[1:1] = rthooks
+        self.scripts = TOC(scripts)
+        self.pure = TOC(pure)
+        self.binaries = TOC(binaries)
+        try:
+            oldstuff = eval(open(self.out, 'r').read())
+        except:
+            oldstuff = None
+        if oldstuff != (self.inputs, self.pathex, self.hookspath, self.excludes, scripts, pure, binaries):
+            outf = open(self.out, 'w')
+            pprint.pprint(
+                (self.inputs, self.pathex, self.hookspath, self.excludes, self.scripts, self.pure, self.binaries),
+                outf)
+            outf.close()
+            wf = open(WARNFILE, 'w')
+            for ln in analyzer.getwarnings():
+                wf.write(ln+'\n')
+            wf.close()
+            print "Warnings written to %s" % WARNFILE
+            return 1
+        print self.out, "no change!"
+        return 0
+
+def findRTHook(modnm):
+    hooklist = rthooks.get(modnm)
+    if hooklist:
+        rslt = []
+        for script in hooklist:
+            nm = os.path.basename(script)
+            nm = os.path.splitext(nm)[0]
+            if os.path.isabs(script):
+                path = script
+            else:
+                path = os.path.join(HOMEPATH, script)
+            rslt.append((nm, path, 'PYSOURCE'))
+        return rslt
+    return None
+
+class PYZ(Target):
+    typ = 'PYZ'
+    def __init__(self, toc, name=None, level=9):
+        Target.__init__(self)
+        self.toc = toc
+        self.name = name
+        if name is None:
+            self.name = self.out[:-3] + 'pyz'
+        if config['useZLIB']:
+            self.level = level
+        else:
+            self.level = 0
+        self.dependencies = config['PYZ_dependencies']
+        self.__postinit__()
+    def check_guts(self, last_build):
+        outnm = os.path.basename(self.out)
+        if not os.path.exists(self.name):
+            print "rebuilding %s because %s is missing" % (outnm, os.path.basename(self.name))
+            return 1
+        try:
+            name, level, toc = eval(open(self.out, 'r').read())
+        except:
+            print "rebuilding %s because missing" % outnm
+            return 1
+        if name != self.name:
+            print "rebuilding %s because name changed" % outnm
+            return 1
+        if level != self.level:
+            print "rebuilding %s because level changed" % outnm
+            return 1
+        if toc != self.toc:
+            print "rebuilding %s because toc changed" % outnm
+            return 1
+        for (nm, fnm, typ) in toc:
+            if mtime(fnm) > last_build:
+                print "rebuilding %s because %s changed" % (outnm, fnm)
+                return 1
+            if fnm[-1] in ('c', 'o'):
+                if mtime(fnm[:-1]) > last_build:
+                    print "rebuilding %s because %s changed" % (outnm, fnm[:-1])
+                    return 1
+        return 0
+    def assemble(self):
+        print "building PYZ", os.path.basename(self.out)
+        pyz = archive.ZlibArchive(level=self.level)
+        toc = self.toc - config['PYZ_dependencies']
+        for (nm, fnm, typ) in toc:
+            if mtime(fnm[:-1]) > mtime(fnm):
+                py_compile.compile(fnm[:-1])
+        pyz.build(self.name, toc)
+        outf = open(self.out, 'w')
+        pprint.pprint((self.name, self.level, self.toc), outf)
+        outf.close()
+        return 1
+
+def checkCache(fnm, strip, upx):
+    if not strip and not upx:
+        return fnm
+    if strip:
+        strip = 1
+    else:
+        strip = 0
+    if upx:
+        upx = 1
+    else:
+        upx = 0
+    cachedir = os.path.join(HOMEPATH, 'bincache%d%d' %  (strip, upx))
+    if not os.path.exists(cachedir):
+        os.makedirs(cachedir)
+    basenm = os.path.basename(fnm)
+    cachedfile = os.path.join(cachedir, basenm )
+    if os.path.exists(cachedfile):
+        if mtime(fnm) > mtime(cachedfile):
+            os.remove(cachedfile)
+        else:
+            return cachedfile
+    if upx:
+        if strip:
+            fnm = checkCache(fnm, 1, 0)
+        cmd = "upx --best -q \"%s\"" % cachedfile
+    else:
+        cmd = "strip \"%s\"" % cachedfile
+    shutil.copy2(fnm, cachedfile)
+    os.chmod(cachedfile, 0755)
+    os.system(cmd)
+    return cachedfile
+
+UNCOMPRESSED, COMPRESSED = range(2)
+class PKG(Target):
+    typ = 'PKG'
+    xformdict = {'PYMODULE' : 'm',
+                 'PYSOURCE' : 's',
+                 'EXTENSION' : 'b',
+                 'PYZ' : 'z',
+                 'PKG' : 'a',
+                 'DATA': 'x',
+                 'BINARY': 'b',
+                 'EXECUTABLE': 'b'}
+    def __init__(self, toc, name=None, cdict=None, exclude_binaries=0,
+                 strip_binaries=0, upx_binaries=0):
+        Target.__init__(self)
+        self.toc = toc
+        self.cdict = cdict
+        self.name = name
+        self.exclude_binaries = exclude_binaries
+        self.strip_binaries = strip_binaries
+        self.upx_binaries = upx_binaries
+        if name is None:
+            self.name = self.out[:-3] + 'pkg'
+        if self.cdict is None:
+            if config['useZLIB']:
+                self.cdict = {'EXTENSION':COMPRESSED,
+                              'DATA':COMPRESSED,
+                              'BINARY':COMPRESSED,
+                              'EXECUTABLE':COMPRESSED,
+                              'PYSOURCE':COMPRESSED,
+                              'PYMODULE':COMPRESSED }
+            else:
+                self.cdict = { 'PYSOURCE':UNCOMPRESSED }
+        self.__postinit__()
+    def check_guts(self, last_build):
+        outnm = os.path.basename(self.out)
+        if not os.path.exists(self.name):
+            print "rebuilding %s because %s is missing" % (outnm, os.path.basename(self.name))
+            return 1
+        try:
+            name, cdict, toc, exclude_binaries, strip_binaries, upx_binaries = eval(open(self.out, 'r').read())
+        except:
+            print "rebuilding %s because %s is missing" % (outnm, outnm)
+            return 1
+        if name != self.name:
+            print "rebuilding %s because name changed" % outnm
+            return 1
+        if cdict != self.cdict:
+            print "rebuilding %s because cdict changed" % outnm
+            return 1
+        if toc != self.toc:
+            print "rebuilding %s because toc changed" % outnm
+            return 1
+        if exclude_binaries != self.exclude_binaries:
+            print "rebuilding %s because exclude_binaries changed" % outnm
+            return 1
+        if strip_binaries != self.strip_binaries:
+            print "rebuilding %s because strip_binaries changed" % outnm
+            return 1
+        if upx_binaries != self.upx_binaries:
+            print "rebuilding %s because upx_binaries changed" % outnm
+            return 1
+        for (nm, fnm, typ) in toc:
+            if mtime(fnm) > last_build:
+                print "rebuilding %s because %s changed" % (outnm, fnm)
+                return 1
+        return 0
+    def assemble(self):
+        print "building PKG", os.path.basename(self.name)
+        trash = []
+        mytoc = []
+        toc = TOC()
+        for item in self.toc:
+            inm, fnm, typ = item
+            if typ == 'EXTENSION':
+                binext = os.path.splitext(fnm)[1]
+                if not os.path.splitext(inm)[1] == binext:
+                    inm = inm + binext
+            toc.append((inm, fnm, typ))
+        seen = {}
+        for inm, fnm, typ in toc:
+            if typ in ('BINARY', 'EXTENSION'):
+                if self.exclude_binaries:
+                    self.dependencies.append((inm, fnm, typ))
+                else:
+                    fnm = checkCache(fnm, self.strip_binaries,
+                                     self.upx_binaries and ( iswin or cygwin )
+                                      and config['hasUPX'])
+                    # Avoid importing the same binary extension twice. This might
+                    # happen if they come from different sources (eg. once from
+                    # binary dependence, and once from direct import).
+                    if typ == 'BINARY' and seen.has_key(fnm):
+                        continue
+                    seen[fnm] = 1
+                    mytoc.append((inm, fnm, self.cdict.get(typ,0),
+                                  self.xformdict.get(typ,'b')))
+            elif typ == 'OPTION':
+                mytoc.append((inm, '', 0, 'o'))
+            else:
+                mytoc.append((inm, fnm, self.cdict.get(typ,0), self.xformdict.get(typ,'b')))
+        archive = carchive.CArchive()
+        archive.build(self.name, mytoc)
+        outf = open(self.out, 'w')
+        pprint.pprint((self.name, self.cdict, self.toc, self.exclude_binaries, self.strip_binaries, self.upx_binaries), outf)
+        outf.close()
+        for item in trash:
+            os.remove(item)
+        return 1
+
+class ELFEXE(Target):
+    typ = 'EXECUTABLE'
+    exclude_binaries = 0
+    def __init__(self, *args, **kws):
+        Target.__init__(self)
+        self.console = kws.get('console',1)
+        self.debug = kws.get('debug',0)
+        self.name = kws.get('name',None)
+        self.icon = kws.get('icon',None)
+        self.versrsrc = kws.get('version',None)
+        self.strip = kws.get('strip',None)
+        self.upx = kws.get('upx',None)
+        self.exclude_binaries = kws.get('exclude_binaries',0)
+        if self.name is None:
+            self.name = self.out[:-3] + 'exe'
+        if not os.path.isabs(self.name):
+            self.name = os.path.join(SPECPATH, self.name)
+        self.toc = TOC()
+        for arg in args:
+            if isinstance(arg, TOC):
+                self.toc.extend(arg)
+            elif isinstance(arg, Target):
+                self.toc.append((os.path.basename(arg.name), arg.name, arg.typ))
+                self.toc.extend(arg.dependencies)
+            else:
+                self.toc.extend(arg)
+        self.toc.extend(config['EXE_dependencies'])
+        self.pkg = PKG(self.toc, cdict=kws.get('cdict',None), exclude_binaries=self.exclude_binaries,
+                       strip_binaries=self.strip, upx_binaries=self.upx)
+        self.dependencies = self.pkg.dependencies
+        self.__postinit__()
+    def check_guts(self, last_build):
+        outnm = os.path.basename(self.out)
+        if not os.path.exists(self.name):
+            print "rebuilding %s because %s missing" % (outnm, os.path.basename(self.name))
+            return 1
+        try:
+            name, console, debug, icon, versrsrc, strip, upx, mtm = eval(open(self.out, 'r').read())
+        except:
+            print "rebuilding %s because %s missing or bad" % (outnm, outnm)
+            return 1
+        if name != self.name:
+            print "rebuilding %s because name changed" % outnm
+            return 1
+        if console != self.console:
+            print "rebuilding %s because console option changed" % outnm
+            return 1
+        if debug != self.debug:
+            print "rebuilding %s because debug option changed" % outnm
+            return 1
+        if config['hasRsrcUpdate']:
+            if icon != self.icon:
+                print "rebuilding %s because icon option changed" % outnm
+                return 1
+            if versrsrc != self.versrsrc:
+                print "rebuilding %s because versrsrc option changed" % outnm
+                return 1
+        else:
+            if icon or versrsrc:
+                print "ignoring icon and version resources = platform not capable"
+        if strip != self.strip:
+            print "rebuilding %s because strip option changed" % outnm
+            return 1
+        if upx != self.upx:
+            print "rebuilding %s because upx option changed" % outnm
+            return 1
+        if mtm != mtime(self.name):
+            print "rebuilding %s because mtimes don't match" % outnm
+            return 1
+        if mtm < mtime(self.pkg.out):
+            print "rebuilding %s because pkg is more recent" % outnm
+            return 1
+        return 0
+    def _bootloader_postfix(self, exe):
+        if iswin:
+            exe = exe + "_"
+            is24 = hasattr(sys, "version_info") and sys.version_info[:2] >= (2,4)
+            exe = exe + "67"[is24]
+            exe = exe + "rd"[self.debug]
+            exe = exe + "wc"[self.console]
+        else:
+            if not self.console:
+                exe = exe + 'w'
+            if self.debug:
+                exe = exe + '_d'
+        return exe
+    def assemble(self):
+        print "building ELFEXE", os.path.basename(self.out)
+        trash = []
+        outf = open(self.name, 'wb')
+        exe = self._bootloader_postfix('support/loader/run')
+        exe = os.path.join(HOMEPATH, exe)
+        if iswin or cygwin:
+            exe = exe + '.exe'
+        if config['hasRsrcUpdate']:
+            if self.icon:
+                tmpnm = tempfile.mktemp()
+                shutil.copy2(exe, tmpnm)
+                os.chmod(tmpnm, 0755)
+                icon.CopyIcons(tmpnm, self.icon)
+                trash.append(tmpnm)
+                exe = tmpnm
+            if self.versrsrc:
+                tmpnm = tempfile.mktemp()
+                shutil.copy2(exe, tmpnm)
+                os.chmod(tmpnm, 0755)
+                versionInfo.SetVersion(tmpnm, self.versrsrc)
+                trash.append(tmpnm)
+                exe = tmpnm
+        exe = checkCache(exe, self.strip, self.upx and config['hasUPX'])
+        self.copy(exe, outf)
+        self.copy(self.pkg.name, outf)
+        outf.close()
+        os.chmod(self.name, 0755)
+        f = open(self.out, 'w')
+        pprint.pprint((self.name, self.console, self.debug, self.icon, self.versrsrc,
+                       self.strip, self.upx, mtime(self.name)), f)
+        f.close()
+        for item in trash:
+            os.remove(item)
+        return 1
+    def copy(self, fnm, outf):
+        inf = open(fnm, 'rb')
+        while 1:
+            data = inf.read(64*1024)
+            if not data:
+                break
+            outf.write(data)
+
+class DLL(ELFEXE):
+    def assemble(self):
+        print "building DLL", os.path.basename(self.out)
+        outf = open(self.name, 'wb')
+        dll = self._bootloader_postfix('support/loader/inprocsrvr')
+        dll = os.path.join(HOMEPATH, dll)  + '.dll'
+        self.copy(dll, outf)
+        self.copy(self.pkg.name, outf)
+        outf.close()
+        os.chmod(self.name, 0755)
+        f = open(self.out, 'w')
+        pprint.pprint((self.name, self.console, self.debug, self.icon, self.versrsrc,
+                       self.strip, self.upx, mtime(self.name)), f)
+        f.close()
+        return 1
+
+class NonELFEXE(ELFEXE):
+    def assemble(self):
+        print "building NonELFEXE", os.path.basename(self.out)
+        trash = []
+        exe = 'support/loader/run'
+        if not self.console:
+            exe = exe + 'w'
+        if self.debug:
+            exe = exe + '_d'
+        exe = os.path.join(HOMEPATH, exe)
+        exe = checkCache(exe, self.strip, self.upx and config['hasUPX'])
+        shutil.copy2(exe, self.name)
+        os.chmod(self.name, 0755)
+        shutil.copy2(self.pkg.name, self.name+'.pkg')
+        f = open(self.out, 'w')
+        pprint.pprint((self.name, self.console, self.debug, self.icon, self.versrsrc,
+                       self.strip, self.upx, mtime(self.name)), f)
+        f.close()
+        for fnm in trash:
+            os.remove(fnm)
+        return 1
+
+if config['useELFEXE']:
+    EXE = ELFEXE
+else:
+    EXE = NonELFEXE
+
+class COLLECT(Target):
+    def __init__(self, *args, **kws):
+        Target.__init__(self)
+        self.name = kws.get('name',None)
+        if self.name is None:
+            self.name = 'dist_' + self.out[:-4]
+        self.strip_binaries = kws.get('strip',0)
+        self.upx_binaries = kws.get('upx',0)
+        if not os.path.isabs(self.name):
+            self.name = os.path.join(SPECPATH, self.name)
+        self.toc = TOC()
+        for arg in args:
+            if isinstance(arg, TOC):
+                self.toc.extend(arg)
+            elif isinstance(arg, Target):
+                self.toc.append((os.path.basename(arg.name), arg.name, arg.typ))
+                if isinstance(arg, NonELFEXE):
+                    self.toc.append((os.path.basename(arg.name)+'.pkg', arg.name+'.pkg', 'PKG'))
+                self.toc.extend(arg.dependencies)
+            else:
+                self.toc.extend(arg)
+        self.__postinit__()
+    def check_guts(self, last_build):
+        outnm = os.path.basename(self.out)
+        try:
+            name, strip_binaries, upx_binaries, toc = eval(open(self.out, 'r').read())
+        except:
+            print "building %s because %s missing" % (outnm, outnm)
+            return 1
+        if name != self.name:
+            print "building %s because name changed" % outnm
+            return 1
+        if strip_binaries != self.strip_binaries:
+            print "building %s because strip_binaries option changed" % outnm
+            return 1
+        if upx_binaries != self.upx_binaries:
+            print "building %s because upx_binaries option changed" % outnm
+            return 1
+        if toc != self.toc:
+            print "building %s because toc changed" % outnm
+            return 1
+        for inm, fnm, typ in self.toc:
+            if typ == 'EXTENSION':
+                ext = os.path.splitext(fnm)[1]
+                test = os.path.join(self.name, inm+ext)
+            else:
+                test = os.path.join(self.name, os.path.basename(fnm))
+            if not os.path.exists(test):
+                print "building %s because %s is missing" % (outnm, test)
+                return 1
+            if mtime(fnm) > mtime(test):
+                print "building %s because %s is more recent" % (outnm, fnm)
+                return 1
+        return 0
+    def assemble(self):
+        print "building COLLECT", os.path.basename(self.out)
+        if not os.path.exists(self.name):
+            os.mkdir(self.name)
+        toc = TOC()
+        for inm, fnm, typ in self.toc:
+            if typ == 'EXTENSION':
+                binext = os.path.splitext(fnm)[1]
+                if not os.path.splitext(inm)[1] == binext:
+                    inm = inm + binext
+            toc.append((inm, fnm, typ))
+        for inm, fnm, typ in toc:
+            tofnm = os.path.join(self.name, inm)
+            todir = os.path.dirname(tofnm)
+            if not os.path.exists(todir):
+                os.makedirs(todir)
+            if typ in ('EXTENSION', 'BINARY'):
+                fnm = checkCache(fnm, self.strip_binaries,
+                                 self.upx_binaries and ( iswin or cygwin )
+                                  and config['hasUPX'])
+            shutil.copy2(fnm, tofnm)
+            if typ in ('EXTENSION', 'BINARY'):
+                os.chmod(tofnm, 0755)
+        f = open(self.out, 'w')
+        pprint.pprint((self.name, self.strip_binaries, self.upx_binaries, self.toc), f)
+        f.close()
+        return 1
+
+import UserList
+class TOC(UserList.UserList):
+    def __init__(self, initlist=None):
+        UserList.UserList.__init__(self)
+        self.fltr = {}
+        if initlist:
+            for tpl in initlist:
+                self.append(tpl)
+    def append(self, tpl):
+        try:
+            if not self.fltr.get(tpl[0]):
+                self.data.append(tpl)
+                self.fltr[tpl[0]] = 1
+        except TypeError:
+            print "TOC found a %s, not a tuple" % tpl
+            raise
+    def insert(self, pos, tpl):
+        if not self.fltr.get(tpl[0]):
+            self.data.insert(pos, tpl)
+            self.fltr[tpl[0]] = 1
+    def __add__(self, other):
+        rslt = TOC(self.data)
+        rslt.extend(other)
+        return rslt
+    def __radd__(self, other):
+        rslt = TOC(other)
+        rslt.extend(self.data)
+        return rslt
+    def extend(self, other):
+        for tpl in other:
+            self.append(tpl)
+    def __sub__(self, other):
+        fd = self.fltr.copy()
+        # remove from fd if it's in other
+        for tpl in other:
+            if fd.get(tpl[0],0):
+                del fd[tpl[0]]
+        rslt = TOC()
+        # return only those things still in fd (preserve order)
+        for tpl in self.data:
+            if fd.get(tpl[0],0):
+                rslt.append(tpl)
+        return rslt
+    def __rsub__(self, other):
+        rslt = TOC(other)
+        return rslt.__sub__(self)
+    def intersect(self, other):
+        rslt = TOC()
+        for tpl in other:
+            if self.fltr.get(tpl[0],0):
+                rslt.append(tpl)
+        return rslt
+
+class Tree(Target, TOC):
+    def __init__(self, root=None, prefix=None, excludes=None):
+        Target.__init__(self)
+        TOC.__init__(self)
+        self.root = root
+        self.prefix = prefix
+        self.excludes = excludes
+        if excludes is None:
+            self.excludes = []
+        self.__postinit__()
+    def check_guts(self, last_build):
+        outnm = os.path.basename(self.out)
+        try:
+            root, prefix, excludes, toc = eval(open(self.out, 'r').read())
+        except:
+            print "building %s because %s is missing / bad" % (outnm, outnm)
+            return 1
+        if root != self.root:
+            print "building %s because root changed" % outnm
+            return 1
+        if prefix != self.prefix:
+            print "building %s because prefix changed" % outnm
+            return 1
+        if excludes != self.excludes:
+            print "building %s because excludes changed" % outnm
+            return 1
+        stack = [root]
+        while stack:
+            d = stack.pop()
+            if mtime(d) > last_build:
+                print "building %s because directory %s changed" % (outnm, d)
+                return 1
+            for nm in os.listdir(d):
+                path = os.path.join(d, nm)
+                if os.path.isdir(path):
+                    stack.append(path)
+        self.data = toc
+        return 0
+    def assemble(self):
+        print "building Tree", os.path.basename(self.out)
+        stack = [(self.root, self.prefix)]
+        excludes = {}
+        xexcludes = {}
+        for nm in self.excludes:
+            if nm[0] == '*':
+                xexcludes[nm[1:]] = 1
+            else:
+                excludes[nm] = 1
+        rslt = []
+        while stack:
+            dir, prefix = stack.pop()
+            for fnm in os.listdir(dir):
+                if excludes.get(fnm, 0) == 0:
+                    ext = os.path.splitext(fnm)[1]
+                    if xexcludes.get(ext,0) == 0:
+                        fullfnm = os.path.join(dir, fnm)
+                        rfnm = prefix and os.path.join(prefix, fnm) or fnm
+                        if os.path.isdir(fullfnm):
+                            stack.append((fullfnm, rfnm))
+                        else:
+                            rslt.append((rfnm, fullfnm, 'DATA'))
+        try:
+            oldstuff = eval(open(self.out, 'r').read())
+        except:
+            oldstuff = None
+        if oldstuff != (self.root, self.prefix, self.excludes, rslt):
+            outf = open(self.out, 'w')
+            pprint.pprint((self.root, self.prefix, self.excludes, rslt), outf)
+            outf.close()
+            self.data = rslt
+            return 1
+        print self.out, "no change!"
+        return 0
+
+def TkTree():
+    tclroot = config['TCL_root']
+    tclnm = os.path.join('_MEI', os.path.basename(tclroot))
+    tkroot = config['TK_root']
+    tknm = os.path.join('_MEI', os.path.basename(tkroot))
+    tcltree = Tree(tclroot, tclnm, excludes=['demos','encoding','*.lib'])
+    tktree = Tree(tkroot, tknm, excludes=['demos','encoding','*.lib'])
+    return tcltree + tktree
+
+def TkPKG():
+    return PKG(TkTree(), name='tk.pkg')
+
+usage = """\
+Usage: python %s <specfile>
+
+See doc/Tutorial.html for details.
+"""
+
+if __name__ == '__main__':
+    if len(sys.argv) < 2:
+        print usage % sys.argv[0]
+    else:
+        build(sys.argv[1])
+
+
+
+
Binary file srcanamdw/codescanner/pyinstaller/Build.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/Configure.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,244 @@
+#! /usr/bin/env python
+# Configure PyInstaller for the current Python installation.
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+import os, sys, string, shutil
+HOME = os.path.dirname(sys.argv[0])
+iswin = sys.platform[:3] == 'win'
+is24 = hasattr(sys, "version_info") and sys.version_info[:2] >= (2,4)
+cygwin = sys.platform == 'cygwin'
+configfile = os.path.join(HOME, 'config.dat')
+try:
+    config = eval(open(configfile, 'r').read())
+except IOError:
+    config = {'useELFEXE':1}    # if not set by Make.py we can assume Windows
+
+# Save Python version, to detect and avoid conflicts
+config["pythonVersion"] = sys.version
+
+import mf, bindepend
+
+# EXE_dependencies
+print "I: computing EXE_dependencies"
+python = sys.executable
+if not iswin:
+    while os.path.islink(python):
+        python = os.readlink(python)
+        if not os.path.isabs(python):
+            for dir in string.split(os.environ['PATH'], os.pathsep):
+                test = os.path.join(dir, python)
+                if os.path.exists(test):
+                    python = test
+                    break
+toc = bindepend.Dependencies([('', python, '')])
+if iswin and sys.version[:3] == '1.5':
+    import exceptions
+    toc.append((os.path.basename(exceptions.__file__), exceptions.__file__, 'BINARY'))
+config['EXE_dependencies'] = toc[1:]
+
+_useTK = """\
+# Generated by Configure.py
+# This file is public domain
+import os, sys
+try:
+    basedir = os.environ['_MEIPASS2']
+except KeyError:
+    basedir = sys.path[0]
+tcldir = os.path.join(basedir, '_MEI', 'tcl%s')
+tkdir = os.path.join(basedir, '_MEI', 'tk%s')
+os.environ["TCL_LIBRARY"] = tcldir
+os.environ["TK_LIBRARY"] = tkdir
+os.putenv("TCL_LIBRARY", tcldir)
+os.putenv("TK_LIBRARY", tkdir)
+"""
+
+# TCL_root, TK_root and support/useTK.py
+print "I: Finding TCL/TK..."
+if not iswin:
+    saveexcludes = bindepend.excludes
+    bindepend.excludes = {}
+import re
+pattern = [r'libtcl(\d\.\d)?\.so', r'(?i)tcl(\d\d)\.dll'][iswin]
+a = mf.ImportTracker()
+a.analyze_r('Tkinter')
+binaries = []
+for modnm, mod in a.modules.items():
+    if isinstance(mod, mf.ExtensionModule):
+        binaries.append((mod.__name__, mod.__file__, 'EXTENSION'))
+binaries.extend(bindepend.Dependencies(binaries))
+binaries.extend(bindepend.Dependencies([('', sys.executable, '')]))
+for nm, fnm, typ in binaries:
+    mo = re.match(pattern, nm)
+    if mo:
+        ver = mo.group(1)
+        tclbindir = os.path.dirname(fnm)
+        if iswin:
+            ver = ver[0] + '.' + ver[1:]
+        elif ver is None:
+            # we found "libtcl.so.0" so we need to get the version from the lib directory
+            for name in os.listdir(tclbindir):
+                mo = re.match(r'tcl(\d.\d)', name)
+                if mo:
+                    ver = mo.group(1)
+        print "I: found TCL/TK version %s" % ver
+        open(os.path.join(HOME, 'support/useTK.py'), 'w').write(_useTK % (ver, ver))
+        tclnm = 'tcl%s' % ver
+        tknm = 'tk%s' % ver
+        # Linux: /usr/lib with the .tcl files in /usr/lib/tcl8.3 and /usr/lib/tk8.3
+        # Windows: Python21/DLLs with the .tcl files in Python21/tcl/tcl8.3 and Python21/tcl/tk8.3
+        #      or  D:/Programs/Tcl/bin with the .tcl files in D:/Programs/Tcl/lib/tcl8.0 and D:/Programs/Tcl/lib/tk8.0
+        if iswin:
+            for attempt in ['../tcl', '../lib']:
+                if os.path.exists(os.path.join(tclbindir, attempt, tclnm)):
+                    config['TCL_root'] = os.path.join(tclbindir, attempt, tclnm)
+                    config['TK_root'] = os.path.join(tclbindir, attempt, tknm)
+                    break
+        else:
+            config['TCL_root'] = os.path.join(tclbindir, tclnm)
+            config['TK_root'] = os.path.join(tclbindir, tknm)
+        break
+else:
+    print "I: could not find TCL/TK"
+if not iswin:
+    bindepend.excludes = saveexcludes
+
+#useZLIB
+print "I: testing for Zlib..."
+try:
+    import zlib
+except ImportError:
+    config['useZLIB'] = 0
+    print 'I: ... Zlib unavailable'
+else:
+    config['useZLIB'] = 1
+    print 'I: ... Zlib available'
+
+#hasRsrcUpdate
+if iswin:
+    # only available on windows
+    print "I: Testing for ability to set icons, version resources..."
+    try:
+        import win32api, icon, versionInfo
+    except ImportError, detail:
+        config['hasRsrcUpdate'] = 0
+        print 'I: ... resource update unavailable -', detail
+    else:
+        test_exe = os.path.join(HOME, r'support\loader\run_7rw.exe')
+        if not os.path.exists( test_exe ):
+            config['hasRsrcUpdate'] = 0
+            print 'E: ... resource update unavailable - %s not found' % test_exe
+        else:
+            # The test_exe may be read-only
+            # make a writable copy and test using that
+            rw_test_exe = os.path.join( os.environ['TEMP'], 'me_test_exe.tmp' )
+            shutil.copyfile( test_exe, rw_test_exe )
+            try:
+                hexe = win32api.BeginUpdateResource(rw_test_exe,0)
+            except:
+                config['hasRsrcUpdate'] = 0
+                print 'I: ... resource update unavailable - win32api.BeginUpdateResource failed'
+            else:
+                win32api.EndUpdateResource(hexe, 1)
+                config['hasRsrcUpdate'] = 1
+                print 'I: ... resource update available'
+            os.remove(rw_test_exe)
+else:
+    config['hasRsrcUpdate'] = 0
+
+_useUnicode = """\
+# Generated by Configure.py
+# This file is public domain
+import %s
+"""
+
+_useUnicodeFN = os.path.join(HOME, 'support', 'useUnicode.py')
+
+#hasUnicode
+print 'I: Testing for Unicode support...'
+try:
+    import codecs
+    config['hasUnicode'] = 1
+    try:
+        import encodings
+    except ImportError:
+        module = "codecs"
+    else:
+        module = "encodings"
+    open(_useUnicodeFN, 'w').write(_useUnicode % module)
+    print 'I: ... Unicode available'
+except ImportError:
+    try:
+        os.remove(_useUnicodeFN)
+    except OSError:
+        pass
+    config['hasUnicode'] = 0
+    print 'I: ... Unicode NOT available'
+
+#hasUPX
+print 'I: testing for UPX...'
+hasUPX = 0
+try:
+    vers = os.popen("upx -V").readlines()
+    if not vers:
+        hasUPX = 0
+    else:
+        v = string.split(vers[0])[1]
+        hasUPX = tuple(map(int, string.split(v, ".")))
+        if iswin and is24 and hasUPX < (1,92):
+            print 'E: UPX is too old! Python 2.4 under Windows requires UPX 1.92+'
+            hasUPX = 0
+    print 'I: ...UPX %s' % (('unavailable','available')[hasUPX != 0])
+except Exception, e:
+    print 'I: ...exception result in testing for UPX'
+    print e, e.args
+config['hasUPX'] = hasUPX
+
+# now write out config, so Build can load
+outf = open(configfile, 'w')
+import pprint
+pprint.pprint(config, outf)
+outf.close()
+
+import Build
+
+# PYZ_dependencies
+print "I: computing PYZ dependencies..."
+a = mf.ImportTracker([os.path.join(HOME, 'support')])
+a.analyze_r('archive')
+mod = a.modules['archive']
+toc = Build.TOC([(mod.__name__, mod.__file__, 'PYMODULE')])
+for i in range(len(toc)):
+    nm, fnm, typ = toc[i]
+    mod = a.modules[nm]
+    tmp = []
+    for importednm, isdelayed, isconditional in mod.imports:
+        if not isconditional:
+            realnms = a.analyze_one(importednm, nm)
+            for realnm in realnms:
+                imported = a.modules[realnm]
+                if not isinstance(imported, mf.BuiltinModule):
+                    tmp.append((imported.__name__, imported.__file__, imported.typ))
+    toc.extend(tmp)
+toc.reverse()
+config['PYZ_dependencies'] = toc.data
+
+outf = open(configfile, 'w')
+import pprint
+pprint.pprint(config, outf)
+outf.close()
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/GrabVersion.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,31 @@
+#! /usr/bin/env python
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+import versionInfo
+
+import sys
+if len(sys.argv) < 2:
+    print "Usage: >python GrabVersion.py <exe>"
+    print " where: <exe> is the fullpathname of a Windows executable."
+    print " The printed output may be saved to a file,  editted and "
+    print " used as the input for a verion resource on any of the "
+    print " executable targets in an Installer config file."
+    print " Note that only NT / Win2K can set version resources."
+else:
+    vs  = versionInfo.decode(sys.argv[1])
+    print vs
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/MakeCOMServer_old.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,166 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+import string, os, sys, win32api, Makespec
+
+modspec = """\
+    %(mod)s.%(klass)s._reg_class_spec_ = "%(mod)s.%(klass)s"
+    if (not hasattr(%(mod)s.%(klass)s, '_reg_clsctx_') or
+        %(mod)s.%(klass)s._reg_clsctx_ & pythoncom.CLSCTX_INPROC):
+        %(mod)s.%(klass)s._reg_options_ = {'InprocServer32':
+             os.path.abspath(
+                 os.path.join(
+                     os.path.dirname(sys.executable), "%(dllname)s"))}
+""" #mod, klass, dllname
+tmplt = """\
+import sys
+import string
+import os
+inprocess = getattr(sys, 'frozen', None)
+%(modimports)s
+
+register = 0
+for i in range(1, len(sys.argv)):
+    arg = sys.argv[i]
+    if string.find(arg, "reg") > -1:
+        register = 1
+        if arg == '/unreg':
+            sys.argv[i] = '--unregister'
+if register:
+    import pythoncom
+    pythoncom.frozen = 1
+%(modspecs)s
+    from win32com.server import register
+    register.UseCommandLine(%(regspecs)s, %(flags)s)
+else:
+    #older Python's need to force this import before pythoncom does it
+    import win32com.server.policy
+    if inprocess == 'dll':
+        pass
+    else:
+        import win32com.server.localserver
+        win32com.server.localserver.main()
+
+""" #modimports, modspecs regspecs, flags
+
+def create(scripts, debug, verbosity, workdir, ascii=0):
+    infos = []  # (path, module, klasses)
+    for script in scripts:
+        infos.append(analscriptname(script))
+    outfnm = 'drive%s.py' % infos[0][1]
+    dllname = 'drive%s.dll' % infos[0][1]
+    if not os.path.exists(workdir):
+        os.makedirs(workdir)
+    outfnm = os.path.join(workdir, outfnm)
+    outf = open(outfnm, 'w')
+    modspecs = []
+    regspecs = []
+    modimports = []
+    flags = 'debug=0, quiet=%s' % (verbosity==0)
+    paths = []
+    for path, module, klasses in infos:
+        if path:
+            paths.append(path)
+        for klass in klasses:
+            d = { 'mod':module, 'klass':klass, 'dllname':dllname }
+            modspecs.append(modspec % d)
+            regspecs.append('%(mod)s.%(klass)s' % d)
+            modimports.append("import %(mod)s" % d)
+    for i in range(len(paths)):
+        path = paths[i]
+        paths[i] = win32api.GetShortPathName(os.path.normpath(path))
+    modspecs = string.join(modspecs, '\n')
+    modimports = string.join(modimports, '\n')
+    regspecs = string.join(regspecs, ', ')
+    d = { 'modspecs':modspecs,
+          'regspecs':regspecs,
+          'modimports':modimports,
+          'flags':flags }
+    outf.write( tmplt % d )
+    outf.close()
+    print "**********************************"
+    print "Driver script %s created" % outfnm
+    specfnm = Makespec.main([outfnm], console=debug, debug=debug,
+                            workdir=workdir, pathex=paths, comserver=1, ascii=ascii)
+    print "Spec file %s created" % specfnm
+
+def analscriptname(script):
+    # return (path, module, klasses)
+    path, basename = os.path.split(script)
+    module = os.path.splitext(basename)[0]
+    while ispkgdir(path):
+        path, basename = os.path.split(path)
+        module = '%s.%s' % (basename, module)
+    try:
+        __import__(module)
+    except ImportError:
+        oldpath = sys.path[:]
+        sys.path.insert(0, path)
+        try:
+            __import__(module)
+        finally:
+            sys.path = oldpath
+    else:
+        path = None
+    m = sys.modules[module]
+    klasses = []
+    for nm, thing in m.__dict__.items():
+        if hasattr(thing, '_reg_clsid_'):
+            klasses.append(nm)
+    return (path, module, klasses)
+
+def ispkgdir(path):
+    try:
+        open(os.path.join(path, '__init__.py'), 'r')
+    except IOError:
+        try:
+            open(os.path.join(path, '__init__.pyc'), 'rb')
+        except IOError:
+            return 0
+    return 1
+
+usage = """\
+Usage: python %s [options] <scriptname>.py [<scriptname>.py ...]
+ --debug -> use debug console build and register COM servers with debug
+ --verbose -> use verbose flag in COM server registration
+ --out dir -> generate script and spec file in dir
+
+The next step is to run Build.py against the generated spec file.
+See doc/Tutorial.html for details.
+"""
+
+if __name__ == '__main__':
+    #scripts, debug, verbosity, workdir
+    debug = verbosity = ascii = 0
+    workdir = '.'
+    import getopt
+    opts, args = getopt.getopt(sys.argv[1:], '', ['debug', 'verbose', 'ascii', 'out='])
+    for opt, val in opts:
+        if opt == '--debug':
+            debug = 1
+        elif opt == '--verbose':
+            verbosity = 1
+        elif opt == '--out':
+            workdir = val
+        elif opt == '--ascii':
+            ascii = 1
+        else:
+            print usage % sys.argv[0]
+            sys.exit(1)
+    if not args:
+        print usage % sys.argv[0]
+    else:
+        create(args, debug, verbosity, workdir, ascii)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/MakeComServer.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,166 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+import string, os, sys, win32api, Makespec
+
+tmplt = """\
+import sys
+import string
+import os
+import pythoncom
+pythoncom.frozen = 1
+inprocess = getattr(sys, 'frozen', None)
+
+%(modules)s
+klasses = (%(klasses)s,)
+
+def DllRegisterServer():
+    import win32com.server.register
+    win32com.server.register.RegisterClasses(*klasses)
+    return 0
+
+def DllUnregisterServer():
+    import win32com.server.register
+    win32com.server.register.UnregisterClasses(*klasses)
+    return 0
+
+if sys.frozen!="dll":
+    import win32com.server.localserver
+    for i in range(1, len(sys.argv)):
+        arg = string.lower(sys.argv[i])
+        if string.find(arg, "/reg") > -1 or string.find(arg, "--reg") > -1:
+            DllRegisterServer()
+            break
+
+        if string.find(arg, "/unreg") > -1 or string.find(arg, "--unreg") > -1:
+            DllUnregisterServer()
+            break
+
+        # MS seems to like /automate to run the class factories.
+        if string.find(arg, "/automate") > -1:
+            clsids = []
+            for k in klasses:
+                clsids.append(k._reg_clsid_)
+            win32com.server.localserver.serve(clsids)
+            break
+    else:
+        # You could do something else useful here.
+        import win32api
+        win32api.MessageBox(0, "This program hosts a COM Object and\\r\\nis started automatically", "COM Object")
+"""
+
+def create(scripts, debug, verbosity, workdir, ascii=0):
+    infos = []  # (path, module, klasses)
+    for script in scripts:
+        infos.append(analscriptname(script))
+    if not os.path.exists(workdir):
+        os.makedirs(workdir)
+    outfnm = 'drive%s.py' % infos[0][1]
+    outfnm = os.path.join(workdir, outfnm)
+    outf = open(outfnm, 'w')
+    klassspecs = []
+    modimports = []
+    flags = 'debug=%s, quiet=%s' % (debug, verbosity==0)
+    paths = []
+    for path, module, klasses in infos:
+        if path:
+            paths.append(path)
+        modimports.append("import %s" % (module,))
+        for klass in klasses:
+            klassspecs.append("%s.%s" % (module, klass))
+    for i in range(len(paths)):
+        path = paths[i]
+        paths[i] = win32api.GetShortPathName(os.path.normpath(path))
+    modimports = string.join(modimports, '\n')
+    klassspecs = string.join(klassspecs, ', ')
+    d = { 'modules':modimports,
+          'klasses':klassspecs,
+          }
+    outf.write( tmplt % d )
+    outf.close()
+    print "**********************************"
+    print "Driver script %s created" % outfnm
+    specfnm = Makespec.main([outfnm], console=debug, debug=debug,
+                            workdir=workdir, pathex=paths, comserver=1, ascii=ascii)
+    print "Spec file %s created" % specfnm
+
+def analscriptname(script):
+    # return (path, module, klasses)
+    path, basename = os.path.split(script)
+    module = os.path.splitext(basename)[0]
+    while ispkgdir(path):
+        path, basename = os.path.split(path)
+        module = '%s.%s' % (basename, module)
+    try:
+        __import__(module)
+    except ImportError:
+        oldpath = sys.path[:]
+        sys.path.insert(0, path)
+        try:
+            __import__(module)
+        finally:
+            sys.path = oldpath
+    else:
+        path = None
+    m = sys.modules[module]
+    klasses = []
+    for nm, thing in m.__dict__.items():
+        if hasattr(thing, '_reg_clsid_'):
+            klasses.append(nm)
+    return (path, module, klasses)
+
+def ispkgdir(path):
+    try:
+        open(os.path.join(path, '__init__.py'), 'r')
+    except IOError:
+        try:
+            open(os.path.join(path, '__init__.pyc'), 'rb')
+        except IOError:
+            return 0
+    return 1
+
+usage = """\
+Usage: python %s [options] <scriptname>.py [<scriptname>.py ...]
+ --debug -> use debug console build and register COM servers with debug
+ --verbose -> use verbose flag in COM server registration
+ --out dir -> generate script and spec file in dir
+
+The next step is to run Build.py against the generated spec file.
+See doc/Tutorial.html for details.
+"""
+
+if __name__ == '__main__':
+    #scripts, debug, verbosity, workdir
+    debug = verbosity = ascii = 0
+    workdir = '.'
+    import getopt
+    opts, args = getopt.getopt(sys.argv[1:], '', ['debug', 'verbose', 'ascii', 'out='])
+    for opt, val in opts:
+        if opt == '--debug':
+            debug = 1
+        elif opt == '--verbose':
+            verbosity = 1
+        elif opt == '--out':
+            workdir = val
+        elif opt == '--ascii':
+            ascii = 1
+        else:
+            print usage % sys.argv[0]
+            sys.exit(1)
+    if not args:
+        print usage % sys.argv[0]
+    else:
+        create(args, debug, verbosity, workdir, ascii)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/Makespec.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,273 @@
+#! /usr/bin/env/python
+# Automatically build spec files containing a description of the project
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+import sys, os, string
+
+# For Python 1.5 compatibility
+try:
+    True
+except:
+    True,False = 1,0
+
+freezetmplt = """\
+a = Analysis(%(scripts)s,
+             pathex=%(pathex)s)
+pyz = PYZ(a.pure)
+exe = EXE(%(tkpkg)s pyz,
+          a.scripts,
+          a.binaries,
+          name='%(exename)s',
+          debug=%(debug)s,
+          strip=%(strip)s,
+          upx=%(upx)s,
+          console=%(console)s %(exe_options)s)
+""" # pathex scripts exename tkpkg debug console
+
+collecttmplt = """\
+a = Analysis(%(scripts)s,
+             pathex=%(pathex)s)
+pyz = PYZ(a.pure)
+exe = EXE(pyz,
+          a.scripts,
+          exclude_binaries=1,
+          name='%(builddir)s/%(exename)s',
+          debug=%(debug)s,
+          strip=%(strip)s,
+          upx=%(upx)s,
+          console=%(console)s %(exe_options)s)
+coll = COLLECT(%(tktree)s exe,
+               a.binaries,
+               strip=%(strip)s,
+               upx=%(upx)s,
+               name='%(distdir)s')
+""" # scripts pathex, exename, debug, console tktree distdir
+
+comsrvrtmplt = """\
+a = Analysis(%(scripts)s,
+             pathex=%(pathex)s)
+pyz = PYZ(a.pure)
+exe = EXE(pyz,
+          a.scripts,
+          exclude_binaries=1,
+          name='%(builddir)s/%(exename)s',
+          debug=%(debug)s,
+          strip=%(strip)s,
+          upx=%(upx)s,
+          console=%(console)s %(exe_options)s)
+dll = DLL(pyz,
+          a.scripts,
+          exclude_binaries=1,
+          name='%(builddir)s/%(dllname)s',
+          debug=%(debug)s)
+coll = COLLECT(exe, dll,
+               a.binaries,
+               strip=%(strip)s,
+               upx=%(upx)s,
+               name='%(distdir)s')
+""" # scripts pathex, exename, debug, console tktree distdir
+HOME = os.path.dirname(sys.argv[0])
+if HOME == '':
+    HOME = os.getcwd()
+if not os.path.isabs(HOME):
+    HOME = os.path.abspath(HOME)
+iswin = sys.platform[:3] == "win"
+cygwin = sys.platform == "cygwin"
+try:
+    config = eval(open(os.path.join(HOME, 'config.dat'), 'r').read())
+except IOError:
+    print "You must run Configure.py before building!"
+    sys.exit(1)
+
+if config['pythonVersion'] != sys.version:
+    print "The current version of Python is not the same with which PyInstaller was configured."
+    print "Please re-run Configure.py with this version."
+    sys.exit(1)
+
+def quote_win_filepath( path ):
+    # quote all \ with another \ after using normpath to clean up the path
+    return string.join( string.split( os.path.normpath( path ), '\\' ), '\\\\' )
+
+# Support for trying to avoid hard-coded paths in the .spec files.
+# Eg, all files rooted in the Installer directory tree will be
+# written using "HOMEPATH", thus allowing this spec file to
+# be used with any Installer installation.
+# Same thing could be done for other paths too.
+path_conversions = (
+    (HOME, "HOMEPATH"),
+    # Add Tk etc?
+    )
+
+def make_variable_path(filename, conversions = path_conversions):
+    for (from_path, to_name) in conversions:
+        assert os.path.abspath(from_path)==from_path, \
+            "path '%s' should already be absolute" % (from_path,)
+        if filename[:len(from_path)] == from_path:
+            rest = filename[len(from_path):]
+            if rest[0] in "\\/":
+                rest = rest[1:]
+            return to_name, rest
+    return None, filename
+
+# An object used in place of a "path string" which knows how to repr()
+# itself using variable names instead of hard-coded paths.
+class Path:
+    def __init__(self, *parts):
+        self.path = apply(os.path.join, parts)
+        self.variable_prefix = self.filename_suffix = None
+    def __repr__(self):
+        if self.filename_suffix is None:
+            self.variable_prefix, self.filename_suffix = make_variable_path(self.path)
+        if self.variable_prefix is None:
+            return repr(self.path)
+        return "os.path.join(" + self.variable_prefix + "," + repr(self.filename_suffix) + ")"
+
+def main(scripts, name=None, tk=0, freeze=0, console=1, debug=0, strip=0, upx=0,
+         comserver=0, ascii=0, workdir=None, pathex=[], version_file=None, icon_file=None):
+    if name is None:
+        name = os.path.splitext(os.path.basename(scripts[0]))[0]
+    distdir = "dist%s" % name
+    builddir = "build%s" % name
+    pathex = pathex[:]
+    if workdir is None:
+        workdir = os.getcwd()
+        pathex.append(workdir)
+    else:
+        pathex.append(os.getcwd())
+    if workdir == HOME:
+        workdir = os.path.join(HOME, name)
+    if not os.path.exists(workdir):
+        os.makedirs(workdir)
+    exe_options = ''
+    if version_file:
+        exe_options = "%s, version='%s'" % (exe_options, quote_win_filepath(version_file))
+    if icon_file:
+        exe_options = "%s, icon='%s'" % (exe_options, quote_win_filepath(icon_file))
+    if not ascii and config['hasUnicode']:
+        scripts.insert(0, os.path.join(HOME, 'support', 'useUnicode.py'))
+    for i in range(len(scripts)):
+        scripts[i] = Path(scripts[i]) # Use relative path in specfiles
+
+    d = {'tktree':'',
+         'tkpkg' :'',
+         'scripts':scripts,
+         'pathex' :pathex,
+         'exename': '',
+         'distdir': distdir,
+         'builddir': builddir,
+         'debug': debug,
+         'strip': strip,
+         'upx' : upx,
+         'console': console or debug,
+         'exe_options': exe_options}
+    if tk:
+        d['tktree'] = "TkTree(),"
+        if freeze:
+            scripts.insert(0, Path(HOME, 'support', 'useTK.py'))
+            scripts.insert(0, Path(HOME, 'support', 'unpackTK.py'))
+            scripts.append(Path(HOME, 'support', 'removeTK.py'))
+            d['tkpkg'] = "TkPKG(),"
+        else:
+            scripts.insert(0, Path(HOME, 'support', 'useTK.py'))
+    scripts.insert(0, Path(HOME, 'support', '_mountzlib.py'))
+    if iswin or cygwin:
+        d['exename'] = name+'.exe'
+        d['dllname'] = name+'.dll'
+    else:
+        d['exename'] = name
+        d['console'] = 1
+    specfnm = os.path.join(workdir, name+'.spec')
+    specfile = open(specfnm, 'w')
+    if freeze:
+        specfile.write(freezetmplt % d)
+    elif comserver:
+        specfile.write(comsrvrtmplt % d)
+    else:
+        specfile.write(collecttmplt % d)
+    specfile.close()
+    return specfnm
+
+if __name__ == '__main__':
+    import optparse
+    p = optparse.OptionParser(
+        usage="python %prog [opts] <scriptname> [<scriptname> ...]"
+    )
+    p.add_option("-F", "--onefile", dest="freeze",
+                 action="store_true", default=False,
+                 help="create a single file deployment")
+    p.add_option("-D", "--onedir", dest="freeze", action="store_false",
+                 help="create a single directory deployment (default)")
+    p.add_option("-w", "--windowed", "--noconsole", dest="console",
+                 action="store_false", default=True,
+                 help="use a Windows subsystem executable (Windows only)")
+    p.add_option("-c", "--nowindowed", "--console", dest="console",
+                 action="store_true",
+                 help="use a console subsystem executable (Windows only) "
+                      "(default)")
+    p.add_option("-a", "--ascii", action="store_true", default=False,
+                 help="do NOT include unicode encodings "
+                      "(default: included if available)")
+    p.add_option("-d", "--debug", action="store_true", default=False,
+                 help="use the debug (verbose) build of the executable")
+    p.add_option("-s", "--strip", action="store_true", default=False,
+                 help="strip the exe and shared libs "
+                      "(don't try this on Windows)")
+    p.add_option("-X", "--upx", action="store_true", default=False,
+                 help="use UPX if available (works differently between "
+                      "Windows and *nix)")
+    p.add_option("-K", "--tk", default=False, action="store_true",
+                 help="include TCL/TK in the deployment")
+    p.add_option("-o", "--out", type="string", default=None,
+                 dest="workdir", metavar="DIR",
+                 help="generate the spec file in the specified directory")
+    p.add_option("-n", "--name", type="string", default=None,
+                 help="name to assign to the project, from which the spec file "
+                      "name is generated. (default: use the basename of the "
+                      "(first) script)")
+    p.add_option("-p", "--paths", type="string", default=[], dest="pathex",
+                 metavar="DIR", action="append",
+                 help="set base path for import (like using PYTHONPATH). "
+                      "Multiple directories are allowed, separating them "
+                      "with %s, or using this option multiple times"
+                      % repr(os.pathsep))
+    p.add_option("-v", "--version", type="string",
+                 dest="version_file", metavar="FILE",
+                 help="add a version resource from FILE to the exe "
+                      "(Windows only)")
+    p.add_option("--icon", type="string", dest="icon_file",
+                 metavar="FILE.ICO or FILE.EXE,ID",
+                 help="If FILE is an .ico file, add the icon to the final "
+                      "executable. Otherwise, the syntax 'file.exe,id' to "
+                      "extract the icon with the specified id "
+                      "from file.exe and add it to the final executable")
+
+    opts,args = p.parse_args()
+
+    # Split pathex by using the path separator
+    temppaths = opts.pathex[:]
+    opts.pathex = []
+    for p in temppaths:
+        opts.pathex.extend(string.split(p, os.pathsep))
+
+    if not args:
+        p.print_help()
+        sys.exit(1)
+
+    nm = apply(main, (args,), opts.__dict__)
+    print "wrote %s" % nm
+    print "now run Build.py to build the executable"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/McGUI.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,100 @@
+#!/usr/bin/python
+
+# Tkinter interface to the McMillan installer
+# (c) 2003 Alan James Salmoni - yes, all this bad code is all mine!!!
+# released under the MIT license
+
+import os, os.path
+from Tkinter import *
+import tkFileDialog
+import FileDialog
+
+class McGUI:
+    def __init__(self):
+        root = Tk()
+        fr1 = Frame(root)
+        fr1["width"] = 200
+        fr1["height"] = 100
+        fr1.pack(side="top")
+        fr2 = Frame(root)
+        fr2["width"] = 200
+        fr2["height"] = 300
+        fr2["borderwidth"] = 2
+        fr2["relief"] = "ridge"
+        fr2.pack()
+        fr4 = Frame(root)
+        fr4["width"]=200
+        fr4["height"]=100
+        fr4.pack(side="bottom")
+        getFileButton = Button(fr1)
+        getFileButton["text"] = "Script..."
+        getFileButton.bind("<Button>",self.GetFile)
+        getFileButton.pack(side="left")
+        self.filein = Entry(fr1)
+        self.filein.pack(side="right")
+        self.filetypecheck = Checkbutton(fr2)
+        self.filetypecheck["text"] = "One File Package                 "
+        self.filetype = IntVar()
+        self.filetypecheck["variable"] = self.filetype
+        self.filetypecheck.pack()
+        self.tkcheck = Checkbutton(fr2)
+        self.tkcheck["text"] = "Include Tcl/Tk                         "
+        self.tk = IntVar()
+        self.tkcheck["variable"] = self.tk
+        self.tkcheck.pack()
+        self.asciicheck = Checkbutton(fr2)
+        self.asciicheck["text"] = "Do NOT include decodings"
+        self.ascii = IntVar()
+        self.asciicheck["variable"] = self.ascii
+        self.asciicheck.pack()
+        self.debugcheck = Checkbutton(fr2)
+        self.debugcheck["text"] = "Use debug versions             "
+        self.debug = IntVar()
+        self.debugcheck["variable"] = self.debug
+        self.debugcheck.pack()
+        self.noconsolecheck = Checkbutton(fr2)
+        self.noconsolecheck["text"] = "No console (Windows only)"
+        self.noconsole = IntVar()
+        self.noconsolecheck["variable"] = self.noconsole
+        self.noconsolecheck.pack()
+        okaybutton = Button(fr4)
+        okaybutton["text"] = "Okay   "
+        okaybutton.bind("<Button>",self.makePackage)
+        okaybutton.pack(side="left")
+        cancelbutton = Button(fr4)
+        cancelbutton["text"] = "Cancel"
+        cancelbutton.bind("<Button>",self.killapp)
+        cancelbutton.pack(side="right")
+        self.fin = ''
+        self.fout = ''
+        root.mainloop()
+
+    def killapp(self, event):
+        sys.exit(0)
+
+    def makePackage(self, event):
+        commands = 'python Makespec.py '
+        if (self.filetype.get() == 1):
+            commands = commands + '--onefile '
+        if (self.tk.get() == 1):
+            commands = commands + '--tk '
+        if (self.ascii.get() == 1):
+            commands = commands + '--ascii '
+        if (self.debug.get() == 1):
+            commands = commands + '--debug '
+        if (self.noconsole.get() == 1):
+            commands = commands + '--noconsole '
+        commands = commands + self.fin
+        x = os.path.split(self.fin)
+        y = os.path.splitext(x[1])
+        os.system(commands)
+        commands = 'python Build.py '+str(y[0])+os.sep+str(y[0])+'.spec'
+        os.system(commands)
+        sys.exit(0)
+
+    def GetFile(self, event):
+        self.fin = tkFileDialog.askopenfilename()
+        self.filein.insert(0,self.fin)
+
+if __name__ == "__main__":
+    app = McGUI()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/README.txt	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,29 @@
+_PyInstaller 1.3_
+=================
+
+Use
+===
+ See doc/Tutorial.txt
+
+Installation in brief
+=====================
+ Non-Windows users should:
+    cd source/linux
+
+    python ./Make.py
+
+    make
+
+ Everyone should:
+    python Configure.py
+
+    python Makespec.py /path/to/yourscript.py
+
+    python Build.py /path/to/yourscript.spec
+
+    .done.
+
+Major changes in this release
+=============================
+ See doc/CHANGES.txt
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/Sconstruct	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,72 @@
+# Sconstruct file to build the bootloader
+# Copyright (C) 2005, Giovanni Bajo
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+platform = Platform()
+envs = []
+
+if platform.name == "win32":
+
+    # For Windows, we need generate several different versions of the bootloader:
+    # - Either runtime-compatible with Visual Studio 6.0 or with Visual Studio 7.1
+    #   (the former is used in all Python versions up to 2.3, the latter since
+    #   Python 2.4).
+    # - Either debug build (with debug messages) or release build.
+    # - Either console program or windowed program.
+    for msvs_ver in "6.0", "7.1":
+        base_env = Environment(MSVS_VERSION = msvs_ver)
+
+        for flavour in "debug", "release":
+            for mode in "cons", "win":
+                env = base_env.Copy()
+
+                # The bootloader is built as a static executable. We want it
+                # to be self-contained. Extra care was put in writing it so
+                # that it does not share objects/memory with python.dll (which
+                # it loads).
+                env.Append(CCFLAGS = ["/ML"])
+
+                if flavour == "debug":
+                    # No optimizations
+                    env.Append(CCFLAGS = ["/Od"])
+                    # Each object has its own pdb, so -jN works
+                    env.Append(CCFLAGS = ["/Zi", "/Fd${TARGET}.pdb"])
+                    env.Append(LINKFLAGS = ["/DEBUG"])
+                else:
+                    # Use some sensible amount of optimizations
+                    env.Append(CCFLAGS = ["/Ox", "/DNDEBUG"])
+
+                if mode == "cons":
+                    env.Append(CPPDEFINES = ["_CONSOLE"])
+
+                env["PYINST_FLAVOUR"] = flavour
+                env["PYINST_MODE"] = mode
+                env["PYINST_SUFFIX"] = "%c%c%c" % (msvs_ver[0], flavour[0], mode[0])
+
+                env.Append(CPPDEFINES = ["WIN32"])
+                env.Append(LIBS = ["user32.lib", "comctl32.lib", "kernel32.lib", "ws2_32.lib"])
+
+                envs.append(env)
+
+for env in envs:
+    run,dll = SConscript("source/SConscript", exports = ["env"],
+                         build_dir = "build/" + env["PYINST_SUFFIX"],
+                         duplicate = 0)
+
+    env.InstallAs(target="support/loader/run_" + env["PYINST_SUFFIX"] + env["PROGSUFFIX"],
+                  source=run)
+    env.InstallAs(target="support/loader/inprocsrvr_" + env["PYINST_SUFFIX"] + env["SHLIBSUFFIX"],
+                  source=dll[0])
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/archive.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,413 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# In addition to the permissions in the GNU General Public License, the
+# authors give you unlimited permission to link or embed the compiled
+# version of this file into combinations with other programs, and to
+# distribute those combinations without any restriction coming from the
+# use of this file. (The General Public License restrictions do apply in
+# other respects; for example, they cover modification of the file, and
+# distribution when not linked into a combine executable.)
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+# subclasses may not need marshal or struct, but since they're
+# builtin, importing is safe.
+#
+# While an Archive is really an abstraction for any "filesystem
+# within a file", it is tuned for use with imputil.FuncImporter.
+# This assumes it contains python code objects, indexed by the
+# the internal name (ie, no '.py').
+# See carchive.py for a more general archive (contains anything)
+# that can be understood by a C program.
+
+_verbose = 0
+_listdir = None
+_environ = None
+
+# **NOTE** This module is used during bootstrap. Import *ONLY* builtin modules.
+import marshal
+import struct
+import imp
+import sys
+
+_c_suffixes = filter(lambda x: x[2] == imp.C_EXTENSION, imp.get_suffixes())
+
+for nm in ('nt', 'posix', 'dos', 'os2', 'mac'):
+    if nm in sys.builtin_module_names:
+        mod = __import__(nm)
+        _listdir = mod.listdir
+        _environ = mod.environ
+        break
+
+if hasattr(sys, 'version_info'):
+    versuffix = '%d%d'%(sys.version_info[0],sys.version_info[1])
+else:
+    vers = sys.version
+    dot1 = dot2 = 0
+    for i in range(len(vers)):
+        if vers[i] == '.':
+            if dot1:
+                dot2 = i
+                break
+            else:
+                dot1 = i
+    else:
+        dot2 = len(vers)
+    versuffix = '%s%s' % (vers[:dot1], vers[dot1+1:dot2])
+
+if "-vi" in sys.argv[1:]:
+    _verbose = 1
+
+class Archive:
+    """ A base class for a repository of python code objects.
+        The extract method is used by imputil.ArchiveImporter
+        to get code objects by name (fully qualified name), so
+        an enduser "import a.b" would become
+          extract('a.__init__')
+          extract('a.b')
+    """
+    MAGIC = 'PYL\0'
+    HDRLEN = 12        # default is MAGIC followed by python's magic, int pos of toc
+    TOCPOS = 8
+    TRLLEN = 0        # default - no trailer
+    TOCTMPLT = {}     #
+    os = None
+    _bincache = None
+    def __init__(self, path=None, start=0):
+        "Initialize an Archive. If path is omitted, it will be an empty Archive."
+        self.toc = None
+        self.path = path
+        self.start = start
+        import imp
+        self.pymagic = imp.get_magic()
+        if path is not None:
+            self.lib = open(self.path, 'rb')
+            self.checkmagic()
+            self.loadtoc()
+
+            ####### Sub-methods of __init__ - override as needed #############
+    def checkmagic(self):
+        """ Overridable.
+            Check to see if the file object self.lib actually has a file
+            we understand.
+        """
+        self.lib.seek(self.start)	#default - magic is at start of file
+        if self.lib.read(len(self.MAGIC)) != self.MAGIC:
+            raise RuntimeError, "%s is not a valid %s archive file" \
+              % (self.path, self.__class__.__name__)
+        if self.lib.read(len(self.pymagic)) != self.pymagic:
+            raise RuntimeError, "%s has version mismatch to dll" % (self.path)
+        self.lib.read(4)
+
+    def loadtoc(self):
+        """ Overridable.
+            Default: After magic comes an int (4 byte native) giving the
+            position of the TOC within self.lib.
+            Default: The TOC is a marshal-able string.
+        """
+        self.lib.seek(self.start + self.TOCPOS)
+        (offset,) = struct.unpack('=i', self.lib.read(4))
+        self.lib.seek(self.start + offset)
+        self.toc = marshal.load(self.lib)
+
+        ######## This is what is called by FuncImporter #######
+        ## Since an Archive is flat, we ignore parent and modname.
+        #XXX obsolete - imputil only code
+        ##  def get_code(self, parent, modname, fqname):
+        ####    if _verbose:
+        ####      print "I: get_code(%s, %s, %s, %s)" % (self, parent, modname, fqname)
+        ##    iname = fqname
+        ##    if parent:
+        ##        iname = '%s.%s' % (parent.__dict__.get('__iname__', parent.__name__), modname)
+        ####        if _verbose:
+        ####            print "I: get_code: iname is %s" % iname
+        ##    rslt = self.extract(iname) # None if not found, (ispkg, code) otherwise
+        ####    if _verbose:
+        ####        print 'I: get_code: rslt', rslt
+        ##    if rslt is None:
+        ####      if _verbose:
+        ####          print 'I: get_code: importer', getattr(parent, "__importer__", None),'self',self
+        ##      # check the cache if there is no parent or self is the parents importer
+        ##      if parent is None or getattr(parent, "__importer__", None) is self:
+        ####            if _verbose:
+        ####                print 'I: get_code: cached 1',iname
+        ##            file, desc = Archive._bincache.get(iname, (None, None))
+        ####            if _verbose:
+        ####                print 'I: get_code: file',file,'desc',desc
+        ##            if file:
+        ##              try:
+        ##                fp = open(file, desc[1])
+        ##              except IOError:
+        ##                pass
+        ##              else:
+        ##                module = imp.load_module(fqname, fp, file, desc)
+        ##                if _verbose:
+        ##                    print "I: import %s found %s" % (fqname, file)
+        ##                return 0, module, {'__file__':file}
+        ##      if _verbose:
+        ##          print "I: import %s failed" % fqname
+        ##
+        ##      return None
+        ##
+        ##    ispkg, code = rslt
+        ##    values = {'__file__' : code.co_filename, '__iname__' : iname}
+        ##    if ispkg:
+        ##      values['__path__'] = [fqname]
+        ##    if _verbose:
+        ##        print "I: import %s found %s" % (fqname, iname)
+        ##    return ispkg, code, values
+
+        ####### Core method - Override as needed  #########
+    def extract(self, name):
+        """ Get the object corresponding to name, or None.
+            For use with imputil ArchiveImporter, object is a python code object.
+            'name' is the name as specified in an 'import name'.
+            'import a.b' will become:
+            extract('a') (return None because 'a' is not a code object)
+            extract('a.__init__') (return a code object)
+            extract('a.b') (return a code object)
+            Default implementation:
+              self.toc is a dict
+              self.toc[name] is pos
+              self.lib has the code object marshal-ed at pos
+        """
+        ispkg, pos = self.toc.get(name, (0,None))
+        if pos is None:
+            return None
+        self.lib.seek(self.start + pos)
+        return ispkg, marshal.load(self.lib)
+
+        ########################################################################
+        # Informational methods
+
+    def contents(self):
+        """Return a list of the contents
+           Default implementation assumes self.toc is a dict like object.
+           Not required by ArchiveImporter.
+        """
+        return self.toc.keys()
+
+        ########################################################################
+        # Building
+
+        ####### Top level method - shouldn't need overriding #######
+    def build(self, path, lTOC):
+        """Create an archive file of name 'path'.
+           lTOC is a 'logical TOC' - a list of (name, path, ...)
+           where name is the internal name, eg 'a'
+           and path is a file to get the object from, eg './a.pyc'.
+        """
+        self.path = path
+        self.lib = open(path, 'wb')
+        #reserve space for the header
+        if self.HDRLEN:
+            self.lib.write('\0'*self.HDRLEN)
+
+            #create an empty toc
+
+        if type(self.TOCTMPLT) == type({}):
+            self.toc = {}
+        else:       # assume callable
+            self.toc = self.TOCTMPLT()
+
+        for tocentry in lTOC:
+            self.add(tocentry)   # the guts of the archive
+
+        tocpos = self.lib.tell()
+        self.save_toc(tocpos)
+        if self.TRLLEN:
+            self.save_trailer(tocpos)
+        if self.HDRLEN:
+            self.update_headers(tocpos)
+        self.lib.close()
+
+
+        ####### manages keeping the internal TOC and the guts in sync #######
+    def add(self, entry):
+        """Override this to influence the mechanics of the Archive.
+           Assumes entry is a seq beginning with (nm, pth, ...) where
+           nm is the key by which we'll be asked for the object.
+           pth is the name of where we find the object. Overrides of
+           get_obj_from can make use of further elements in entry.
+        """
+        if self.os is None:
+            import os
+            self.os = os
+        nm = entry[0]
+        pth = entry[1]
+        pynm, ext = self.os.path.splitext(self.os.path.basename(pth))
+        ispkg = pynm == '__init__'
+        assert ext in ('.pyc', '.pyo')
+        self.toc[nm] = (ispkg, self.lib.tell())
+        f = open(entry[1], 'rb')
+        f.seek(8)	#skip magic and timestamp
+        self.lib.write(f.read())
+
+    def save_toc(self, tocpos):
+        """Default - toc is a dict
+           Gets marshaled to self.lib
+        """
+        marshal.dump(self.toc, self.lib)
+
+    def save_trailer(self, tocpos):
+        """Default - not used"""
+        pass
+
+    def update_headers(self, tocpos):
+        """Default - MAGIC + Python's magic + tocpos"""
+        self.lib.seek(self.start)
+        self.lib.write(self.MAGIC)
+        self.lib.write(self.pymagic)
+        self.lib.write(struct.pack('=i', tocpos))
+
+class DummyZlib:
+    def decompress(self, data):
+        return data
+    def compress(self, data, lvl):
+        return data
+
+import iu
+##############################################################
+#
+# ZlibArchive - an archive with compressed entries
+#
+class ZlibArchive(Archive):
+    MAGIC = 'PYZ\0'
+    TOCPOS = 8
+    HDRLEN = 16
+    TRLLEN = 0
+    TOCTMPLT = {}
+    LEVEL = 9
+
+    def __init__(self, path=None, offset=None, level=9):
+        if path is None:
+            offset = 0
+        elif offset is None:
+            for i in range(len(path)-1, -1, -1):
+                if path[i] == '?':
+                    offset = int(path[i+1:])
+                    path = path[:i]
+                    break
+            else:
+                offset = 0
+        self.LEVEL = level
+        Archive.__init__(self, path, offset)
+        # dynamic import so not imported if not needed
+        global zlib
+        if self.LEVEL:
+            try:
+                import zlib
+            except ImportError:
+                zlib = DummyZlib()
+        else:
+            zlib = DummyZlib()
+
+
+    def extract(self, name):
+        (ispkg, pos, lngth) = self.toc.get(name, (0, None, 0))
+        if pos is None:
+            return None
+        self.lib.seek(self.start + pos)
+        try:
+            co = marshal.loads(zlib.decompress(self.lib.read(lngth)))
+        except EOFError:
+            raise ImportError, "PYZ entry '%s' failed to unmarshal" % name
+        return ispkg, co
+
+    def add(self, entry):
+        if self.os is None:
+            import os
+            self.os = os
+        nm = entry[0]
+        pth = entry[1]
+        base, ext = self.os.path.splitext(self.os.path.basename(pth))
+        ispkg = base == '__init__'
+        try:
+            txt = open(pth[:-1], 'r').read()+'\n'
+        except (IOError, OSError):
+            try:
+                f = open(pth, 'rb')
+                f.seek(8)	#skip magic and timestamp
+                bytecode = f.read()
+                marshal.loads(bytecode).co_filename # to make sure it's valid
+                obj = zlib.compress(bytecode, self.LEVEL)
+            except (IOError, ValueError, EOFError, AttributeError):
+                raise ValueError("bad bytecode in %s and no source" % pth)
+        else:
+            txt = iu._string_replace(txt, '\r\n', '\n')
+            try:
+                co = compile(txt, "%s/%s" % (self.path, nm), 'exec')
+            except SyntaxError, e:
+                print "Syntax error in", pth[:-1]
+                print e.args
+                raise
+            obj = zlib.compress(marshal.dumps(co), self.LEVEL)
+        self.toc[nm] = (ispkg, self.lib.tell(), len(obj))
+        self.lib.write(obj)
+    def update_headers(self, tocpos):
+        """add level"""
+        Archive.update_headers(self, tocpos)
+        self.lib.write(struct.pack('!i', self.LEVEL))
+    def checkmagic(self):
+        Archive.checkmagic(self)
+        self.LEVEL = struct.unpack('!i', self.lib.read(4))[0]
+
+class PYZOwner(iu.Owner):
+    def __init__(self, path):
+        self.pyz = ZlibArchive(path)
+        iu.Owner.__init__(self, path)
+    def getmod(self, nm, newmod=imp.new_module):
+        rslt = self.pyz.extract(nm)
+        if rslt is None:
+            return None
+        ispkg, co = rslt
+        mod = newmod(nm)
+        try:
+            mod.__file__ = co.co_filename
+        except AttributeError:
+            raise ImportError, "PYZ entry '%s' (%s) is not a valid code object" % (nm, repr(co))
+        if ispkg:
+            if _environ.has_key('_MEIPASS2'):
+                localpath = _environ['_MEIPASS2'][:-1]
+            else:
+                localpath = iu._os_path_dirname(self.path)
+            mod.__path__ = [self.path, localpath, iu._os_path_dirname(mod.__file__)]
+            #print "PYZOwner setting %s's __path__: %s" % (nm, mod.__path__)
+            importer = iu.PathImportDirector(mod.__path__,
+                                              {self.path:PkgInPYZImporter(nm, self),
+                                               localpath:ExtInPkgImporter(localpath, nm)},
+                                              [iu.DirOwner])
+            mod.__importsub__ = importer.getmod
+        mod.__co__ = co
+        return mod
+
+class PkgInPYZImporter:
+    def __init__(self, name, owner):
+        self.name = name
+        self.owner = owner
+    def getmod(self, nm):
+        #print "PkgInPYZImporter.getmod %s -> %s" % (nm, self.name+'.'+nm)
+        return self.owner.getmod(self.name+'.'+nm)
+class ExtInPkgImporter(iu.DirOwner):
+    def __init__(self, path, prefix):
+        iu.DirOwner.__init__(self, path)
+        self.prefix = prefix
+    def getmod(self, nm):
+        return iu.DirOwner.getmod(self, self.prefix+'.'+nm)
+
+        #XXX this should also get moved out
+        ##iu._globalownertypes.insert(0, PYZOwner)
+        ##iu.ImportManager().install()
Binary file srcanamdw/codescanner/pyinstaller/archive.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/bindepend.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,330 @@
+#! /usr/bin/env python
+# Find external dependencies of binary libraries.
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+# use dumpbin.exe (if present) to find the binary
+# dependencies of an extension module.
+# if dumpbin not available, pick apart the PE hdr of the binary
+# while this appears to work well, it is complex and subject to
+# problems with changes to PE hdrs (ie, this works only on 32 bit Intel
+# Windows format binaries)
+#
+# Note also that you should check the results to make sure that the
+# dlls are redistributable. I've listed most of the common MS dlls
+# under "excludes" below; add to this list as necessary (or use the
+# "excludes" option in the INSTALL section of the config file).
+
+import os
+import time
+import string
+import sys
+import re
+
+seen = {}
+_bpath = None
+iswin = sys.platform[:3] == 'win'
+cygwin = sys.platform == 'cygwin'
+excludes = {'KERNEL32.DLL':1,
+      'ADVAPI.DLL':1,
+      'MSVCRT.DLL':1,
+      'ADVAPI32.DLL':1,
+      'COMCTL32.DLL':1,
+      'CRTDLL.DLL':1,
+      'GDI32.DLL':1,
+      'MFC42.DLL':1,
+      'NTDLL.DLL':1,
+      'OLE32.DLL':1,
+      'OLEAUT32.DLL':1,
+      'RPCRT4.DLL':1,
+      'SHELL32.DLL':1,
+      'USER32.DLL':1,
+      'WINSPOOL.DRV':1,
+      'WS2HELP.DLL':1,
+      'WS2_32.DLL':1,
+      'WSOCK32.DLL':1,
+      'MSWSOCK.DLL':1,
+      'WINMM.DLL':1,
+      'COMDLG32.DLL':1,
+##      'ZLIB.DLL':1,   # test with python 1.5.2
+      'ODBC32.DLL':1,
+      'VERSION.DLL':1,
+      'IMM32.DLL':1,
+      'DDRAW.DLL':1,
+      'DCIMAN32.DLL':1,
+      'OPENGL32.DLL':1,
+      'GLU32.DLL':1,
+      'GLUB32.DLL':1,
+      '/usr/lib':1,
+      '/lib':1,}
+
+def getfullnameof(mod, xtrapath = None):
+  """Return the full path name of MOD.
+
+      MOD is the basename of a dll or pyd.
+      XTRAPATH is a path or list of paths to search first.
+      Return the full path name of MOD.
+      Will search the full Windows search path, as well as sys.path"""
+  epath = getWindowsPath() + sys.path
+  if xtrapath is not None:
+    if type(xtrapath) == type(''):
+      epath.insert(0, xtrapath)
+    else:
+      epath = xtrapath + epath
+  for p in epath:
+    npth = os.path.join(p, mod)
+    if os.path.exists(npth):
+      return npth
+  return ''
+
+def getImports1(pth):
+    """Find the binary dependencies of PTH.
+
+        This implementation (not used right now) uses the MSVC utility dumpbin"""
+    import tempfile
+    rslt = []
+    tmpf = tempfile.mktemp()
+    os.system('dumpbin /IMPORTS "%s" >%s' %(pth, tmpf))
+    time.sleep(0.1)
+    txt = open(tmpf,'r').readlines()
+    os.remove(tmpf)
+    i = 0
+    while i < len(txt):
+        tokens = string.split(txt[i])
+        if len(tokens) == 1 and string.find(tokens[0], '.') > 0:
+            rslt.append(string.strip(tokens[0]))
+        i = i + 1
+    return rslt
+
+def getImports2x(pth):
+    """Find the binary dependencies of PTH.
+
+        This implementation walks through the PE header"""
+    import struct
+    rslt = []
+    try:
+      f = open(pth, 'rb').read()
+      pehdrd = struct.unpack('l', f[60:64])[0]  #after the MSDOS loader is the offset of the peheader
+      magic = struct.unpack('l', f[pehdrd:pehdrd+4])[0] # pehdr starts with magic 'PE\000\000' (or 17744)
+                                                        # then 20 bytes of COFF header
+      numsecs = struct.unpack('h', f[pehdrd+6:pehdrd+8])[0] # whence we get number of sections
+      opthdrmagic = struct.unpack('h', f[pehdrd+24:pehdrd+26])[0]
+      if opthdrmagic == 0x10b: # PE32 format
+          numdictoffset = 116
+          importoffset = 128
+      elif opthdrmagic == 0x20b: # PE32+ format
+          numdictoffset = 132
+          importoffset = 148
+      else:
+          print "E: bindepend cannot analyze %s - unknown header format! %x" % (pth, opthdrmagic)
+          return rslt
+      numdirs = struct.unpack('l', f[pehdrd+numdictoffset:pehdrd+numdictoffset+4])[0]
+      idata = ''
+      if magic == 17744:
+          importsec, sz = struct.unpack('2l', f[pehdrd+importoffset:pehdrd+importoffset+8])
+          if sz == 0:
+              return rslt
+          secttbl = pehdrd + numdictoffset + 4 + 8*numdirs
+          secttblfmt = '8s7l2h'
+          seclist = []
+          for i in range(numsecs):
+              seclist.append(struct.unpack(secttblfmt, f[secttbl+i*40:secttbl+(i+1)*40]))
+              #nm, vsz, va, rsz, praw, preloc, plnnums, qrelocs, qlnnums, flags \
+              # = seclist[-1]
+          for i in range(len(seclist)-1):
+              if seclist[i][2] <= importsec < seclist[i+1][2]:
+                  break
+          vbase = seclist[i][2]
+          raw = seclist[i][4]
+          idatastart = raw + importsec - vbase
+          idata = f[idatastart:idatastart+seclist[i][1]]
+          i = 0
+          while 1:
+              chunk = idata[i*20:(i+1)*20]
+              if len(chunk) != 20:
+                  print "E: premature end of import table (chunk is %d, not 20)" % len(chunk)
+                  break
+              vsa =  struct.unpack('5l', chunk)[3]
+              if vsa == 0:
+                  break
+              sa = raw + vsa - vbase
+              end = string.find(f, '\000', sa)
+              nm = f[sa:end]
+              if nm:
+                  rslt.append(nm)
+              i = i + 1
+      else:
+          print "E: bindepend cannot analyze %s - file is not in PE format!" % pth
+    except IOError:
+        print "E: bindepend cannot analyze %s - file not found!" % pth
+    #except struct.error:
+    #    print "E: bindepend cannot analyze %s - error walking thru pehdr" % pth
+    return rslt
+
+def getImports2(path):
+    """Find the binary dependencies of PTH.
+
+        This implementation walks through the PE header"""
+    import struct
+    f = open(path, 'rb')
+    # skip the MSDOS loader
+    f.seek(60)
+    # get offset to PE header
+    offset = struct.unpack('l', f.read(4))[0]
+    f.seek(offset)
+    signature = struct.unpack('l', f.read(4))[0]
+    coffhdrfmt = 'hhlllhh'
+    rawcoffhdr = f.read(struct.calcsize(coffhdrfmt))
+    coffhdr = struct.unpack(coffhdrfmt, rawcoffhdr)
+    coffhdr_numsections = coffhdr[1]
+
+    opthdrfmt = 'hbblllllllllhhhhhhllllhhllllll'
+    rawopthdr = f.read(struct.calcsize(opthdrfmt))
+    opthdr = struct.unpack(opthdrfmt, rawopthdr)
+    opthdr_numrvas = opthdr[-1]
+
+    datadirs = []
+    datadirsize = struct.calcsize('ll') # virtual address, size
+    for i in range(opthdr_numrvas):
+        rawdatadir = f.read(datadirsize)
+        datadirs.append(struct.unpack('ll', rawdatadir))
+
+    sectionfmt = '8s6l2hl'
+    sectionsize = struct.calcsize(sectionfmt)
+    sections = []
+    for i in range(coffhdr_numsections):
+        rawsection = f.read(sectionsize)
+        sections.append(struct.unpack(sectionfmt, rawsection))
+
+    importva, importsz = datadirs[1]
+    if importsz == 0:
+        return []
+    # figure out what section it's in
+    NAME, MISC, VIRTADDRESS, RAWSIZE, POINTERTORAW = range(5)
+    for j in range(len(sections)-1):
+        if sections[j][VIRTADDRESS] <= importva < sections[j+1][VIRTADDRESS]:
+            importsection = sections[j]
+            break
+    else:
+        if importva >= sections[-1][VIRTADDRESS]:
+            importsection = sections[-1]
+        else:
+            print "E: import section is unavailable"
+            return []
+    f.seek(importsection[POINTERTORAW] + importva - importsection[VIRTADDRESS])
+    data = f.read(importsz)
+    iidescrfmt = 'lllll'
+    CHARACTERISTICS, DATETIME, FWDRCHAIN, NAMERVA, FIRSTTHUNK = range(5)
+    iidescrsz = struct.calcsize(iidescrfmt)
+    dlls = []
+    while data:
+        iid = struct.unpack(iidescrfmt, data[:iidescrsz])
+        if iid[NAMERVA] == 0:
+            break
+        f.seek(importsection[POINTERTORAW] + iid[NAMERVA] - importsection[VIRTADDRESS])
+        nm = f.read(256)
+        nm, jnk = string.split(nm, '\0', 1)
+        if nm:
+            dlls.append(nm)
+        data = data[iidescrsz:]
+    return dlls
+
+def Dependencies(lTOC):
+  """Expand LTOC to include all the closure of binary dependencies.
+
+     LTOC is a logical table of contents, ie, a seq of tuples (name, path).
+     Return LTOC expanded by all the binary dependencies of the entries
+     in LTOC, except those listed in the module global EXCLUDES"""
+  for nm, pth, typ in lTOC:
+    fullnm = string.upper(os.path.basename(pth))
+    if seen.get(string.upper(nm),0):
+      continue
+    #print "I: analyzing", pth
+    seen[string.upper(nm)] = 1
+    dlls = getImports(pth)
+    for lib in dlls:
+        #print "I: found", lib
+        if not iswin and not cygwin:
+            npth = lib
+            dir, lib = os.path.split(lib)
+            if excludes.get(dir,0):
+                continue
+        if excludes.get(string.upper(lib),0):
+            continue
+        if seen.get(string.upper(lib),0):
+            continue
+        if iswin or cygwin:
+            npth = getfullnameof(lib, os.path.dirname(pth))
+        if npth:
+            lTOC.append((lib, npth, 'BINARY'))
+        else:
+            print "E: lib not found:", lib, "dependency of", pth
+  return lTOC
+
+def getImports3(pth):
+    """Find the binary dependencies of PTH.
+
+        This implementation is for ldd platforms"""
+    rslt = []
+    for line in os.popen('ldd "%s"' % pth).readlines():
+        m = re.search(r"\s+(.*?)\s+=>\s+(.*?)\s+\(.*\)", line)
+        if m:
+            name, lib = m.group(1), m.group(2)
+            if name[:10] == 'linux-gate':
+                # linux-gate is a fake library which does not exist and
+                # should be ignored. See also:
+                # http://www.trilithium.com/johan/2005/08/linux-gate/
+                continue
+            if os.path.exists(lib):
+                rslt.append(lib)
+            else:
+                print 'E: cannot find %s in path %s (needed by %s)' % \
+                      (name, lib, pth)
+    return rslt
+
+def getImports(pth):
+    """Forwards to either getImports2 or getImports3
+    """
+    if sys.platform[:3] == 'win' or sys.platform == 'cygwin':
+        return getImports2(pth)
+    return getImports3(pth)
+
+def getWindowsPath():
+    """Return the path that Windows will search for dlls."""
+    global _bpath
+    if _bpath is None:
+        _bpath = []
+        if iswin:
+            try:
+                import win32api
+            except ImportError:
+                print "W: Cannot determine your Windows or System directories"
+                print "W: Please add them to your PATH if .dlls are not found"
+                print "W: or install starship.python.net/skippy/win32/Downloads.html"
+            else:
+                sysdir = win32api.GetSystemDirectory()
+                sysdir2 = os.path.normpath(os.path.join(sysdir, '..', 'SYSTEM'))
+                windir = win32api.GetWindowsDirectory()
+                _bpath = [sysdir, sysdir2, windir]
+        _bpath.extend(string.split(os.environ.get('PATH', ''), os.pathsep))
+    return _bpath
+
+if __name__ == "__main__":
+  if len(sys.argv) < 2:
+    print "Usage: python %s BINARYFILE" % sys.argv[0]
+    sys.exit(0)
+  print getImports(sys.argv[1])
Binary file srcanamdw/codescanner/pyinstaller/bindepend.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/hooks1/hook-pkg1.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,11 @@
+attrs = [('notamodule','')]
+def hook(mod):
+    import os, sys, marshal
+    other = os.path.join(mod.__path__[0], '../pkg2/__init__.pyc')
+    if os.path.exists(other):
+        co = marshal.loads(open(other,'rb').read()[8:])
+    else:
+        co = compile(open(other[:-1],'r').read()+'\n', other, 'exec')
+    mod.__init__(mod.__name__, other, co)
+    mod.__path__.append(os.path.join(mod.__path__[0], 'extra'))
+    return mod
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/pkg1/__init__.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,10 @@
+""" pkg1 replaces itself with pkg2"""
+
+__all__ = ["a", "b"]
+import pkg2
+import sys
+sys.modules[__name__] = pkg2
+from pkg2 import *
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/pkg1/a.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,6 @@
+""" pkg1.a.py is never imported """
+
+print " %s" % __doc__
+print " %s %s" % (__name__, __file__)
+
+   
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/pkg2/__init__.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,9 @@
+""" pkg2 does various namespace tricks, __path__ append """
+
+def notamodule():
+    return "notamodule from pkg2.__init__"
+
+import os
+__path__.append(os.path.join(
+    os.path.dirname(__file__), 'extra'))
+__all__ = ["a", "b", "notamodule"]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/pkg2/a.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,6 @@
+""" pkg2.a defines overridden and a_func """
+
+def a_func():
+    return "a_func from pkg2.a"
+print "pkg2.a imported"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/pkg2/a/readme.txt	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,1 @@
+There is no __init__.py in this directory, so pkg2.a refers to ../a.py, not this.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/pkg2/extra/b.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,4 @@
+""" b.py lives in extra, but shows as pkg2.b (and pkg1.b)"""
+
+def b_func():
+    return  "b_func from pkg2.b (pkg2/extra/b.py)"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/runtests.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,79 @@
+#!/usr/bin/env python
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+# This program will execute any file with name test*<digit>.py. If your test
+# need an aditional dependency name it test*<digit><letter>.py to be ignored
+# by this program but be recognizable by any one as a dependency of that
+# particual test.
+
+import os, sys, glob, string
+import shutil
+try:
+    here=os.path.dirname(__file__)
+except NameError:
+    here=os.path.dirname(sys.argv[0])
+PYTHON = sys.executable
+if sys.platform[:3] == 'win':
+    if string.find(PYTHON, ' ') > -1:
+        PYTHON='"%s"' % PYTHON
+
+def clean():
+    distdirs = glob.glob(os.path.join(here, 'disttest*'))
+    for dir in distdirs:
+        try:
+            shutil.rmtree(dir)
+        except OSError, e:
+            print e
+    builddirs = glob.glob(os.path.join(here, 'buildtest*'))
+    for dir in builddirs:
+        try:
+            shutil.rmtree(dir)
+        except OSError, e:
+            print e
+    wfiles = glob.glob(os.path.join(here, 'warn*.txt'))
+    for file in wfiles:
+        try:
+            os.remove(file)
+        except OSError, e:
+            print e
+
+def runtests():
+    global here
+    sources = glob.glob(os.path.join(here, 'test*[0-9].py'))
+    path = os.environ["PATH"]
+    for src in sources:
+        print
+        print "################## EXECUTING TEST %s ################################" % src
+        print
+        test = os.path.splitext(os.path.basename(src))[0]
+        os.system('%s ../Build.py %s' % (PYTHON, test+".spec"))
+        # Run the test in a clean environment to make sure they're really self-contained
+        del os.environ["PATH"]
+        os.system('dist%s%s%s' % (test, os.sep, test))
+        os.environ["PATH"] = path
+        print "################## FINISHING TEST %s  ################################" % src
+
+if __name__ == '__main__':
+    if len(sys.argv) == 1:
+        clean()
+        runtests()
+    if '--clean' in sys.argv:
+        clean()
+    if '--run' in sys.argv:
+        runtests()
+    raw_input("Press any key to exit")
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/test1.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,34 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+print "test1 - hooks / strange pkg structures"
+e1 = 'a_func from pkg2.a'
+e2 = 'b_func from pkg2.b (pkg2/extra/b.py)'
+e3 = 'notamodule from pkg2.__init__'
+from pkg1 import *
+t1 = a.a_func()
+if t1 != e1:
+    print "expected:", e1
+    print "     got:", t1
+t2 = b.b_func()
+if t2 != e2:
+    print "expected:", e2
+    print "     got:", t2
+t3 = notamodule()
+if t3 != e3:
+    print "expected:", e3
+    print "     got:", t3
+print "test1 complete"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/test1.spec	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,13 @@
+a = Analysis(['../support/_mountzlib.py', 'test1.py'],
+             pathex=[],
+             hookspath=['hooks1'])
+pyz = PYZ(a.pure)
+exe = EXE(pyz,
+          a.scripts,
+          exclude_binaries=1,
+          name='buildtest1/test1.exe',
+          debug=0,
+          console=1)
+coll = COLLECT( exe,
+               a.binaries,
+               name='disttest1')
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/test2-version.txt	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,38 @@
+VSVersionInfo(
+    ffi=FixedFileInfo(
+		filevers=(96, 12, 19, 1), 
+		prodvers=(4, 1, 2, 1),
+ 		mask=0x3f, 
+		flags=0x0, 
+		OS=0x40004, 
+		fileType=0x1, 
+		subtype=0x0, 
+		date=(0, 0)
+	), 
+    kids=[
+	StringFileInfo(
+	    [
+		StringTable(
+		    '040904b0', 
+		    [
+			StringStruct('Comments', 'Designed and coded by Elmer Fudd'), 
+			StringStruct('CompanyName', 'Fuddy Duddies, Inc. 8 Flossie Dr. Arlington, VA 00001'), 
+			StringStruct('FileDescription', 'Silly stuff'), 
+			StringStruct('FileVersion', '96, 12, 19, 1'), 
+			StringStruct('InternalName', 'SILLINESS'), 
+			StringStruct('LegalCopyright', 'Copyright 2001 Fuddy Duddies, Inc.'), 
+			StringStruct('LegalTrademarks', 'SILLINESS is a registered trademark of Fuddy Duddies, Inc.'), 
+			StringStruct('OriginalFilename', 'silliness.exe'), 
+			StringStruct('ProductName', 'SILLINESS'), 
+			StringStruct('ProductVersion', '2, 0, 3, 0')
+		    ]
+		)
+	    ]
+	),
+	VarFileInfo(
+	    [
+		VarStruct('Translation', [1033, 1200])
+	    ]
+	)
+    ]
+)
\ No newline at end of file
Binary file srcanamdw/codescanner/pyinstaller/buildtests/test2.ico has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/test2.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,34 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+print "test2 - version, icon, no zlib (should run same as test1)"
+e1 = 'a_func from pkg2.a'
+e2 = 'b_func from pkg2.b (pkg2/extra/b.py)'
+e3 = 'notamodule from pkg2.__init__'
+from pkg1 import *
+t1 = a.a_func()
+if t1 != e1:
+    print "expected:", e1
+    print "     got:", t1
+t2 = b.b_func()
+if t2 != e2:
+    print "expected:", e2
+    print "     got:", t2
+t3 = notamodule()
+if t3 != e3:
+    print "expected:", e3
+    print "     got:", t3
+print "test2 complete"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/test2.spec	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,16 @@
+config['useZLIB'] = 0
+a = Analysis(['../support/_mountzlib.py', 'test2.py'],
+             pathex=[],
+             hookspath=['hooks1'])
+pyz = PYZ(a.pure, level=0)
+exe = EXE(pyz,
+          a.scripts,
+          exclude_binaries=1,
+          name='buildtest2/test2.exe',
+          icon='test2.ico',
+          version='test2-version.txt',
+          debug=0,
+          console=1)
+coll = COLLECT( exe,
+               a.binaries - [('zlib','','EXTENSION')],
+               name='disttest2')
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/test3.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,23 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+print "test3 - test 'f' option (just show os.environ)"
+import os, sys
+if sys.platform[:3] == 'win':
+    print " sorry, no use / need for the 'f' option on Windows"
+else:
+    print " LD_LIBRARY_PATH %s" % os.environ.get('LD_LIBRARY_PATH', '<None!>')
+print "test3 complete"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/test3.spec	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,13 @@
+a = Analysis(['../support/_mountzlib.py', 'test3.py'],
+             pathex=[])
+pyz = PYZ(a.pure)
+exe = EXE(pyz,
+          a.scripts,
+          [('f','','OPTION')],
+          exclude_binaries=1,
+          name='buildtest3/test3.exe',
+          debug=0,
+          console=1)
+coll = COLLECT( exe,
+               a.binaries,
+               name='disttest3')
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/test4.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,30 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+print "test4 - unbufferred"
+print "type: 123456<enter>"
+print "should see: 12345"
+print "type: <enter>"
+print "if unbuffered should see: 6"
+print "if NOT unbuffered, should see nothing"
+print "Q to quit"
+import sys
+while 1:
+    data = sys.stdin.read(5)
+    sys.stdout.write(data)
+    if 'Q' in data:
+        break
+print "test4 - done"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/test4.spec	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,13 @@
+a = Analysis(['../support/_mountzlib.py', 'test4.py'],
+             pathex=[])
+pyz = PYZ(a.pure)
+exe = EXE(pyz,
+          a.scripts,
+          [('u', '', 'OPTION')],
+          exclude_binaries=1,
+          name='buildtest4/test4.exe',
+          debug=0,
+          console=1)
+coll = COLLECT( exe,
+               a.binaries,
+               name='disttest4')
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/test5.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,19 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+print "test5 - W ignore"
+import regex
+print "test5 - done"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/test5.spec	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,13 @@
+a = Analysis(['../support/_mountzlib.py', 'test5.py'],
+             pathex=[])
+pyz = PYZ(a.pure)
+exe = EXE(pyz,
+          a.scripts,
+          [('W ignore', '', 'OPTION')],
+          exclude_binaries=1,
+          name='buildtest5/test5.exe',
+          debug=0,
+          console=1)
+coll = COLLECT( exe,
+               a.binaries,
+               name='disttest5')
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/test6.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,29 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+import sys, os
+import test6x
+print "test6x.x is", test6x.x
+txt = """\
+x = %d
+""" % (test6x.x + 1)
+if hasattr(sys, 'frozen'):
+    open(os.path.join(os.path.dirname(sys.executable), 'test6x.py'), 'w').write(txt)
+else:
+    open(test6x.__file__, 'w').write(txt)
+reload(test6x)
+print "test6x.x is now", test6x.x
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/test6.spec	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,12 @@
+a = Analysis(['../support/_mountzlib.py', 'test6.py'],
+             pathex=[])
+pyz = PYZ(a.pure)
+exe = EXE(pyz,
+          a.scripts,
+          exclude_binaries=1,
+          name='buildtest6/test6.exe',
+          debug=0,
+          console=1)
+coll = COLLECT( exe,
+               a.binaries,
+               name='disttest6')
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/test6x.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,1 @@
+x = 2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/test7.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,32 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+import sys
+import threading
+
+def doit(nm):
+    print nm, 'started'
+    import test7x
+    print nm, test7x.x
+
+t1 = threading.Thread(target=doit, args=('t1',))
+t2 = threading.Thread(target=doit, args=('t2',))
+t1.start()
+t2.start()
+doit('main')
+t1.join()
+t2.join()
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/test7.spec	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,12 @@
+a = Analysis(['../support/_mountzlib.py', 'test7.py'],
+             pathex=[])
+pyz = PYZ(a.pure)
+exe = EXE(pyz,
+          a.scripts,
+          exclude_binaries=1,
+          name='buildtest7/test7.exe',
+          debug=0,
+          console=1)
+coll = COLLECT( exe,
+               a.binaries,
+               name='disttest7')
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/test7x.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,21 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+#nasty
+import time
+time.sleep(5)
+x = 5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/test8.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+import sys
+
+try:
+    import codecs
+except ImportError:
+    print "This test works only with Python versions that support Unicode"
+    sys.exit(0)
+
+a = "foo bar"
+au = codecs.getdecoder("utf-8")(a)[0]
+b = codecs.getencoder("utf-8")(au)[0]
+print "codecs working:", a == b
+assert a == b
+sys.exit(0)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/test8.spec	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,18 @@
+a = Analysis([os.path.join(HOMEPATH,'support', '_mountzlib.py'),
+              os.path.join(HOMEPATH,'support', 'useUnicode.py'),
+              'test8.py'],
+             pathex=['.'])
+pyz = PYZ(a.pure)
+exe = EXE(pyz,
+          a.scripts,
+          exclude_binaries=1,
+          name='buildtest8/test8.exe',
+          debug=0,
+          strip=0,
+          upx=0,
+          console=1 )
+coll = COLLECT( exe,
+               a.binaries,
+               strip=0,
+               upx=0,
+               name='disttest8')
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/test9.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,3 @@
+#!/usr/bin/env python
+import time
+print time.strptime(time.ctime())
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/buildtests/test9.spec	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,18 @@
+a = Analysis([os.path.join(HOMEPATH,'support', '_mountzlib.py'),
+              os.path.join(HOMEPATH,'support', 'useUnicode.py'),
+              'test9.py'],
+             pathex=['.'])
+pyz = PYZ(a.pure)
+exe = EXE(pyz,
+          a.scripts,
+          exclude_binaries=1,
+          name='buildtest9/test9.exe',
+          debug=False,
+          strip=False,
+          upx=False,
+          console=True )
+coll = COLLECT( exe,
+               a.binaries,
+               strip=False,
+               upx=False,
+               name='disttest9')
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/carchive.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,273 @@
+# Subclass of Archive that can be understood by a C program (see launch.c).
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 1999, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+import archive
+import struct
+try:
+  import zlib
+except ImportError:
+  zlib = archive.DummyZlib()
+import sys
+if sys.version[0] == '1':
+    import strop
+    find = strop.find
+    split = strop.split
+else:
+    def find(s, sub):
+        return s.find(sub)
+    def split(s, delim, count):
+        return s.split(delim, count)
+
+class CTOC:
+  """A class encapsulating the table of contents of a CArchive.
+
+     When written to disk, it is easily read from C."""
+  ENTRYSTRUCT = '!iiiibc' #(structlen, dpos, dlen, ulen, flag, typcd) followed by name
+  def __init__(self):
+    self.data = []
+
+  def frombinary(self, s):
+    """Decode the binary string into an in memory list.
+
+        S is a binary string."""
+    entrylen = struct.calcsize(self.ENTRYSTRUCT)
+    p = 0
+    while p<len(s):
+      (slen, dpos, dlen, ulen, flag, typcd) = struct.unpack(self.ENTRYSTRUCT,
+                                                  s[p:p+entrylen])
+      nmlen = slen - entrylen
+      p = p + entrylen
+      (nm,) = struct.unpack(`nmlen`+'s', s[p:p+nmlen])
+      p = p + nmlen
+      # version 4
+      # self.data.append((dpos, dlen, ulen, flag, typcd, nm[:-1]))
+      # version 5
+      # nm may have up to 15 bytes of padding
+      pos = find(nm, '\0')
+      if pos < 0:
+          self.data.append((dpos, dlen, ulen, flag, typcd, nm))
+      else:
+          self.data.append((dpos, dlen, ulen, flag, typcd, nm[:pos]))
+      #end version 5
+
+
+  def tobinary(self):
+    """Return self as a binary string."""
+    import string
+    entrylen = struct.calcsize(self.ENTRYSTRUCT)
+    rslt = []
+    for (dpos, dlen, ulen, flag, typcd, nm) in self.data:
+      nmlen = len(nm) + 1	# add 1 for a '\0'
+      # version 4
+      # rslt.append(struct.pack(self.ENTRYSTRUCT+`nmlen`+'s',
+      #   nmlen+entrylen, dpos, dlen, ulen, flag, typcd, nm+'\0'))
+      # version 5
+      #   align to 16 byte boundary so xplatform C can read
+      toclen = nmlen + entrylen
+      if toclen % 16 == 0:
+          pad = '\0'
+      else:
+          padlen = 16 - (toclen % 16)
+          pad = '\0'*padlen
+          nmlen = nmlen + padlen
+      rslt.append(struct.pack(self.ENTRYSTRUCT+`nmlen`+'s',
+                      nmlen+entrylen, dpos, dlen, ulen, flag, typcd, nm+pad))
+      # end version 5
+
+    return string.join(rslt, '')
+
+  def add(self, dpos, dlen, ulen, flag, typcd, nm):
+    """Add an entry to the table of contents.
+
+       DPOS is data position.
+       DLEN is data length.
+       ULEN is the uncompressed data len.
+       FLAG says if the data is compressed.
+       TYPCD is the "type" of the entry (used by the C code)
+       NM is the entry's name."""
+    self.data.append((dpos, dlen, ulen, flag, typcd, nm))
+
+  def get(self, ndx):
+    """return the toc entry (tuple) at index NDX"""
+    return self.data[ndx]
+
+  def __getitem__(self, ndx):
+    return self.data[ndx]
+
+  def find(self, name):
+    """Return the index of the toc entry with name NAME.
+
+       Return -1 for failure."""
+    for i in range(len(self.data)):
+      if self.data[i][-1] == name:
+        return i
+    return -1
+
+class CArchive(archive.Archive):
+  """An Archive subclass that an hold arbitrary data.
+
+     Easily handled from C or from Python."""
+  MAGIC = 'MEI\014\013\012\013\016'
+  HDRLEN = 0
+  TOCTMPLT = CTOC
+  TRLSTRUCT = '!8siiii'
+  TRLLEN = 24
+  LEVEL = 9
+  def __init__(self, path=None, start=0, len=0):
+    """Constructor.
+
+       PATH is path name of file (create an empty CArchive if path is None).
+       START is the seekposition within PATH.
+       LEN is the length of the CArchive (if 0, then read till EOF). """
+    self.len = len
+    archive.Archive.__init__(self, path, start)
+
+  def checkmagic(self):
+    """Verify that self is a valid CArchive.
+
+        Magic signature is at end of the archive."""
+    #magic is at EOF; if we're embedded, we need to figure where that is
+    if self.len:
+      self.lib.seek(self.start+self.len, 0)
+    else:
+      self.lib.seek(0, 2)
+    filelen = self.lib.tell()
+    if self.len:
+      self.lib.seek(self.start+self.len-self.TRLLEN, 0)
+    else:
+      self.lib.seek(-self.TRLLEN, 2)
+    (magic, totallen, tocpos, toclen, pyvers) = struct.unpack(self.TRLSTRUCT,
+                        self.lib.read(self.TRLLEN))
+    if magic != self.MAGIC:
+      raise RuntimeError, "%s is not a valid %s archive file" \
+        % (self.path, self.__class__.__name__)
+    self.pkgstart = filelen - totallen
+    if self.len:
+      if totallen != self.len or self.pkgstart != self.start:
+        raise RuntimeError, "Problem with embedded archive in %s" % self.path
+    self.tocpos, self.toclen = tocpos, toclen
+
+  def loadtoc(self):
+    """Load the table of contents into memory."""
+    self.toc = self.TOCTMPLT()
+    self.lib.seek(self.pkgstart+self.tocpos)
+    tocstr = self.lib.read(self.toclen)
+    self.toc.frombinary(tocstr)
+
+  def extract(self, name):
+    """Get the contents of an entry.
+
+       NAME is an entry name.
+       Return the tuple (ispkg, contents).
+       For non-Python resoures, ispkg is meaningless (and 0).
+       Used by the import mechanism."""
+    if type(name) == type(''):
+      ndx = self.toc.find(name)
+      if ndx == -1:
+        return None
+    else:
+      ndx = name
+    (dpos, dlen, ulen, flag, typcd, nm) = self.toc.get(ndx)
+    self.lib.seek(self.pkgstart+dpos)
+    rslt = self.lib.read(dlen)
+    if flag == 1:
+      rslt = zlib.decompress(rslt)
+    if typcd == 'M':
+      return (1, rslt)
+    return (0, rslt)
+
+  def contents(self):
+    """Return the names of the entries"""
+    rslt = []
+    for (dpos, dlen, ulen, flag, typcd, nm) in self.toc:
+      rslt.append(nm)
+    return rslt
+
+  def add(self, entry):
+    """Add an ENTRY to the CArchive.
+
+       ENTRY must have:
+         entry[0] is name (under which it will be saved).
+         entry[1] is fullpathname of the file.
+         entry[2] is a flag for it's storage format (0==uncompressed,
+         1==compressed)
+         entry[3] is the entry's type code.
+         Version 5:
+           If the type code is 'o':
+             entry[0] is the runtime option
+             eg: v  (meaning verbose imports)
+                 u  (menaing unbuffered)
+                 W arg (warning option arg)
+                 s  (meaning do site.py processing."""
+    (nm, pathnm, flag, typcd) = entry[:4]
+    # version 5 - allow type 'o' = runtime option
+    try:
+      if typcd == 'o':
+          s = ''
+          flag = 0
+      elif typcd == 's':
+          # If it's a source code file, add \0 terminator as it will be
+          # executed as-is by the bootloader.
+          s = open(pathnm, 'r').read()
+          s = s + '\n\0'
+      else:
+          s = open(pathnm, 'rb').read()
+    except IOError:
+      print "Cannot find ('%s', '%s', %s, '%s')" % (nm, pathnm, flag, typcd)
+      raise
+    ulen = len(s)
+    if flag == 1:
+      s = zlib.compress(s, self.LEVEL)
+    dlen = len(s)
+    where = self.lib.tell()
+    if typcd == 'm':
+      if find(pathnm, '.__init__.py') > -1:
+        typcd = 'M'
+    self.toc.add(where, dlen, ulen, flag, typcd, nm)
+    self.lib.write(s)
+
+  def save_toc(self, tocpos):
+    """Save the table of contents to disk."""
+    self.tocpos = tocpos
+    tocstr = self.toc.tobinary()
+    self.toclen = len(tocstr)
+    self.lib.write(tocstr)
+
+  def save_trailer(self, tocpos):
+    """Save the trailer to disk.
+
+       CArchives can be opened from the end - the trailer points
+       back to the start. """
+    totallen = tocpos + self.toclen + self.TRLLEN
+    if hasattr(sys, "version_info"):
+        pyvers = sys.version_info[0]*10 + sys.version_info[1]
+    else:
+        toks = split(sys.version, '.', 2)
+        pyvers = int(toks[0])*10 + int(toks[1])
+    trl = struct.pack(self.TRLSTRUCT, self.MAGIC, totallen,
+                      tocpos, self.toclen, pyvers)
+    self.lib.write(trl)
+
+  def openEmbedded(self, name):
+    """Open a CArchive of name NAME embedded within this CArchive."""
+    ndx = self.toc.find(name)
+    if ndx == -1:
+      raise KeyError, "Member '%s' not found in %s" % (name, self.path)
+    (dpos, dlen, ulen, flag, typcd, nm) = self.toc.get(ndx)
+    if flag:
+      raise ValueError, "Cannot open compressed archive %s in place"
+    return CArchive(self.path, self.pkgstart+dpos, dlen)
Binary file srcanamdw/codescanner/pyinstaller/carchive.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/config.dat	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,26 @@
+{'EXE_dependencies': [('python25.dll',
+                       'c:\\apps\\actpython\\python25.dll',
+                       'BINARY'),
+                      ('MSVCR71.dll',
+                       'C:\\WINNT\\system32\\MSVCR71.dll',
+                       'BINARY'),
+                      ('MSVCR71.dll',
+                       'C:\\WINNT\\system32\\MSVCR71.dll',
+                       'BINARY')],
+ 'PYZ_dependencies': [('iu',
+                       'S:\\codescanner\\pyinstaller\\iu.pyc',
+                       'PYMODULE'),
+                      ('struct',
+                       'c:\\apps\\actpython\\lib\\struct.pyc',
+                       'PYMODULE'),
+                      ('archive',
+                       'S:\\codescanner\\pyinstaller\\archive.pyc',
+                       'PYMODULE')],
+ 'TCL_root': 'c:\\apps\\actpython\\DLLs\\../tcl\\tcl8.4',
+ 'TK_root': 'c:\\apps\\actpython\\DLLs\\../tcl\\tk8.4',
+ 'hasRsrcUpdate': 1,
+ 'hasUPX': 0,
+ 'hasUnicode': 1,
+ 'pythonVersion': '2.5.2 (r252:60911, Mar 27 2008, 17:57:18) [MSC v.1310 32 bit (Intel)]',
+ 'useELFEXE': 1,
+ 'useZLIB': 1}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/doc/CHANGES.txt	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,78 @@
+(+ user visible changes, * internal stuff)
+
+
+PyInstaller 1.3
+---------------
+ + Fix bug with user-provided icons disappearing from built executables
+   when these were compressed with UPX.
+ + Fix problems with packaging of applications using PIL (that was broken
+   because of a bug in Python's import machinery, in recent Python
+   versions). Also add a workaround including Tcl/Tk with PIL unless
+   ImageTk is imported.
+ + (Windows) When used under Windows XP, packaged programs now have
+   the correct look & feel and follow user's themes (thanks to the manifest
+   file being linked within the generated executable). This is especially
+   useful for applications using wxPython.
+ + Fix a buffer overrun in the bootloader (which could lead to a crash)
+   when the built executable is run from within a deep directory (more than
+   70-80 characters in the pathname).
+ * Bootstrap modules are now compressed in the executable (so that they
+   are not visible in plaintext by just looking at it with a hex editor).
+ * Fixed a regression introduced in 1.1: under Linux, the bootloader does
+   not depend on libpythonX.X.so anymore.
+
+
+PyInstaller 1.2
+---------------
+ + Fix a crash when invoking UPX with certain kinds of builds.
+ + Fix icon support by re-adding a resource section in the bootloader
+   executable.
+
+
+PyInstaller 1.1
+---------------
+
+ + (Windows) Make single-file packages not depend on MSVCRT71.DLL anymore,
+   even under Python 2.4. You can eventually ship your programs really as
+   single-file executables, even when using the newest Python version!
+ + Fix problem with incorrect python path detection. Now using helpers from
+   distutils.
+ + Fix problem with rare encodings introduced in newer Python versions: now all
+   the encodings are automatically found and included, so this problem should
+   be gone forever.
+ + Fix building of COM servers (was broken in 1.0 because of the new build
+   system).
+ + Mimic Python 2.4 behaviour with broken imports: sys.modules is cleaned up
+   afterwise. This allows to package SQLObject applications under Windows
+   with Python 2.4 and above.
+ + Add import hook for the following packages:
+     + GTK
+     + PyOpenGL (tested 2.0.1.09)
+     + dsnpython (tested 1.3.4)
+     + KInterasDB (courtesy of Eugene Prigorodov)
+ + Fix packaging of code using "time.strptime" under Python 2.3+.
+ + (Linux) Ignore linux-gate.so while calculating dependencies (fix provided
+   by Vikram Aggarwal).
+ + (Windows) With Python 2.4, setup UPX properly so to be able to compress
+   binaries generated with Visual Studio .NET 2003 (such as most of the
+   extensions). UPX 1.92+ is needed for this.
+
+
+PyInstaller 1.0 (with respect to McMillan's Python Installer 5b5):
+---------------
+
+ + Add support for Python 2.3 (fix packaging of codecs).
+ + Add support for Python 2.4 (under Windows, needed to recompiled the
+   bootloader with a different compiler version).
+ + Fix support for Python 1.5.2, should be fully functional now (required
+   to rewrite some parts of the string module for the bootloader).
+ + Fix a rare bug in extracting the dependencies of a DLL (bug in PE header
+   parser).
+ + Fix packaging of PyQt programs (needed an import hook for a hidden import).
+ + Fix imports calculation for modules using the "from __init__ import" syntax.
+ + Fix a packaging bug when a module was being import both through binary
+   dependency and direct import.
+
+ * Restyle documentation (now using docutils and reStructuredText).
+ * New Windows build system for automatic compilations of bootloader in all
+   the required flavours (using Scons)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/doc/KNOWNBUGS.txt	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,24 @@
+==========
+KNOWN BUGS
+==========
+
+Consult http://pyinstaller.hpcf.upr.edu/cgi-bin/trac.cgi/report/1 for the
+current list of Known Bugs.
+
+
+New platforms development status
+================================
+**NOTE**: These platforms are not supported, they are in development
+
+MacOS X (darwin)
+----------------
+	- python framework not detected correctly (broken path in generated Makefile)
+	- multiple definition of objects
+
+SGI IRIX
+--------
+	- Done
+
+Solaris
+-------
+	- (need developer)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/doc/LICENSE.GPL	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,280 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/doc/Manual.html	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,1561 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta name="generator" content="Docutils 0.3.10: http://docutils.sourceforge.net/" />
+<title>PyInstaller Manual</title>
+<meta name="author" content="William Caban (based on Gordon McMillan's manual)" />
+<meta name="copyright" content="This document has been placed in the public domain." />
+<link rel="stylesheet" href="stylesheets/default.css" type="text/css" />
+</head>
+<body>
+<div class="document" id="pyinstaller-manual">
+<h1 class="title">PyInstaller Manual</h1>
+<table class="docinfo" frame="void" rules="none">
+<col class="docinfo-name" />
+<col class="docinfo-content" />
+<tbody valign="top">
+<tr><th class="docinfo-name">Author:</th>
+<td>William Caban (based on Gordon McMillan's manual)</td></tr>
+<tr><th class="docinfo-name">Contact:</th>
+<td><a class="first last reference" href="mailto:william&#64;hpcf.upr.edu">william&#64;hpcf.upr.edu</a></td></tr>
+<tr><th class="docinfo-name">Revision:</th>
+<td>257</td></tr>
+<tr class="field"><th class="docinfo-name">Source URL:</th><td class="field-body">svn://pyinstaller/trunk/doc/source/Manual.rst</td>
+</tr>
+<tr><th class="docinfo-name">Copyright:</th>
+<td>This document has been placed in the public domain.</td></tr>
+</tbody>
+</table>
+<div class="contents topic">
+<p class="topic-title first"><a id="contents" name="contents">Contents</a></p>
+<ul class="simple">
+<li><a class="reference" href="#getting-started" id="id2" name="id2">Getting Started</a><ul>
+<li><a class="reference" href="#installing-pyinstaller" id="id3" name="id3">Installing PyInstaller</a></li>
+<li><a class="reference" href="#building-the-runtime-executables" id="id4" name="id4">Building the runtime executables</a></li>
+<li><a class="reference" href="#configuring-your-pyinstaller-setup" id="id5" name="id5">Configuring your PyInstaller setup</a></li>
+<li><a class="reference" href="#create-a-spec-file-for-your-project" id="id6" name="id6">Create a spec file for your project</a></li>
+<li><a class="reference" href="#build-your-project" id="id7" name="id7">Build your project</a></li>
+<li><a class="reference" href="#windows-com-server-support" id="id8" name="id8">Windows COM Server support</a></li>
+<li><a class="reference" href="#building-optimized" id="id9" name="id9">Building Optimized</a></li>
+<li><a class="reference" href="#a-note-on-using-upx" id="id10" name="id10">A Note on using UPX</a></li>
+<li><a class="reference" href="#a-note-on-onefile" id="id11" name="id11">A Note on <tt class="docutils literal"><span class="pre">--onefile</span></tt></a></li>
+<li><a class="reference" href="#a-note-on-egg-files-and-setuptools" id="id12" name="id12">A Note on .egg files and setuptools</a></li>
+</ul>
+</li>
+<li><a class="reference" href="#pyinstaller-utilities" id="id13" name="id13">PyInstaller Utilities</a><ul>
+<li><a class="reference" href="#archiveviewer" id="id14" name="id14">ArchiveViewer</a></li>
+<li><a class="reference" href="#bindepend" id="id15" name="id15">bindepend</a></li>
+<li><a class="reference" href="#grabversion-windows" id="id16" name="id16">GrabVersion (Windows)</a></li>
+<li><a class="reference" href="#analyzing-dependencies" id="id17" name="id17">Analyzing Dependencies</a></li>
+</ul>
+</li>
+<li><a class="reference" href="#spec-files" id="id18" name="id18">Spec Files</a><ul>
+<li><a class="reference" href="#introduction" id="id19" name="id19">Introduction</a></li>
+<li><a class="reference" href="#toc-class-table-of-contents" id="id20" name="id20">TOC Class (Table of Contents)</a></li>
+<li><a class="reference" href="#target-subclasses" id="id21" name="id21">Target Subclasses</a><ul>
+<li><a class="reference" href="#analysis" id="id22" name="id22">Analysis</a></li>
+<li><a class="reference" href="#pyz" id="id23" name="id23">PYZ</a></li>
+<li><a class="reference" href="#pkg" id="id24" name="id24">PKG</a></li>
+<li><a class="reference" href="#exe" id="id25" name="id25">EXE</a></li>
+<li><a class="reference" href="#dll" id="id26" name="id26">DLL</a></li>
+<li><a class="reference" href="#collect" id="id27" name="id27">COLLECT</a></li>
+<li><a class="reference" href="#tree" id="id28" name="id28">Tree</a></li>
+</ul>
+</li>
+</ul>
+</li>
+<li><a class="reference" href="#when-things-go-wrong" id="id29" name="id29">When Things Go Wrong</a><ul>
+<li><a class="reference" href="#finding-out-what-went-wrong" id="id30" name="id30">Finding out What Went Wrong</a><ul>
+<li><a class="reference" href="#buildtime-warnings" id="id31" name="id31">Buildtime Warnings</a></li>
+<li><a class="reference" href="#getting-debug-messages" id="id32" name="id32">Getting Debug Messages</a></li>
+<li><a class="reference" href="#getting-python-s-verbose-imports" id="id33" name="id33">Getting Python's Verbose Imports</a></li>
+</ul>
+</li>
+<li><a class="reference" href="#helping-installer-find-modules" id="id34" name="id34">Helping Installer Find Modules</a><ul>
+<li><a class="reference" href="#extending-the-path" id="id35" name="id35">Extending the Path</a></li>
+<li><a class="reference" href="#listing-hidden-imports" id="id36" name="id36">Listing Hidden Imports</a></li>
+<li><a class="reference" href="#extending-a-package-s-path" id="id37" name="id37">Extending a Package's <tt class="docutils literal"><span class="pre">__path__</span></tt></a></li>
+<li><a class="reference" href="#changing-runtime-behavior" id="id38" name="id38">Changing Runtime Behavior</a></li>
+<li><a class="reference" href="#adapting-to-being-frozen" id="id39" name="id39">Adapting to being &quot;frozen&quot;</a></li>
+<li><a class="reference" href="#accessing-data-files" id="id40" name="id40">Accessing Data Files</a></li>
+</ul>
+</li>
+</ul>
+</li>
+<li><a class="reference" href="#miscellaneous" id="id41" name="id41">Miscellaneous</a><ul>
+<li><a class="reference" href="#pmw-python-mega-widgets" id="id42" name="id42">Pmw -- Python Mega Widgets</a></li>
+<li><a class="reference" href="#win9xpopen" id="id43" name="id43">Win9xpopen</a></li>
+<li><a class="reference" href="#self-extracting-executables" id="id44" name="id44">Self-extracting executables</a><ul>
+<li><a class="reference" href="#one-pass-execution" id="id45" name="id45">One Pass Execution</a></li>
+<li><a class="reference" href="#two-pass-execution" id="id46" name="id46">Two Pass Execution</a></li>
+</ul>
+</li>
+</ul>
+</li>
+<li><a class="reference" href="#pyinstaller-archives" id="id47" name="id47">PyInstaller Archives</a><ul>
+<li><a class="reference" href="#archives-introduction" id="id48" name="id48">Archives Introduction</a></li>
+<li><a class="reference" href="#zlibarchive" id="id49" name="id49"><tt class="docutils literal"><span class="pre">ZlibArchive</span></tt></a></li>
+<li><a class="reference" href="#carchive" id="id50" name="id50"><tt class="docutils literal"><span class="pre">CArchive</span></tt></a></li>
+</ul>
+</li>
+<li><a class="reference" href="#license" id="id51" name="id51">License</a></li>
+<li><a class="reference" href="#appendix" id="id52" name="id52">Appendix</a><ul>
+<li><a class="reference" href="#mf-py-a-modulefinder-replacement" id="id53" name="id53"><tt class="docutils literal"><span class="pre">mf.py</span></tt>: A Modulefinder Replacement</a><ul>
+<li><a class="reference" href="#importtracker" id="id54" name="id54">ImportTracker</a></li>
+<li><a class="reference" href="#analyze-one" id="id55" name="id55"><tt class="docutils literal"><span class="pre">analyze_one()</span></tt></a></li>
+<li><a class="reference" href="#module-classes" id="id56" name="id56">Module Classes</a></li>
+<li><a class="reference" href="#code-scanning" id="id57" name="id57">code scanning</a></li>
+<li><a class="reference" href="#hooks" id="id58" name="id58">Hooks</a></li>
+<li><a class="reference" href="#warnings" id="id59" name="id59">Warnings</a></li>
+<li><a class="reference" href="#cross-reference" id="id60" name="id60">Cross Reference</a></li>
+<li><a class="reference" href="#usage" id="id61" name="id61">Usage</a></li>
+</ul>
+</li>
+<li><a class="reference" href="#iu-py-an-imputil-replacement" id="id62" name="id62"><tt class="docutils literal"><span class="pre">iu.py</span></tt>: An <em>imputil</em> Replacement</a><ul>
+<li><a class="reference" href="#importmanager" id="id63" name="id63"><tt class="docutils literal"><span class="pre">ImportManager</span></tt></a></li>
+<li><a class="reference" href="#importdirector" id="id64" name="id64"><tt class="docutils literal"><span class="pre">ImportDirector</span></tt></a></li>
+<li><a class="reference" href="#pathimportdirector" id="id65" name="id65"><tt class="docutils literal"><span class="pre">PathImportDirector</span></tt></a></li>
+<li><a class="reference" href="#owner" id="id66" name="id66"><tt class="docutils literal"><span class="pre">Owner</span></tt></a></li>
+<li><a class="reference" href="#packages" id="id67" name="id67">Packages</a></li>
+<li><a class="reference" href="#possibilities" id="id68" name="id68">Possibilities</a></li>
+<li><a class="reference" href="#compatibility" id="id69" name="id69">Compatibility</a></li>
+<li><a class="reference" href="#performance" id="id70" name="id70">Performance</a></li>
+<li><a class="reference" href="#limitations" id="id71" name="id71">Limitations</a></li>
+<li><a class="reference" href="#id1" id="id72" name="id72">Usage</a></li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+<div class="section">
+<h1><a class="toc-backref" href="#id2" id="getting-started" name="getting-started">Getting Started</a></h1>
+<div class="section">
+<h2><a class="toc-backref" href="#id3" id="installing-pyinstaller" name="installing-pyinstaller">Installing PyInstaller</a></h2>
+<p>First, unpack the archive on you path of choice. Installer is <strong>not</strong> a Python
+package, so it doesn't need to go in site-packages, or have a .pth file. For
+the purpose of this documentation we will assume /your/path/to/pyinstaller/. You will be
+using a couple of scripts in the /your/path/to/pyinstaller/ directory, and these will find
+everything they need from their own location. For convenience, keep the paths
+to these scripts short (don't install in a deeply nested subdirectory).</p>
+<p>PyInstaller is dependant to the version of python you configure it for. In
+other words, you will need a separate copy of PyInstaller for each Python
+version you wish to work with <em>or</em> you'll need to rerun <tt class="docutils literal"><span class="pre">Configure.py</span></tt> every
+time you switch the Python version).</p>
+<p><a class="reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h2><a class="toc-backref" href="#id4" id="building-the-runtime-executables" name="building-the-runtime-executables">Building the runtime executables</a></h2>
+<p><em>Note:</em> Windows users can skip this step, because all of Python is contained in
+pythonXX.dll, and PyInstaller will use your pythonXX.dll.</p>
+<p>On Linux the first thing to do is build the runtime executables.</p>
+<p>Change to the /your/path/to/pyinstaller/ <tt class="docutils literal"><span class="pre">source/linux</span></tt> subdirectory. Run <tt class="docutils literal"><span class="pre">Make.py</span>
+<span class="pre">[-n|-e]</span></tt> and then make. This will produce <tt class="docutils literal"><span class="pre">support/loader/run</span></tt> and
+<tt class="docutils literal"><span class="pre">support/loader/run_d</span></tt>, which are the bootloaders.</p>
+<div class="sidebar">
+<p class="first sidebar-title">Bootloader</p>
+<p class="last">The bootloader (also known as <em>stub</em> in literature) is the small program
+which starts up your packaged program. Usually, the archive containing the
+bytecoded modules of your program is simply attended to it. See
+<a class="reference" href="#self-extracting-executables">Self-extracting executables</a> for more details on the process.</p>
+</div>
+<p><em>Note:</em> If you have multiple versions of Python, the Python you use to run
+<tt class="docutils literal"><span class="pre">Make.py</span></tt> is the one whose configuration is used.</p>
+<p>The <tt class="docutils literal"><span class="pre">-n</span></tt> and <tt class="docutils literal"><span class="pre">-e</span></tt> options set a non-elf or elf flag in your <tt class="docutils literal"><span class="pre">config.dat</span></tt>.
+As of v1.0, the executable will try both strategies, and this flag
+just sets how you want your executables built. In the elf strategy, the archive
+is concatenated to the executable. In the non-elf strategy, the executable
+expects an archive with the same name as itself in the executable's directory.
+Note that the executable chases down symbolic links before determining it's name
+and directory, so putting the archive in the same directory as the symbolic link
+will not work.</p>
+<p>Windows distributions come with several executables in the <tt class="docutils literal"><span class="pre">support/loader</span></tt>
+directory: <tt class="docutils literal"><span class="pre">run_*.exe</span></tt> (bootloader for regular programs), and
+<tt class="docutils literal"><span class="pre">inprocsrvr_*.dll</span></tt> (bootloader for in-process COM servers). To rebuild this,
+you need to install <a class="reference" href="http://www.scons.org">Scons</a>, and then just run <tt class="docutils literal"><span class="pre">scons</span></tt> from the /your/path/to/pyinstaller/
+directory.</p>
+<p><a class="reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h2><a class="toc-backref" href="#id5" id="configuring-your-pyinstaller-setup" name="configuring-your-pyinstaller-setup">Configuring your PyInstaller setup</a></h2>
+<p>In the /your/path/to/pyinstaller/ directory, run <tt class="docutils literal"><span class="pre">Configure.py</span></tt>. This saves some
+information into <tt class="docutils literal"><span class="pre">config.dat</span></tt> that would otherwise be recomputed every time.
+It can be rerun at any time if your configuration changes. It must be run before
+trying to build anything.</p>
+<p><a class="reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h2><a class="toc-backref" href="#id6" id="create-a-spec-file-for-your-project" name="create-a-spec-file-for-your-project">Create a spec file for your project</a></h2>
+<p>[For Windows COM server support, see section <a class="reference" href="#windows-com-server-support">Windows COM Server Support</a>]</p>
+<p>The root directory has a script Makespec.py for this purpose:</p>
+<pre class="literal-block">
+python Makespec.py [opts] &lt;scriptname&gt; [&lt;scriptname&gt; ...]
+</pre>
+<p>Where allowed OPTIONS are:</p>
+<table class="docutils option-list" frame="void" rules="none">
+<col class="option" />
+<col class="description" />
+<tbody valign="top">
+<tr><td class="option-group">
+<kbd><span class="option">-F</span>, <span class="option">--onefile</span></kbd></td>
+<td>produce a single file deployment (see below).</td></tr>
+<tr><td class="option-group">
+<kbd><span class="option">-D</span>, <span class="option">--onedir</span></kbd></td>
+<td>produce a single directory deployment (default).</td></tr>
+<tr><td class="option-group">
+<kbd><span class="option">-K</span>, <span class="option">--tk</span></kbd></td>
+<td>include TCL/TK in the deployment.</td></tr>
+<tr><td class="option-group">
+<kbd><span class="option">-a</span>, <span class="option">--ascii</span></kbd></td>
+<td>do not include encodings. The default (on Python versions with unicode
+support) is now to include all encodings.</td></tr>
+<tr><td class="option-group">
+<kbd><span class="option">-d</span>, <span class="option">--debug</span></kbd></td>
+<td>use debug (verbose) versions of the executables.</td></tr>
+<tr><td class="option-group" colspan="2">
+<kbd><span class="option">-w</span>, <span class="option">--windowed</span>, <span class="option">--noconsole</span></kbd></td>
+</tr>
+<tr><td>&nbsp;</td><td>Use the Windows subsystem executable, which does not open
+the console when the program is launched. <strong>(Windows only)</strong></td></tr>
+<tr><td class="option-group" colspan="2">
+<kbd><span class="option">-c</span>, <span class="option">--nowindowed</span>, <span class="option">--console</span></kbd></td>
+</tr>
+<tr><td>&nbsp;</td><td>Use the console subsystem executable. This is the default. <strong>(Windows only)</strong></td></tr>
+<tr><td class="option-group">
+<kbd><span class="option">-s</span>, <span class="option">--strip</span></kbd></td>
+<td>the executable and all shared libraries will be run through strip. Note
+that cygwin's strip tends to render normal Win32 dlls unusable.</td></tr>
+<tr><td class="option-group">
+<kbd><span class="option">-X</span>, <span class="option">--upx</span></kbd></td>
+<td>if you have UPX installed (detected by Configure), this will use it to
+compress your executable (and, on Windows, your dlls). See note below.</td></tr>
+<tr><td class="option-group" colspan="2">
+<kbd><span class="option">-o <var>DIR</var></span>, <span class="option">--out=<var>DIR</var></span></kbd></td>
+</tr>
+<tr><td>&nbsp;</td><td>create the spec file in <em>directory</em>. If not specified, and the current
+directory is Installer's root directory, an output subdirectory will be
+created. Otherwise the current directory is used.</td></tr>
+<tr><td class="option-group" colspan="2">
+<kbd><span class="option">-p <var>DIR</var></span>, <span class="option">--paths=<var>DIR</var></span></kbd></td>
+</tr>
+<tr><td>&nbsp;</td><td>set base path for import (like using PYTHONPATH). Multiple directories are
+allowed, separating them with the path separator (';' under Windows, ':'
+under Linux), or using this option multiple times.</td></tr>
+<tr><td class="option-group" colspan="2">
+<kbd><span class="option">--icon=<var>&lt;FILE.ICO&gt;</var></span></kbd></td>
+</tr>
+<tr><td>&nbsp;</td><td>add <em>file.ico</em> to the executable's resources. <strong>(Windows only)</strong></td></tr>
+<tr><td class="option-group" colspan="2">
+<kbd><span class="option">--icon=<var>&lt;FILE.EXE,N&gt;</var></span></kbd></td>
+</tr>
+<tr><td>&nbsp;</td><td>add the <em>n</em>-th incon in <em>file.exe</em> to the executable's resources. <strong>(Windows
+only)</strong></td></tr>
+<tr><td class="option-group" colspan="2">
+<kbd><span class="option">-v <var>FILE</var></span>, <span class="option">--version=<var>FILE</var></span></kbd></td>
+</tr>
+<tr><td>&nbsp;</td><td>add verfile as a version resource to the executable. <strong>(Windows only)</strong></td></tr>
+<tr><td class="option-group" colspan="2">
+<kbd><span class="option">-n <var>NAME</var></span>, <span class="option">--name=<var>NAME</var></span></kbd></td>
+</tr>
+<tr><td>&nbsp;</td><td>optional <em>name</em> to assign to the project (from which the spec file name is
+generated). If omitted, the basename of the (first) script is used.</td></tr>
+</tbody>
+</table>
+<p>[For building with optimization on (like <tt class="docutils literal"><span class="pre">Python</span> <span class="pre">-O</span></tt>), see section
+<a class="reference" href="#building-optimized">Building Optimized</a>]</p>
+<p>For simple projects, the generated spec file will probably be sufficient. For
+more complex projects, it should be regarded as a template. The spec file is
+actually Python code, and modifying it should be ease. See <a class="reference" href="#spec-files">Spec Files</a> for
+details.</p>
+<p><a class="reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h2><a class="toc-backref" href="#id7" id="build-your-project" name="build-your-project">Build your project</a></h2>
+<pre class="literal-block">
+python Build.py specfile
+</pre>
+<p>A <tt class="docutils literal"><span class="pre">buildproject</span></tt> subdirectory will be created in the specfile's directory. This
+is a private workspace so that <tt class="docutils literal"><span class="pre">Build.py</span></tt> can act like a makefile. Any named
+targets will appear in the specfile's directory. For <tt class="docutils literal"><span class="pre">--onedir</span></tt>
+configurations, it will create also <tt class="docutils literal"><span class="pre">distproject</span></tt>, which is the directory you're
+interested in. For a <tt class="docutils literal"><span class="pre">--onefile</span></tt>, the executable will be in the specfile's
+directory.</p>
+<p>In most cases, this will be all you have to do. If not, see <a class="reference" href="#when-things-go-wrong">When things go
+wrong</a> and be sure to read the introduction to <a class="reference" href="#spec-files">Spec Files</a>.</p>
+<p><a class="reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h2><a class="toc-backref" href="#id8" id="windows-com-server-support" name="windows-com-server-support">Windows COM Server support</a></h2>
+<p>For Windows COM support execute:</p>
+<pre class="literal-block">
+python MakeCOMServer.py [OPTION] script...
+</pre>
+<p>This will generate a new script <tt class="docutils literal"><span class="pre">drivescript.py</span></tt> and a spec file for the script.</p>
+<p>These options are allowed:</p>
+<table class="docutils option-list" frame="void" rules="none">
+<col class="option" />
+<col class="description" />
+<tbody valign="top">
+<tr><td class="option-group">
+<kbd><span class="option">--debug</span></kbd></td>
+<td>Use the verbose version of the executable.</td></tr>
+<tr><td class="option-group">
+<kbd><span class="option">--verbose</span></kbd></td>
+<td>Register the COM server(s) with the quiet flag off.</td></tr>
+<tr><td class="option-group">
+<kbd><span class="option">--ascii</span></kbd></td>
+<td>do not include encodings (this is passed through to Makespec).</td></tr>
+<tr><td class="option-group">
+<kbd><span class="option">--out <var>&lt;dir&gt;</var></span></kbd></td>
+<td>Generate the driver script and spec file in dir.</td></tr>
+</tbody>
+</table>
+<p>Now <a class="reference" href="#build-your-project">Build your project</a> on the generated spec file.</p>
+<p>If you have the win32dbg package installed, you can use it with the generated
+COM server. In the driver script, set <tt class="docutils literal"><span class="pre">debug=1</span></tt> in the registration line.</p>
+<p><strong>Warnings</strong>: the inprocess COM server support will not work when the client
+process already has Python loaded. It would be rather tricky to
+non-obtrusively hook into an already running Python, but the show-stopper is
+that the Python/C API won't let us find out which interpreter instance I should
+hook into. (If this is important to you, you might experiment with using
+apartment threading, which seems the best possibility to get this to work). To
+use a &quot;frozen&quot; COM server from a Python process, you'll have to load it as an
+exe:</p>
+<pre class="literal-block">
+o = win32com.client.Dispatch(progid,
+                 clsctx=pythoncom.CLSCTX_LOCAL_SERVER)
+</pre>
+<p>MakeCOMServer also assumes that your top level code (registration etc.) is
+&quot;normal&quot;. If it's not, you will have to edit the generated script.</p>
+<p><a class="reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h2><a class="toc-backref" href="#id9" id="building-optimized" name="building-optimized">Building Optimized</a></h2>
+<p>There are two facets to running optimized: gathering <tt class="docutils literal"><span class="pre">.pyo</span></tt>'s, and setting the
+<tt class="docutils literal"><span class="pre">Py_OptimizeFlag</span></tt>. Installer will gather <tt class="docutils literal"><span class="pre">.pyo</span></tt>'s if it is run optimized:</p>
+<pre class="literal-block">
+python -O Build.py ...
+</pre>
+<p>The <tt class="docutils literal"><span class="pre">Py_OptimizeFlag</span></tt> will be set if you use a <tt class="docutils literal"><span class="pre">('O','','OPTION')</span></tt> in one of
+the <tt class="docutils literal"><span class="pre">TOCs</span></tt> building the <tt class="docutils literal"><span class="pre">EXE</span></tt>:</p>
+<pre class="literal-block">
+exe = EXE(pyz,
+          a.scripts + [('O','','OPTION')],
+          ...
+</pre>
+<p>See <a class="reference" href="#spec-files">Spec Files</a> for details.</p>
+<p><a class="reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h2><a class="toc-backref" href="#id10" id="a-note-on-using-upx" name="a-note-on-using-upx">A Note on using UPX</a></h2>
+<p>On both Windows and Linux, UPX can give truly startling compression - the days
+of fitting something useful on a diskette are not gone forever! Installer has
+been tested with many UPX versions without problems. Just get it and install it
+on your PATH, then rerun configure.</p>
+<p>For Windows, there is a problem of compatibility between UPX and executables
+generated by Microsoft Visual Studio .NET 2003 (or the equivalent free
+toolkit available for download). This is especially worrisome for users of
+Python 2.4+, where most extensions (and Python itself) are compiled with that
+compiler. This issue has been fixed in later beta versions of UPX, so you
+will need at least UPX 1.92 beta. <a class="reference" href="#configuring-your-pyinstaller-setup">Configure.py</a> will check this for you
+and complain if you have an older version of UPX and you are using Python 2.4.</p>
+<div class="sidebar">
+<p class="first sidebar-title">UPX and Unix</p>
+<p class="last">Under UNIX, old versions of UPX were not able to expand and execute the
+executable in memory, and they were extracting it into a temporary file
+in the filesystem, before spawning it. This is no longer valid under Linux,
+but the information in this paragraph still needs to be updated.</p>
+</div>
+<p>For Linux, a bit more discussion is in order. First, UPX is only useful on
+executables, not shared libs. Installer accounts for that, but to get the full
+benefit, you might rebuild Python with more things statically linked.</p>
+<p>More importantly, when <tt class="docutils literal"><span class="pre">run</span></tt> finds that its <tt class="docutils literal"><span class="pre">sys.argv[0]</span></tt> does not contain a path,
+it will use <tt class="docutils literal"><span class="pre">/proc/pid/exe</span></tt> to find itself (if it can). This happens, for
+example, when executed by Apache. If it has been upx-ed, this symbolic link
+points to the tempfile created by the upx stub and PyInstaller will fail (please
+see the UPX docs for more information). So for now, at least, you can't use upx
+for CGI's executed by Apache. Otherwise, you can ignore the warnings in the UPX
+docs, since what PyInstaller opens is the executable Installer created, not the
+temporary upx-created executable.</p>
+<p><a class="reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h2><a class="toc-backref" href="#id11" id="a-note-on-onefile" name="a-note-on-onefile">A Note on <tt class="docutils literal docutils literal"><span class="pre">--onefile</span></tt></a></h2>
+<p>A <tt class="docutils literal"><span class="pre">--onefile</span></tt> works by packing all the shared libs / dlls into the archive
+attached to the bootloader executable (or next to the executable in a non-elf
+configuration). When first started, it finds that it needs to extract these
+files before it can run &quot;for real&quot;. That's because locating and loading a
+shared lib or linked-in dll is a system level action, not user-level. With
+PyInstaller v1.0 it always uses a temporary directory (<tt class="docutils literal"><span class="pre">_MEIpid</span></tt>) in the
+user's temp directory. It then executes itself again, setting things up so
+the system will be able to load the shared libs / dlls. When executing is
+complete, it recursively removes the entire directory it created.</p>
+<p>This has a number of implications:</p>
+<ul class="simple">
+<li>You can run multiple copies - they won't collide.</li>
+<li>Running multiple copies will be rather expensive to the system (nothing is
+shared).</li>
+<li>If you're using the cheat of adding user data as <tt class="docutils literal"><span class="pre">'BINARY'</span></tt>, it will be in
+<tt class="docutils literal"><span class="pre">os.environ['_MEIPASS2']</span></tt>, not in the executable's directory.</li>
+<li>On Windows, using Task Manager to kill the parent process will leave the
+directory behind.</li>
+<li>On *nix, a kill -9 (or crash) will leave the directory behind.</li>
+<li>Otherwise, on both platforms, the directory will be recursively deleted.</li>
+<li>So any files you might create in <tt class="docutils literal"><span class="pre">os.environ['_MEIPASS2']</span></tt> will be deleted.</li>
+<li>The executable can be in a protected or read-only directory.</li>
+<li>If for some reason, the <tt class="docutils literal"><span class="pre">_MEIpid</span></tt> directory already exists, the executable
+will fail. It is created mode 0700, so only the one user can modify it
+(on *nix, of course).</li>
+</ul>
+<p>While we are not a security expert, we believe the scheme is good enough for
+most of the users.</p>
+<p><strong>Notes for *nix users</strong>: Take notice that if the executable does a setuid root,
+a determined hacker could possibly (given enough tries) introduce a malicious
+lookalike of one of the shared libraries during the hole between when the
+library is extracted and when it gets loaded by the execvp'd process. So maybe
+you shouldn't do setuid root programs using <tt class="docutils literal"><span class="pre">--onefile</span></tt>. <strong>In fact, we do not
+recomend the use of --onefile on setuid programs.</strong></p>
+<p><a class="reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h2><a class="toc-backref" href="#id12" id="a-note-on-egg-files-and-setuptools" name="a-note-on-egg-files-and-setuptools">A Note on .egg files and setuptools</a></h2>
+<p><a class="reference" href="http://peak.telecommunity.com/DevCenter/setuptools">setuptools</a> is a distutils extensions which provide many benefits, including
+the ability to distribute the extension as <tt class="docutils literal"><span class="pre">egg</span></tt> files. Together with the
+nifty <a class="reference" href="http://peak.telecommunity.com/DevCenter/EasyInstall">easy_install</a> (a tool which automatically locates, downloads and
+installs Python extensions), <tt class="docutils literal"><span class="pre">egg</span></tt> files are becoming more and more
+widespread as a way for distributing Python extensions.</p>
+<p><tt class="docutils literal"><span class="pre">egg</span></tt> files are actually ZIP files under the hood, and they rely on the fact
+that Python 2.4 is able to transparently import modules stored within ZIP
+files. PyInstaller is currently <em>not</em> able to import and extract modules
+within ZIP files, so code which uses extensions packaged as <tt class="docutils literal"><span class="pre">egg</span></tt> files
+cannot be packaged with PyInstaller.</p>
+<p>The workaround is pretty easy: you can use <tt class="docutils literal"><span class="pre">easy_install</span> <span class="pre">-Z</span></tt> at installation
+time to ask <tt class="docutils literal"><span class="pre">easy_install</span></tt> to always decompress egg files. This will allow
+PyInstaller to see the files and make the package correctly. If you have already
+installed the modules, you can simply decompress them within a directory with
+the same name of the <tt class="docutils literal"><span class="pre">egg</span></tt> file (including also the extension).</p>
+<p>Support for <tt class="docutils literal"><span class="pre">egg</span></tt> files is planned for a future release of PyInstaller.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+</div>
+<div class="section">
+<h1><a class="toc-backref" href="#id13" id="pyinstaller-utilities" name="pyinstaller-utilities">PyInstaller Utilities</a></h1>
+<div class="section">
+<h2><a class="toc-backref" href="#id14" id="archiveviewer" name="archiveviewer">ArchiveViewer</a></h2>
+<pre class="literal-block">
+python ArchiveViewer.py &lt;archivefile&gt;
+</pre>
+<p>ArchiveViewer lets you examine the contents of any archive build with
+PyInstaller or executable (PYZ, PKG or exe). Invoke it with the target as the
+first arg (It has been set up as a Send-To so it shows on the context menu in
+Explorer). The archive can be navigated using these commands:</p>
+<dl class="docutils">
+<dt>O &lt;nm&gt;</dt>
+<dd>Open the embedded archive &lt;nm&gt; (will prompt if omitted).</dd>
+<dt>U</dt>
+<dd>Go up one level (go back to viewing the embedding archive).</dd>
+<dt>X &lt;nm&gt;</dt>
+<dd>Extract nm (will prompt if omitted). Prompts for output filename. If none
+given, extracted to stdout.</dd>
+<dt>Q</dt>
+<dd>Quit.</dd>
+</dl>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h2><a class="toc-backref" href="#id15" id="bindepend" name="bindepend">bindepend</a></h2>
+<pre class="literal-block">
+python bindepend.py &lt;executable_or_dynamic_library&gt;
+</pre>
+<p>bindepend will analyze the executable you pass to it, and write to stdout all
+its binary dependencies. This is handy to find out which DLLs are required by
+an executable or another DLL. This module is used by PyInstaller itself to
+follow the chain of dependencies of binary extensions and make sure that all
+of them get included in the final package.</p>
+</div>
+<div class="section">
+<h2><a class="toc-backref" href="#id16" id="grabversion-windows" name="grabversion-windows">GrabVersion (Windows)</a></h2>
+<pre class="literal-block">
+python GrabVersion.py &lt;executable_with_version_resource&gt;
+</pre>
+<p>GrabVersion outputs text which can be eval'ed by <tt class="docutils literal"><span class="pre">versionInfo.py</span></tt> to reproduce
+a version resource. Invoke it with the full path name of a Windows executable
+(with a version resource) as the first argument. If you cut &amp; paste (or
+redirect to a file), you can then edit the version information. The edited
+text file can be used in a <tt class="docutils literal"><span class="pre">version</span> <span class="pre">=</span> <span class="pre">myversion.txt</span></tt> option on any executable
+in an PyInstaller spec file.</p>
+<p>This was done in this way because version resources are rather strange beasts,
+and fully understanding them is probably impossible. Some elements are
+optional, others required, but you could spend unbounded amounts of time
+figuring this out, because it's not well documented. When you view the version
+tab on a properties dialog, there's no straightforward relationship between
+how the data is displayed and the structure of the resource itself. So the
+easiest thing to do is find an executable that displays the kind of
+information you want, grab it's resource and edit it. Certainly easier than
+the Version resource wizard in VC++.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h2><a class="toc-backref" href="#id17" id="analyzing-dependencies" name="analyzing-dependencies">Analyzing Dependencies</a></h2>
+<p>You can interactively track down dependencies, including getting
+cross-references by using <tt class="docutils literal"><span class="pre">mf.py</span></tt>, documented in section <a class="reference" href="#mf-py-a-modulefinder-replacement">mf.py: A modulefinder
+Replacement</a></p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+</div>
+<div class="section">
+<h1><a class="toc-backref" href="#id18" id="spec-files" name="spec-files">Spec Files</a></h1>
+<div class="section">
+<h2><a class="toc-backref" href="#id19" id="introduction" name="introduction">Introduction</a></h2>
+<p>Spec files are in Python syntax. They are evaluated by Build.py. A simplistic
+spec file might look like this:</p>
+<pre class="literal-block">
+a = Analysis(['myscript.py'])
+pyz = PYZ(a.pure)
+exe = EXE(pyz, a.scripts, a.binaries, name=&quot;myapp.exe&quot;)
+</pre>
+<p>This creates a single file deployment with all binaries (extension modules and
+their dependencies) packed into the executable.</p>
+<p>A simplistic single directory deployment might look like this:</p>
+<pre class="literal-block">
+a = Analysis(['myscript.py'])
+pyz = PYZ(a.pure)
+exe = EXE(a.scripts, pyz, name=&quot;myapp.exe&quot;, exclude_binaries=1)
+dist = COLLECT(exe, a.binaries, name=&quot;dist&quot;)
+</pre>
+<p>Note that neither of these examples are realistic. Use <tt class="docutils literal"><span class="pre">Makespec.py</span></tt> (documented
+in section <a class="reference" href="#create-a-spec-file-for-your-project">Create a spec file for your project</a>) to create your specfile,
+and tweak it (if necessary) from there.</p>
+<p>All of the classes you see above are subclasses of <tt class="docutils literal"><span class="pre">Build.Target</span></tt>. A Target acts
+like a rule in a makefile. It knows enough to cache its last inputs and
+outputs. If its inputs haven't changed, it can assume its outputs wouldn't
+change on recomputation. So a spec file acts much like a makefile, only
+rebuilding as much as needs rebuilding. This means, for example, that if you
+change an <tt class="docutils literal"><span class="pre">EXE</span></tt> from <tt class="docutils literal"><span class="pre">debug=1</span></tt> to <tt class="docutils literal"><span class="pre">debug=0</span></tt>, the rebuild will be nearly
+instantaneous.</p>
+<p>The high level view is that an <tt class="docutils literal"><span class="pre">Analysis</span></tt> takes a list of scripts as input,
+and generates three &quot;outputs&quot;, held in attributes named <tt class="docutils literal"><span class="pre">scripts</span></tt>, <tt class="docutils literal"><span class="pre">pure</span></tt>
+and <tt class="docutils literal"><span class="pre">binaries</span></tt>. A <tt class="docutils literal"><span class="pre">PYZ</span></tt> (a <tt class="docutils literal"><span class="pre">.pyz</span></tt> archive) is built from the modules in
+pure. The <tt class="docutils literal"><span class="pre">EXE</span></tt> is built from the <tt class="docutils literal"><span class="pre">PYZ</span></tt>, the scripts and, in the case of a
+single-file deployment, the binaries. In a single-directory deployment, a
+directory is built containing a slim executable and the binaries.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h2><a class="toc-backref" href="#id20" id="toc-class-table-of-contents" name="toc-class-table-of-contents">TOC Class (Table of Contents)</a></h2>
+<p>Before you can do much with a spec file, you need to understand the
+<tt class="docutils literal"><span class="pre">TOC</span></tt> (Table Of Contents) class.</p>
+<p>A <tt class="docutils literal"><span class="pre">TOC</span></tt> appears to be a list of tuples of the form (name, path, typecode).
+In fact, it's an ordered set, not a list. A TOC contains no duplicates, where
+uniqueness is based on name only. Furthermore, within this constraint, a TOC
+preserves order.</p>
+<p>Besides the normal list methods and operations, TOC supports taking differences
+and intersections (and note that adding or extending is really equivalent to
+union). Furthermore, the operations can take a real list of tuples on the right
+hand side. This makes excluding modules quite easy. For a pure Python module:</p>
+<pre class="literal-block">
+pyz = PYZ(a.pure - [('badmodule', '', '')])
+</pre>
+<p>or for an extension module in a single-directory deployment:</p>
+<pre class="literal-block">
+dist = COLLECT(..., a.binaries - [('badmodule', '', '')], ...)
+</pre>
+<p>or for a single-file deployment:</p>
+<pre class="literal-block">
+exe = EXE(..., a.binaries - [('badmodule', '', '')], ...)
+</pre>
+<p>To add files to a TOC, you need to know about the typecodes (or the step using
+the TOC won't know what to do with the entry).</p>
+<table border="1" class="docutils">
+<colgroup>
+<col width="12%" />
+<col width="44%" />
+<col width="19%" />
+<col width="25%" />
+</colgroup>
+<thead valign="bottom">
+<tr><th class="head"><strong>typecode</strong></th>
+<th class="head"><strong>description</strong></th>
+<th class="head"><strong>name</strong></th>
+<th class="head"><strong>path</strong></th>
+</tr>
+</thead>
+<tbody valign="top">
+<tr><td>'EXTENSION'</td>
+<td>An extension module.</td>
+<td>Python internal name.</td>
+<td>Full path name in build.</td>
+</tr>
+<tr><td>'PYSOURCE'</td>
+<td>A script.</td>
+<td>Python internal name.</td>
+<td>Full path name in build.</td>
+</tr>
+<tr><td>'PYMODULE'</td>
+<td>A pure Python module (including __init__ modules).</td>
+<td>Python internal name.</td>
+<td>Full path name in build.</td>
+</tr>
+<tr><td>'PYZ'</td>
+<td>A .pyz archive (archive_rt.ZlibArchive).</td>
+<td>Runtime name.</td>
+<td>Full path name in build.</td>
+</tr>
+<tr><td>'PKG'</td>
+<td>A pkg archive (carchive4.CArchive).</td>
+<td>Runtime name.</td>
+<td>Full path name in build.</td>
+</tr>
+<tr><td>'BINARY'</td>
+<td>A shared library.</td>
+<td>Runtime name.</td>
+<td>Full path name in build.</td>
+</tr>
+<tr><td>'DATA'</td>
+<td>Aribitrary files.</td>
+<td>Runtime name.</td>
+<td>Full path name in build.</td>
+</tr>
+<tr><td>'OPTION'</td>
+<td>A runtime runtime option (frozen into the executable).</td>
+<td>The option.</td>
+<td>Unused.</td>
+</tr>
+</tbody>
+</table>
+<p>You can force the include of any file in much the same way you do excludes:</p>
+<pre class="literal-block">
+collect = COLLECT(a.binaries +
+          [('readme', '/my/project/readme', 'DATA')], ...)
+</pre>
+<p>or even:</p>
+<pre class="literal-block">
+collect = COLLECT(a.binaries,
+          [('readme', '/my/project/readme', 'DATA')], ...)
+</pre>
+<p>(that is, you can use a list of tuples in place of a <tt class="docutils literal"><span class="pre">TOC</span></tt> in most cases).</p>
+<p>There's not much reason to use this technique for <tt class="docutils literal"><span class="pre">PYSOURCE</span></tt>, since an <tt class="docutils literal"><span class="pre">Analysis</span></tt>
+takes a list of scripts as input. For <tt class="docutils literal"><span class="pre">PYMODULEs</span></tt> and <tt class="docutils literal"><span class="pre">EXTENSIONs</span></tt>, the hook
+mechanism discussed here is better because you won't have to remember how you
+got it working next time.</p>
+<p>This technique is most useful for data files (see the <tt class="docutils literal"><span class="pre">Tree</span></tt> class below for a
+way to build a <tt class="docutils literal"><span class="pre">TOC</span></tt> from a directory tree), and for runtime options. The options
+the run executables understand are:</p>
+<table border="1" class="docutils">
+<colgroup>
+<col width="9%" />
+<col width="13%" />
+<col width="18%" />
+<col width="60%" />
+</colgroup>
+<thead valign="bottom">
+<tr><th class="head"><strong>Option</strong></th>
+<th class="head"><strong>Description</strong></th>
+<th class="head"><strong>Example</strong></th>
+<th class="head"><strong>Notes</strong></th>
+</tr>
+</thead>
+<tbody valign="top">
+<tr><td>v</td>
+<td>Verbose imports</td>
+<td>('v', '', 'OPTION')</td>
+<td>Same as Python -v ...</td>
+</tr>
+<tr><td>u</td>
+<td>Unbuffered stdio</td>
+<td>('u', '', 'OPTION')</td>
+<td>Same as Python -u ...</td>
+</tr>
+<tr><td>W spec</td>
+<td>Warning option</td>
+<td>('W ignore', '', 'OPTION')</td>
+<td>Python 2.1+ only.</td>
+</tr>
+<tr><td>s</td>
+<td>Use site.py</td>
+<td>('s', '', 'OPTION')</td>
+<td>The opposite of Python's -S flag. Note that site.py must be in the executable's directory to be used.</td>
+</tr>
+<tr><td>f</td>
+<td>Force execvp</td>
+<td>('f', '', 'OPTION')</td>
+<td>Linux/unix only. Ensures that LD_LIBRARY_PATH is set properly.</td>
+</tr>
+</tbody>
+</table>
+<p>Advanced users should note that by using set differences and intersections, it
+becomes possible to factor out common modules, and deploy a project containing
+multiple executables with minimal redundancy. You'll need some top level code
+in each executable to mount the common <tt class="docutils literal"><span class="pre">PYZ</span></tt>.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h2><a class="toc-backref" href="#id21" id="target-subclasses" name="target-subclasses">Target Subclasses</a></h2>
+<div class="section">
+<h3><a class="toc-backref" href="#id22" id="analysis" name="analysis">Analysis</a></h3>
+<pre class="literal-block">
+Analysis(scripts, pathex=None, hookspath=None, excludes=None)
+</pre>
+<dl class="docutils">
+<dt><tt class="docutils literal"><span class="pre">scripts</span></tt></dt>
+<dd>a list of scripts specified as file names.</dd>
+<dt><tt class="docutils literal"><span class="pre">pathex</span></tt></dt>
+<dd>an optional list of paths to be searched before sys.path.</dd>
+<dt><tt class="docutils literal"><span class="pre">hookspath</span></tt></dt>
+<dd>an optional list of paths used to extend the hooks package.</dd>
+<dt><tt class="docutils literal"><span class="pre">excludes</span></tt></dt>
+<dd>an optional list of module or package names (their Python names, not path
+names) that will be ignored (as though they were not found).</dd>
+</dl>
+<p>An Analysis has three outputs, all <tt class="docutils literal"><span class="pre">TOCs</span></tt> accessed as attributes of the <tt class="docutils literal"><span class="pre">Analysis</span></tt>.</p>
+<dl class="docutils">
+<dt><tt class="docutils literal"><span class="pre">scripts</span></tt></dt>
+<dd>The scripts you gave Analysis as input, with any runtime hook scripts
+prepended.</dd>
+<dt><tt class="docutils literal"><span class="pre">pure</span></tt></dt>
+<dd>The pure Python modules.</dd>
+<dt><tt class="docutils literal"><span class="pre">binaries</span></tt></dt>
+<dd>The extension modules and their dependencies. The secondary dependencies are
+filtered. On Windows, a long list of MS dlls are excluded. On Linux/Unix,
+any shared lib in <tt class="docutils literal"><span class="pre">/lib</span></tt> or <tt class="docutils literal"><span class="pre">/usr/lib</span></tt> is excluded.</dd>
+</dl>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id23" id="pyz" name="pyz">PYZ</a></h3>
+<pre class="literal-block">
+PYZ(toc, name=None, level=9)
+</pre>
+<dl class="docutils">
+<dt><tt class="docutils literal"><span class="pre">toc</span></tt></dt>
+<dd>a <tt class="docutils literal"><span class="pre">TOC</span></tt>, normally an <tt class="docutils literal"><span class="pre">Analysis.pure</span></tt>.</dd>
+<dt><tt class="docutils literal"><span class="pre">name</span></tt></dt>
+<dd>A filename for the <tt class="docutils literal"><span class="pre">.pyz</span></tt>. Normally not needed, as the generated name will do fine.</dd>
+<dt><tt class="docutils literal"><span class="pre">level</span></tt></dt>
+<dd>The Zlib compression level to use. If 0, the zlib module is not required.</dd>
+</dl>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id24" id="pkg" name="pkg">PKG</a></h3>
+<p>Generally, you will not need to create your own <tt class="docutils literal"><span class="pre">PKGs</span></tt>, as the <tt class="docutils literal"><span class="pre">EXE</span></tt> will do it for
+you. This is one way to include read-only data in a single-file deployment,
+however. A single-file deployment including TK support will use this technique.</p>
+<pre class="literal-block">
+PKG(toc, name=None, cdict=None, exclude_binaries=0)
+</pre>
+<dl class="docutils">
+<dt><tt class="docutils literal"><span class="pre">toc</span></tt></dt>
+<dd>a <tt class="docutils literal"><span class="pre">TOC</span></tt>.</dd>
+<dt><tt class="docutils literal"><span class="pre">name</span></tt></dt>
+<dd>a filename for the <tt class="docutils literal"><span class="pre">PKG</span></tt> (optional).</dd>
+<dt><tt class="docutils literal"><span class="pre">cdict</span></tt></dt>
+<dd>a dictionary that specifies compression by typecode. For example, <tt class="docutils literal"><span class="pre">PYZ</span></tt> is
+left uncompressed so that it can be accessed inside the <tt class="docutils literal"><span class="pre">PKG</span></tt>. The default
+uses sensible values. If zlib is not available, no compression is used.</dd>
+<dt><tt class="docutils literal"><span class="pre">exclude_binaries</span></tt></dt>
+<dd>If 1, <tt class="docutils literal"><span class="pre">EXTENSIONs</span></tt> and <tt class="docutils literal"><span class="pre">BINARYs</span></tt> will be left out of the <tt class="docutils literal"><span class="pre">PKG</span></tt>, and
+forwarded to its container (usually a <tt class="docutils literal"><span class="pre">COLLECT</span></tt>).</dd>
+</dl>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id25" id="exe" name="exe">EXE</a></h3>
+<pre class="literal-block">
+EXE(*args, **kws)
+</pre>
+<dl class="docutils">
+<dt><tt class="docutils literal"><span class="pre">args</span></tt></dt>
+<dd>One or more arguments which are either <tt class="docutils literal"><span class="pre">TOCs</span></tt> or <tt class="docutils literal"><span class="pre">Targets</span></tt>.</dd>
+<dt><tt class="docutils literal"><span class="pre">kws</span></tt></dt>
+<dd><p class="first">Possible keyword arguments:</p>
+<dl class="last docutils">
+<dt><tt class="docutils literal"><span class="pre">console</span></tt></dt>
+<dd>Always 1 on Linux/unix. On Windows, governs whether to use the console
+executable, or the Windows subsystem executable.</dd>
+<dt><tt class="docutils literal"><span class="pre">debug</span></tt></dt>
+<dd>Setting to 1 gives you progress messages from the executable (for a
+<tt class="docutils literal"><span class="pre">console=0</span></tt>, these will be annoying MessageBoxes).</dd>
+<dt><tt class="docutils literal"><span class="pre">name</span></tt></dt>
+<dd>The filename for the executable.</dd>
+<dt><tt class="docutils literal"><span class="pre">exclude_binaries</span></tt></dt>
+<dd>Forwarded to the <tt class="docutils literal"><span class="pre">PKG</span></tt> the <tt class="docutils literal"><span class="pre">EXE</span></tt> builds.</dd>
+<dt><tt class="docutils literal"><span class="pre">icon</span></tt></dt>
+<dd>Windows NT family only. <tt class="docutils literal"><span class="pre">icon='myicon.ico'</span></tt> to use an icon file, or
+<tt class="docutils literal"><span class="pre">icon='notepad.exe,0'</span></tt> to grab an icon resource.</dd>
+<dt><tt class="docutils literal"><span class="pre">version</span></tt></dt>
+<dd>Windows NT family only. <tt class="docutils literal"><span class="pre">version='myversion.txt'</span></tt>. Use <tt class="docutils literal"><span class="pre">GrabVersion.py</span></tt> to
+steal a version resource from an executable, and then edit the ouput to
+create your own. (The syntax of version resources is so arcane that I
+wouldn't attempt to write one from scratch.)</dd>
+</dl>
+</dd>
+</dl>
+<p>There are actually two <tt class="docutils literal"><span class="pre">EXE</span></tt> classes - one for ELF platforms (where the
+bootloader, that is the <tt class="docutils literal"><span class="pre">run</span></tt> executable, and the <tt class="docutils literal"><span class="pre">PKG</span></tt> are concatenated),
+and one for non-ELF platforms (where the run executable is simply renamed, and
+expects a <tt class="docutils literal"><span class="pre">exename.pkg</span></tt> in the same directory). Which class becomes available
+as <tt class="docutils literal"><span class="pre">EXE</span></tt> is determined by a flag in <tt class="docutils literal"><span class="pre">config.dat</span></tt>. This flag is set to
+non-ELF when using <tt class="docutils literal"><span class="pre">Make.py</span> <span class="pre">-n</span></tt>.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id26" id="dll" name="dll">DLL</a></h3>
+<p>On Windows, this provides support for doing in-process COM servers. It is not
+generalized. However, embedders can follow the same model to build a special
+purpose DLL so the Python support in their app is hidden. You will need to
+write your own dll, but thanks to Allan Green for refactoring the C code and
+making that a managable task.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id27" id="collect" name="collect">COLLECT</a></h3>
+<pre class="literal-block">
+COLLECT(*args, **kws)
+</pre>
+<dl class="docutils">
+<dt><tt class="docutils literal"><span class="pre">args</span></tt></dt>
+<dd>One or more arguments which are either <tt class="docutils literal"><span class="pre">TOCs</span></tt> or <tt class="docutils literal"><span class="pre">Targets</span></tt>.</dd>
+<dt><tt class="docutils literal"><span class="pre">kws</span></tt></dt>
+<dd><p class="first">Possible keyword arguments:</p>
+<dl class="last docutils">
+<dt><tt class="docutils literal"><span class="pre">name</span></tt></dt>
+<dd>The name of the directory to be built.</dd>
+</dl>
+</dd>
+</dl>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id28" id="tree" name="tree">Tree</a></h3>
+<pre class="literal-block">
+Tree(root, prefix=None, excludes=None)
+</pre>
+<dl class="docutils">
+<dt><tt class="docutils literal"><span class="pre">root</span></tt></dt>
+<dd>The root of the tree (on the build system).</dd>
+<dt><tt class="docutils literal"><span class="pre">prefix</span></tt></dt>
+<dd>Optional prefix to the names on the target system.</dd>
+<dt><tt class="docutils literal"><span class="pre">excludes</span></tt></dt>
+<dd><p class="first">A list of names to exclude. Two forms are allowed:</p>
+<dl class="last docutils">
+<dt><tt class="docutils literal"><span class="pre">name</span></tt></dt>
+<dd>files with this basename will be excluded (do not include the path).</dd>
+<dt><tt class="docutils literal"><span class="pre">*.ext</span></tt></dt>
+<dd>any file with the given extension will be excluded.</dd>
+</dl>
+</dd>
+</dl>
+<p>Since a <tt class="docutils literal"><span class="pre">Tree</span></tt> is a <tt class="docutils literal"><span class="pre">TOC</span></tt>, you can also use the exclude technique described above
+in the section on <tt class="docutils literal"><span class="pre">TOCs</span></tt>.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+</div>
+</div>
+<div class="section">
+<h1><a class="toc-backref" href="#id29" id="when-things-go-wrong" name="when-things-go-wrong">When Things Go Wrong</a></h1>
+<div class="section">
+<h2><a class="toc-backref" href="#id30" id="finding-out-what-went-wrong" name="finding-out-what-went-wrong">Finding out What Went Wrong</a></h2>
+<div class="section">
+<h3><a class="toc-backref" href="#id31" id="buildtime-warnings" name="buildtime-warnings">Buildtime Warnings</a></h3>
+<p>When an <tt class="docutils literal"><span class="pre">Analysis</span></tt> step runs, it produces a warnings file (named <tt class="docutils literal"><span class="pre">warnproject.txt</span></tt>)
+in the spec file's directory. Generally, most of these warnings are harmless.
+For example, <tt class="docutils literal"><span class="pre">os.py</span></tt> (which is cross-platform) works by figuring out what
+platform it is on, then importing (and rebinding names from) the appropriate
+platform-specific module. So analyzing <tt class="docutils literal"><span class="pre">os.py</span></tt> will produce a set of warnings
+like:</p>
+<pre class="literal-block">
+W: no module named dos (conditional import by os)
+W: no module named ce (conditional import by os)
+W: no module named os2 (conditional import by os)
+</pre>
+<p>Note that the analysis has detected that the import is within a conditional
+block (an if statement). The analysis also detects if an import within a
+function or class, (delayed) or at the top level. A top-level, non-conditional
+import failure is really a hard error. There's at least a reasonable chance
+that conditional and / or delayed import will be handled gracefully at runtime.</p>
+<p>Ignorable warnings may also be produced when a class or function is declared in
+a package (an <tt class="docutils literal"><span class="pre">__init__.py</span></tt> module), and the import specifies
+<tt class="docutils literal"><span class="pre">package.name</span></tt>. In this case, the analysis can't tell if name is supposed to
+refer to a submodule of package.</p>
+<p>Warnings are also produced when an <tt class="docutils literal"><span class="pre">__import__</span></tt>, <tt class="docutils literal"><span class="pre">exec</span></tt> or <tt class="docutils literal"><span class="pre">eval</span></tt> statement is
+encountered. The <tt class="docutils literal"><span class="pre">__import__</span></tt> warnings should almost certainly be investigated.
+Both <tt class="docutils literal"><span class="pre">exec</span></tt> and <tt class="docutils literal"><span class="pre">eval</span></tt> can be used to implement import hacks, but usually their use
+is more benign.</p>
+<p>Any problem detected here can be handled by hooking the analysis of the module.
+See <a class="reference" href="#listing-hidden-imports">Listing Hidden Imports</a> below for how to do it.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id32" id="getting-debug-messages" name="getting-debug-messages">Getting Debug Messages</a></h3>
+<p>Setting <tt class="docutils literal"><span class="pre">debug=1</span></tt> on an <tt class="docutils literal"><span class="pre">EXE</span></tt> will cause the executable to put out progress
+messages (for console apps, these go to stdout; for Windows apps, these show as
+MessageBoxes). This can be useful if you are doing complex packaging, or your
+app doesn't seem to be starting, or just to learn how the runtime works.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id33" id="getting-python-s-verbose-imports" name="getting-python-s-verbose-imports">Getting Python's Verbose Imports</a></h3>
+<p>You can also pass a <tt class="docutils literal"><span class="pre">-v</span></tt> (verbose imports) flag to the embedded Python. This can
+be extremely useful. I usually try it even on apparently working apps, just to
+make sure that I'm always getting my copies of the modules and no import has
+leaked out to the installed Python.</p>
+<p>You set this (like the other runtime options) by feeding a phone <tt class="docutils literal"><span class="pre">TOC</span></tt> entry to
+the <tt class="docutils literal"><span class="pre">EXE</span></tt>. The easiest way to do this is to change the <tt class="docutils literal"><span class="pre">EXE</span></tt> from:</p>
+<pre class="literal-block">
+EXE(..., anal.scripts, ....)
+</pre>
+<p>to:</p>
+<pre class="literal-block">
+EXE(..., anal.scripts + [('v', '', 'OPTION')], ...)
+</pre>
+<p>These messages will always go to <tt class="docutils literal"><span class="pre">stdout</span></tt>, so you won't see them on Windows if
+<tt class="docutils literal"><span class="pre">console=0</span></tt>.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+</div>
+<div class="section">
+<h2><a class="toc-backref" href="#id34" id="helping-installer-find-modules" name="helping-installer-find-modules">Helping Installer Find Modules</a></h2>
+<div class="section">
+<h3><a class="toc-backref" href="#id35" id="extending-the-path" name="extending-the-path">Extending the Path</a></h3>
+<p>When the analysis phase cannot find needed modules, it may be that the code is
+manipulating <tt class="docutils literal"><span class="pre">sys.path</span></tt>. The easiest thing to do in this case is tell <tt class="docutils literal"><span class="pre">Analysis</span></tt>
+about the new directory through the second arg to the constructor:</p>
+<pre class="literal-block">
+anal = Analysis(['somedir/myscript.py'],
+                ['path/to/thisdir', 'path/to/thatdir'])
+</pre>
+<p>In this case, the <tt class="docutils literal"><span class="pre">Analysis</span></tt> will have a search path:</p>
+<pre class="literal-block">
+['somedir', 'path/to/thisdir', 'path/to/thatdir'] + sys.path
+</pre>
+<p>You can do the same when running <tt class="docutils literal"><span class="pre">Makespec.py</span></tt>:</p>
+<pre class="literal-block">
+Makespec.py --paths=path/to/thisdir;path/to/thatdir ...
+</pre>
+<p>(on *nix, use <tt class="docutils literal"><span class="pre">:</span></tt> as the path separator).</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id36" id="listing-hidden-imports" name="listing-hidden-imports">Listing Hidden Imports</a></h3>
+<p>Hidden imports are fairly common. These can occur when the code is using
+<tt class="docutils literal"><span class="pre">__import__</span></tt> (or, perhaps <tt class="docutils literal"><span class="pre">exec</span></tt> or <tt class="docutils literal"><span class="pre">eval</span></tt>), in which case you will see a warning in
+the <tt class="docutils literal"><span class="pre">warnproject.txt</span></tt> file. They can also occur when an extension module uses the
+Python/C API to do an import, in which case Analysis can't detect anything. You
+can verify that hidden import is the problem by using Python's verbose imports
+flag. If the import messages say &quot;module not found&quot;, but the <tt class="docutils literal"><span class="pre">warnproject.txt</span></tt>
+file has no &quot;no module named...&quot; message for the same module, then the problem
+is a hidden import.</p>
+<div class="sidebar">
+<p class="first sidebar-title">Standard hidden imports are already included!</p>
+<p class="last">If you are getting worried while reading this paragraph, do not worry:
+having hidden imports is the exception, not the norm! And anyway,
+PyInstaller already ships with a large set of hooks that take care of
+hidden imports for the most common packages out there. For instance,
+<a class="reference" href="http://www.pythonware.com/products/pil/">PIL</a>, <a class="reference" href="http://starship.python.net/crew/mhammond/win32/">PyWin32</a>, <a class="reference" href="http://www.riverbankcomputing.co.uk/pyqt/index.php">PyQt</a> are already taken care of.</p>
+</div>
+<p>Hidden imports are handled by hooking the module (the one doing the hidden
+imports) at <tt class="docutils literal"><span class="pre">Analysis</span></tt> time. Do this by creating a file named <tt class="docutils literal"><span class="pre">hook-module.py</span></tt>
+(where module is the fully-qualified Python name, eg, <tt class="docutils literal"><span class="pre">hook-xml.dom.py</span></tt>), and
+placing it in the <tt class="docutils literal"><span class="pre">hooks</span></tt> package under PyInstaller's root directory,
+(alternatively, you can save it elsewhere, and then use the <tt class="docutils literal"><span class="pre">hookspath</span></tt> arg to
+<tt class="docutils literal"><span class="pre">Analysis</span></tt> so your private hooks directory will be searched). Normally, it will
+have only one line:</p>
+<pre class="literal-block">
+hiddenimports = ['module1', 'module2']
+</pre>
+<p>When the <tt class="docutils literal"><span class="pre">Analysis</span></tt> finds this file, it will proceed exactly as though the module
+explicitly imported <tt class="docutils literal"><span class="pre">module1</span></tt> and <tt class="docutils literal"><span class="pre">module2</span></tt>. (Full details on the analysis-time
+hook mechanism is in the <a class="reference" href="#hooks">Hooks</a> section).</p>
+<p>If you successfully hook a publicly distributed module in this way, please send
+us the hook so we can make it available to others.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id37" id="extending-a-package-s-path" name="extending-a-package-s-path">Extending a Package's <tt class="docutils literal docutils literal"><span class="pre">__path__</span></tt></a></h3>
+<p>Python allows a package to extend the search path used to find modules and
+sub-packages through the <tt class="docutils literal"><span class="pre">__path__</span></tt> mechanism. Normally, a package's <tt class="docutils literal"><span class="pre">__path__</span></tt> has
+only one entry - the directory in which the <tt class="docutils literal"><span class="pre">__init__.py</span></tt> was found. But
+<tt class="docutils literal"><span class="pre">__init__.py</span></tt> is free to extend its <tt class="docutils literal"><span class="pre">__path__</span></tt> to include other directories. For
+example, the <tt class="docutils literal"><span class="pre">win32com.shell.shell</span></tt> module actually resolves to
+<tt class="docutils literal"><span class="pre">win32com/win32comext/shell/shell.pyd</span></tt>. This is because <tt class="docutils literal"><span class="pre">win32com/__init__.py</span></tt>
+appends <tt class="docutils literal"><span class="pre">../win32comext</span></tt> to its <tt class="docutils literal"><span class="pre">__path__</span></tt>.</p>
+<p>Because the <tt class="docutils literal"><span class="pre">__init__.py</span></tt> is not actually run during an analysis, we use the same
+hook mechanism we use for hidden imports. A static list of names won't do,
+however, because the new entry on <tt class="docutils literal"><span class="pre">__path__</span></tt> may well require computation. So
+<tt class="docutils literal"><span class="pre">hook-module.py</span></tt> should define a method <tt class="docutils literal"><span class="pre">hook(mod)</span></tt>. The mod argument is an
+instance of <tt class="docutils literal"><span class="pre">mf.Module</span></tt> which has (more or less) the same attributes as a real
+module object. The hook function should return a <tt class="docutils literal"><span class="pre">mf.Module</span></tt> instance - perhaps
+a brand new one, but more likely the same one used as an arg, but mutated.
+See <a class="reference" href="#mf-py-a-modulefinder-replacement">mf.py: A Modulefinder Replacement</a> for details, and <a class="reference" href="http://pyinstaller.hpcf.upr.edu/pyinstaller/browser/trunk/hooks/hook-win32com.py?rev=latest">hooks/hook-win32com.py</a>
+for an example.</p>
+<p>Note that manipulations of <tt class="docutils literal"><span class="pre">__path__</span></tt> hooked in this way apply to the analysis,
+and only the analysis. That is, at runtime <tt class="docutils literal"><span class="pre">win32com.shell</span></tt> is resolved the same
+way as <tt class="docutils literal"><span class="pre">win32com.anythingelse</span></tt>, and <tt class="docutils literal"><span class="pre">win32com.__path__</span></tt> knows nothing of <tt class="docutils literal"><span class="pre">../win32comext</span></tt>.</p>
+<p>Once in awhile, that's not enough.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id38" id="changing-runtime-behavior" name="changing-runtime-behavior">Changing Runtime Behavior</a></h3>
+<p>More bizarre situations can be accomodated with runtime hooks. These are small
+scripts that manipulate the environment before your main script runs,
+effectively providing additional top-level code to your script.</p>
+<p>At the tail end of an analysis, the module list is examined for matches in
+<tt class="docutils literal"><span class="pre">rthooks.dat</span></tt>, which is the string representation of a Python dictionary. The
+key is the module name, and the value is a list of hook-script pathnames.</p>
+<p>So putting an entry:</p>
+<pre class="literal-block">
+'somemodule': ['path/to/somescript.py'],
+</pre>
+<p>into <tt class="docutils literal"><span class="pre">rthooks.dat</span></tt> is almost the same thing as doing this:</p>
+<pre class="literal-block">
+anal = Analysis(['path/to/somescript.py', 'main.py'], ...
+</pre>
+<p>except that in using the hook, <tt class="docutils literal"><span class="pre">path/to/somescript.py</span></tt> will not be analyzed,
+(that's not a feature - we just haven't found a sane way fit the recursion into
+my persistence scheme).</p>
+<p>Hooks done in this way, while they need to be careful of what they import, are
+free to do almost anything. One provided hook sets things up so that win32com
+can generate modules at runtime (to disk), and the generated modules can be
+found in the win32com package.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id39" id="adapting-to-being-frozen" name="adapting-to-being-frozen">Adapting to being &quot;frozen&quot;</a></h3>
+<p>In most sophisticated apps, it becomes necessary to figure out (at runtime)
+whether you're running &quot;live&quot; or &quot;frozen&quot;. For example, you might have a
+configuration file that (running &quot;live&quot;) you locate based on a module's
+<tt class="docutils literal"><span class="pre">__file__</span></tt> attribute. That won't work once the code is packaged up. You'll
+probably want to look for it based on <tt class="docutils literal"><span class="pre">sys.executable</span></tt> instead.</p>
+<p>The bootloaders set <tt class="docutils literal"><span class="pre">sys.frozen=1</span></tt> (and, for in-process COM servers, the
+embedding DLL sets <tt class="docutils literal"><span class="pre">sys.frozen='dll'</span></tt>).</p>
+<p>For really advanced users, you can access the <tt class="docutils literal"><span class="pre">iu.ImportManager</span></tt> as
+<tt class="docutils literal"><span class="pre">sys.importManager</span></tt>. See <a class="reference" href="#iu-py">iu.py</a> for how you might make use of this fact.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id40" id="accessing-data-files" name="accessing-data-files">Accessing Data Files</a></h3>
+<p>In a <tt class="docutils literal"><span class="pre">--onedir</span></tt> distribution, this is easy: pass a list of your data files
+(in <tt class="docutils literal"><span class="pre">TOC</span></tt> format) to the <tt class="docutils literal"><span class="pre">COLLECT</span></tt>, and they will show up in the distribution
+directory tree. The name in the <tt class="docutils literal"><span class="pre">(name,</span> <span class="pre">path,</span> <span class="pre">'DATA')</span></tt> tuple can be a relative
+path name. Then, at runtime, you can use code like this to find the file:</p>
+<pre class="literal-block">
+os.path.join(os.path.dirname(sys.executable), relativename))
+</pre>
+<p>In a <tt class="docutils literal"><span class="pre">--onefile</span></tt>, it's a bit trickier. You can cheat, and add the files to the
+<tt class="docutils literal"><span class="pre">EXE</span></tt> as <tt class="docutils literal"><span class="pre">BINARY</span></tt>. They will then be extracted at runtime into the work directory
+by the C code (which does not create directories, so the name must be a plain
+name), and cleaned up on exit. The work directory is best found by
+<tt class="docutils literal"><span class="pre">os.environ['_MEIPASS2']</span></tt>. Be awawre, though, that if you use <tt class="docutils literal"><span class="pre">--strip</span></tt> or <tt class="docutils literal"><span class="pre">--upx</span></tt>,
+strange things may happen to your data - <tt class="docutils literal"><span class="pre">BINARY</span></tt> is really for shared
+libs / dlls.</p>
+<p>If you add them as <tt class="docutils literal"><span class="pre">'DATA'</span></tt> to the <tt class="docutils literal"><span class="pre">EXE</span></tt>, then it's up to you to extract them. Use
+code like this:</p>
+<pre class="literal-block">
+import sys, carchive
+this = carchive.CArchive(sys.executable)
+data = this.extract('mystuff')[1]
+</pre>
+<p>to get the contents as a binary string. See <a class="reference" href="http://pyinstaller.hpcf.upr.edu/pyinstaller/browser/trunk/support/unpackTK.py?rev=latest">support/unpackTK.py</a> for an advanced
+example (the TCL and TK lib files are in a PKG which is opened in place, and
+then extracted to the filesystem).</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+</div>
+</div>
+<div class="section">
+<h1><a class="toc-backref" href="#id41" id="miscellaneous" name="miscellaneous">Miscellaneous</a></h1>
+<div class="section">
+<h2><a class="toc-backref" href="#id42" id="pmw-python-mega-widgets" name="pmw-python-mega-widgets">Pmw -- Python Mega Widgets</a></h2>
+<p><a class="reference" href="http://pmw.sourceforge.net/">Pmw</a> comes with a script named <tt class="docutils literal"><span class="pre">bundlepmw</span></tt> in the bin directory. If you follow the
+instructions in that script, you'll end up with a module named <tt class="docutils literal"><span class="pre">Pmw.py</span></tt>. Ensure
+that Builder finds that module and not the development package.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h2><a class="toc-backref" href="#id43" id="win9xpopen" name="win9xpopen">Win9xpopen</a></h2>
+<p>If you're using popen on Windows and want the code to work on Win9x, you'll
+need to distribute <tt class="docutils literal"><span class="pre">win9xpopen.exe</span></tt> with your app. On older Pythons with
+Win32all, this would apply to Win32pipe and <tt class="docutils literal"><span class="pre">win32popenWin9x.exe</span></tt>. (On yet older
+Pythons, no form of popen worked on Win9x).</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h2><a class="toc-backref" href="#id44" id="self-extracting-executables" name="self-extracting-executables">Self-extracting executables</a></h2>
+<p>The ELF executable format (Windows, Linux and some others) allows arbitrary
+data to be concatenated to the end of the executable without disturbing its
+functionality. For this reason, a <tt class="docutils literal"><span class="pre">CArchive</span></tt>'s Table of Contents is at the end of
+the archive. The executable can open itself as a binary file name, seek to the
+end and 'open' the <tt class="docutils literal"><span class="pre">CArchive</span></tt> (see figure 3).</p>
+<p>On other platforms, the archive and the executable are separate, but the
+archive is named <tt class="docutils literal"><span class="pre">executable.pkg</span></tt>, and expected to be in the same directory.
+Other than that, the process is the same.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+<div class="section">
+<h3><a class="toc-backref" href="#id45" id="one-pass-execution" name="one-pass-execution">One Pass Execution</a></h3>
+<p>In a single directory deployment (<tt class="docutils literal"><span class="pre">--onedir</span></tt>, which is the default), all of the
+binaries are already in the file system. In that case, the embedding app:</p>
+<ul class="simple">
+<li>opens the archive</li>
+<li>starts Python (on Windows, this is done with dynamic loading so one embedding
+app binary can be used with any Python version)</li>
+<li>imports all the modules which are at the top level of the archive (basically,
+bootstraps the import hooks)</li>
+<li>mounts the <tt class="docutils literal"><span class="pre">ZlibArchive(s)</span></tt> in the outer archive</li>
+<li>runs all the scripts which are at the top level of the archive</li>
+<li>finalizes Python</li>
+</ul>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id46" id="two-pass-execution" name="two-pass-execution">Two Pass Execution</a></h3>
+<p>There are a couple situations which require two passes:</p>
+<ul class="simple">
+<li>a <tt class="docutils literal"><span class="pre">--onefile</span></tt> deployment (on Windows, the files can't be cleaned up afterwards
+because Python does not call <tt class="docutils literal"><span class="pre">FreeLibrary</span></tt>; on other platforms, Python won't
+find them if they're extracted in the same process that uses them)</li>
+<li><tt class="docutils literal"><span class="pre">LD_LIBRARY_PATH</span></tt> needs to be set to find the binaries (not extension modules,
+but modules the extensions are linked to).</li>
+</ul>
+<p>The first pass:</p>
+<ul class="simple">
+<li>opens the archive</li>
+<li>extracts all the binaries in the archive (in PyInstaller v1.0, this is always to a
+temporary directory).</li>
+<li>sets a magic environment variable</li>
+<li>sets <tt class="docutils literal"><span class="pre">LD_LIBRARY_PATH</span></tt> (non-Windows)</li>
+<li>executes itself as a child process (letting the child use his stdin, stdout
+and stderr)</li>
+<li>waits for the child to exit (on *nix, the child actually replaces the parent)</li>
+<li>cleans up the extracted binaries (so on *nix, this is done by the child)</li>
+</ul>
+<p>The child process executes as in <a class="reference" href="#one-pass-execution">One Pass Execution</a> above (the magic
+environment variable is what tells it that this is pass two).</p>
+<p><img alt="SE_exeImage" src="images/SE_exe.png" /> figure 3 - Self Extracting Executable</p>
+<p>There are, of course, quite a few differences between the Windows and
+Unix/Linux versions. The major one is that because all of Python on Windows is
+in <tt class="docutils literal"><span class="pre">pythonXX.dll</span></tt>, and dynamic loading is so simple-minded, that one binary can
+be use with any version of Python. There's much in common, though, and that C
+code can be found in <a class="reference" href="http://pyinstaller.hpcf.upr.edu/pyinstaller/browser/trunk/source/common/launch.c?rev=latest">source/common/launch.c</a>.</p>
+<p>The Unix/Linux build process (which you need to run just once for any version
+of Python) makes use of the config information in your install (if you
+installed from RPM, you need the Python-development RPM). It also overrides
+<tt class="docutils literal"><span class="pre">getpath.c</span></tt> since we don't want it hunting around the filesystem to build
+<tt class="docutils literal"><span class="pre">sys.path</span></tt>.</p>
+<p>In both cases, while one PyInstaller download can be used with any Python
+version, you need to have separate installations for each Python version.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+</div>
+</div>
+<div class="section">
+<h1><a class="toc-backref" href="#id47" id="pyinstaller-archives" name="pyinstaller-archives">PyInstaller Archives</a></h1>
+<div class="section">
+<h2><a class="toc-backref" href="#id48" id="archives-introduction" name="archives-introduction">Archives Introduction</a></h2>
+<p>You know what an archive is: a <tt class="docutils literal"><span class="pre">.tar</span></tt> file, a <tt class="docutils literal"><span class="pre">.jar</span></tt> file, a <tt class="docutils literal"><span class="pre">.zip</span></tt> file. Two kinds
+of archives are used here. One is equivalent to a Java <tt class="docutils literal"><span class="pre">.jar</span></tt> file - it allows
+Python modules to be stored efficiently and, (with some import hooks) imported
+directly. This is a <tt class="docutils literal"><span class="pre">ZlibArchive</span></tt>. The other (a <tt class="docutils literal"><span class="pre">CArchive</span></tt>) is equivalent to a
+<tt class="docutils literal"><span class="pre">.zip</span></tt> file - a general way of packing up (and optionally compressing) arbitrary
+blobs of data. It gets its name from the fact that it can be manipulated easily
+from C, as well as from Python. Both of these derive from a common base class,
+making it fairly easy to create new kinds of archives.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h2><a class="toc-backref" href="#id49" id="zlibarchive" name="zlibarchive"><tt class="docutils literal docutils literal"><span class="pre">ZlibArchive</span></tt></a></h2>
+<p>A <tt class="docutils literal"><span class="pre">ZlibArchive</span></tt> contains compressed <tt class="docutils literal"><span class="pre">.pyc</span></tt> (or <tt class="docutils literal"><span class="pre">.pyo</span></tt>) files. The Table of Contents
+is a marshalled dictionary, with the key (the module's name as given in an
+<tt class="docutils literal"><span class="pre">import</span></tt> statement) associated with a seek position and length. Because it is
+all marshalled Python, <tt class="docutils literal"><span class="pre">ZlibArchives</span></tt> are completely cross-platform.</p>
+<p>A <tt class="docutils literal"><span class="pre">ZlibArchive</span></tt> hooks in with <a class="reference" href="#iu-py">iu.py</a> so that, with a little setup, the archived
+modules can be imported transparently. Even with compression at level 9, this
+works out to being faster than the normal import. Instead of searching
+<tt class="docutils literal"><span class="pre">sys.path</span></tt>, there's a lookup in the dictionary. There's no <tt class="docutils literal"><span class="pre">stat</span></tt>-ing of the <tt class="docutils literal"><span class="pre">.py</span></tt>
+and <tt class="docutils literal"><span class="pre">.pyc</span></tt> and no file opens (the file is already open). There's just a seek, a
+read and a decompress. A traceback will point to the source file the archive
+entry was created from (the <tt class="docutils literal"><span class="pre">__file__</span></tt> attribute from the time the <tt class="docutils literal"><span class="pre">.pyc</span></tt> was
+compiled). On a user's box with no source installed, this is not terribly
+useful, but if they send you the traceback, at least you can make sense of it.</p>
+<p><img alt="ZlibArchiveImage" src="images/ZlibArchive.png" /></p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h2><a class="toc-backref" href="#id50" id="carchive" name="carchive"><tt class="docutils literal docutils literal"><span class="pre">CArchive</span></tt></a></h2>
+<p>A <tt class="docutils literal"><span class="pre">CArchive</span></tt> contains whatever you want to stuff into it. It's very much like a
+<tt class="docutils literal"><span class="pre">.zip</span></tt> file. They are easy to create in Python and unpack from C code. <tt class="docutils literal"><span class="pre">CArchives</span></tt>
+can be appended to other files (like ELF and COFF executables, for example).
+To allow this, they are opened from the end, so the <tt class="docutils literal"><span class="pre">TOC</span></tt> for a <tt class="docutils literal"><span class="pre">CArchive</span></tt> is at
+the back, followed only by a cookie that tells you where the <tt class="docutils literal"><span class="pre">TOC</span></tt> starts and
+where the archive itself starts.</p>
+<p><tt class="docutils literal"><span class="pre">CArchives</span></tt> can also be embedded within other <tt class="docutils literal"><span class="pre">CArchives</span></tt>. The inner archive can be
+opened in place (without extraction).</p>
+<p>Each <tt class="docutils literal"><span class="pre">TOC</span></tt> entry is variable length. The first field in the entry tells you the
+length of the entry. The last field is the name of the corresponding packed
+file. The name is null terminated. Compression is optional by member.</p>
+<p>There is also a type code associated with each entry. If you're using a
+<tt class="docutils literal"><span class="pre">CArchive</span></tt> as a <tt class="docutils literal"><span class="pre">.zip</span></tt> file, you don't need to worry about this. The type codes
+are used by the self-extracting executables.</p>
+<p><img alt="CArchiveImage" src="images/CArchive.png" /></p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+</div>
+<div class="section">
+<h1><a class="toc-backref" href="#id51" id="license" name="license">License</a></h1>
+<p>PyInstaller is mainly distributed  under the
+<a class="reference" href="http://pyinstaller.hpcf.upr.edu/pyinstaller/browser/trunk/doc/LICENSE.GPL?rev=latest">GPL License</a>
+but it has an exception such that you can use it to compile commercial products.</p>
+<p>In a nutshell, the license is GPL for the source code with the exception that:</p>
+<blockquote>
+<ol class="arabic simple">
+<li>You may use PyInstaller to compile commercial applications out of your
+source code.</li>
+<li>The resulting binaries generated by PyInstaller from your source code can be
+shipped with whatever license you want.</li>
+<li>You may modify PyInstaller for your own needs but <em>these</em> changes to the
+PyInstaller source code falls under the terms of the GPL license. In other
+words, any modifications to will <em>have</em> to be distributed under GPL.</li>
+</ol>
+</blockquote>
+<p>For updated information or clarification see our
+<a class="reference" href="http://pyinstaller.hpcf.upr.edu/pyinstaller/wiki/FAQ">FAQ</a> at <a class="reference" href="http://pyinstaller.hpcf.upr.edu/pyinstaller">PyInstaller</a>
+home page: <a class="reference" href="http://pyinstaller.hpcf.upr.edu">http://pyinstaller.hpcf.upr.edu</a></p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h1><a class="toc-backref" href="#id52" id="appendix" name="appendix">Appendix</a></h1>
+<div class="sidebar">
+<p class="first sidebar-title">You can stop reading here...</p>
+<p class="last">... if you are not interested in technical details. This appendix contains
+insights of the internal workings of PyInstaller, and you do not need this
+information unless you plan to work on PyInstaller itself.</p>
+</div>
+<div class="section">
+<h2><a class="toc-backref" href="#id53" id="mf-py-a-modulefinder-replacement" name="mf-py-a-modulefinder-replacement"><tt class="docutils literal docutils literal"><span class="pre">mf.py</span></tt>: A Modulefinder Replacement</a></h2>
+<p>Module <tt class="docutils literal"><span class="pre">mf</span></tt> is modelled after <tt class="docutils literal"><span class="pre">iu</span></tt>.</p>
+<p>It also uses <tt class="docutils literal"><span class="pre">ImportDirectors</span></tt> and <tt class="docutils literal"><span class="pre">Owners</span></tt> to partition the import name space.
+Except for the fact that these return <tt class="docutils literal"><span class="pre">Module</span></tt> instances instead of real module
+objects, they are identical.</p>
+<p>Instead of an <tt class="docutils literal"><span class="pre">ImportManager</span></tt>, <tt class="docutils literal"><span class="pre">mf</span></tt> has an <tt class="docutils literal"><span class="pre">ImportTracker</span></tt> managing things.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+<div class="section">
+<h3><a class="toc-backref" href="#id54" id="importtracker" name="importtracker">ImportTracker</a></h3>
+<p><tt class="docutils literal"><span class="pre">ImportTracker</span></tt> can be called in two ways: <tt class="docutils literal"><span class="pre">analyze_one(name,</span> <span class="pre">importername=None)</span></tt>
+or <tt class="docutils literal"><span class="pre">analyze_r(name,</span> <span class="pre">importername=None)</span></tt>. The second method does what modulefinder
+does - it recursively finds all the module names that importing name would
+cause to appear in <tt class="docutils literal"><span class="pre">sys.modules</span></tt>. The first method is non-recursive. This is
+useful, because it is the only way of answering the question &quot;Who imports
+name?&quot; But since it is somewhat unrealistic (very few real imports do not
+involve recursion), it deserves some explanation.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id55" id="analyze-one" name="analyze-one"><tt class="docutils literal docutils literal"><span class="pre">analyze_one()</span></tt></a></h3>
+<p>When a name is imported, there are structural and dynamic effects. The dynamic
+effects are due to the execution of the top-level code in the module (or
+modules) that get imported. The structural effects have to do with whether the
+import is relative or absolute, and whether the name is a dotted name (if there
+are N dots in the name, then N+1 modules will be imported even without any code
+running).</p>
+<p>The analyze_one method determines the structural effects, and defers the
+dynamic effects. For example, <tt class="docutils literal"><span class="pre">analyze_one(&quot;B.C&quot;,</span> <span class="pre">&quot;A&quot;)</span></tt> could return <tt class="docutils literal"><span class="pre">[&quot;B&quot;,</span> <span class="pre">&quot;B.C&quot;]</span></tt>
+or <tt class="docutils literal"><span class="pre">[&quot;A.B&quot;,</span> <span class="pre">&quot;A.B.C&quot;]</span></tt> depending on whether the import turns out to be relative or
+absolute. In addition, ImportTracker's modules dict will have Module instances
+for them.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id56" id="module-classes" name="module-classes">Module Classes</a></h3>
+<p>There are Module subclasses for builtins, extensions, packages and (normal)
+modules. Besides the normal module object attributes, they have an attribute
+imports. For packages and normal modules, imports is a list populated by
+scanning the code object (and therefor, the names in this list may be relative
+or absolute names - we don't know until they have been analyzed).</p>
+<p>The highly astute will notice that there is a hole in <tt class="docutils literal"><span class="pre">analyze_one()</span></tt> here. The
+first thing that happens when <tt class="docutils literal"><span class="pre">B.C</span></tt> is being imported is that <tt class="docutils literal"><span class="pre">B</span></tt> is imported and
+it's top-level code executed. That top-level code can do various things so that
+when the import of <tt class="docutils literal"><span class="pre">B.C</span></tt> finally occurs, something completely different happens
+(from what a structural analysis would predict). But mf can handle this through
+it's hooks mechanism.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id57" id="code-scanning" name="code-scanning">code scanning</a></h3>
+<p>Like modulefinder, <tt class="docutils literal"><span class="pre">mf</span></tt> scans the byte code of a module, looking for imports. In
+addition, <tt class="docutils literal"><span class="pre">mf</span></tt> will pick out a module's <tt class="docutils literal"><span class="pre">__all__</span></tt> attribute, if it is built as a
+list of constant names. This means that if a package declares an <tt class="docutils literal"><span class="pre">__all__</span></tt> list
+as a list of names, ImportTracker will track those names if asked to analyze
+<tt class="docutils literal"><span class="pre">package.*</span></tt>. The code scan also notes the occurance of <tt class="docutils literal"><span class="pre">__import__</span></tt>, <tt class="docutils literal"><span class="pre">exec</span></tt> and <tt class="docutils literal"><span class="pre">eval</span></tt>,
+and can issue warnings when they're found.</p>
+<p>The code scanning also keeps track (as well as it can) of the context of an
+import. It recognizes when imports are found at the top-level, and when they
+are found inside definitions (deferred imports). Within that, it also tracks
+whether the import is inside a condition (conditional imports).</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id58" id="hooks" name="hooks">Hooks</a></h3>
+<p>In modulefinder, scanning the code takes the place of executing the code
+object. <tt class="docutils literal"><span class="pre">mf</span></tt> goes further and allows a module to be hooked (after it has been
+scanned, but before analyze_one is done with it). A hook is a module named
+<tt class="docutils literal"><span class="pre">hook-fullyqualifiedname</span></tt> in the <tt class="docutils literal"><span class="pre">hooks</span></tt> package. These modules should have one or
+more of the following three global names defined:</p>
+<dl class="docutils">
+<dt><tt class="docutils literal"><span class="pre">hiddenimports</span></tt></dt>
+<dd>a list of modules names (relative or absolute) that the module imports in some untrackable way.</dd>
+<dt><tt class="docutils literal"><span class="pre">attrs</span></tt></dt>
+<dd>a list of <tt class="docutils literal"><span class="pre">(name,</span> <span class="pre">value)</span></tt> pairs (where value is normally meaningless).</dd>
+<dt><tt class="docutils literal"><span class="pre">hook(mod)</span></tt></dt>
+<dd>a function taking a <tt class="docutils literal"><span class="pre">Module</span></tt> instance and returning a <tt class="docutils literal"><span class="pre">Module</span></tt> instance (so it can modify or replace).</dd>
+</dl>
+<p>The first hook (<tt class="docutils literal"><span class="pre">hiddenimports</span></tt>) extends the list created by scanning the code.
+<tt class="docutils literal"><span class="pre">ExtensionModules</span></tt>, of course, don't get scanned, so this is the only way of
+recording any imports they do.</p>
+<p>The second hook (<tt class="docutils literal"><span class="pre">attrs</span></tt>) exists mainly so that ImportTracker won't issue
+spurious warnings when the rightmost node in a dotted name turns out to be an
+attribute in a package module, instead of a missing submodule.</p>
+<p>The callable hook exists for things like dynamic modification of a package's
+<tt class="docutils literal"><span class="pre">__path__</span></tt> or perverse situations, like <tt class="docutils literal"><span class="pre">xml.__init__</span></tt> replacing itself in
+<tt class="docutils literal"><span class="pre">sys.modules</span></tt> with <tt class="docutils literal"><span class="pre">_xmlplus.__init__</span></tt>. (It takes nine hook modules to properly
+trace through PyXML-using code, and I can't believe that it's any easier for
+the poor programmer using that package). The <tt class="docutils literal"><span class="pre">hook(mod)</span></tt> (if it exists) is
+called before looking at the others - that way it can, for example, test
+<tt class="docutils literal"><span class="pre">sys.version</span></tt> and adjust what's in <tt class="docutils literal"><span class="pre">hiddenimports</span></tt>.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id59" id="warnings" name="warnings">Warnings</a></h3>
+<p><tt class="docutils literal"><span class="pre">ImportTracker</span></tt> has a <tt class="docutils literal"><span class="pre">getwarnings()</span></tt> method that returns all the warnings
+accumulated by the instance, and by the <tt class="docutils literal"><span class="pre">Module</span></tt> instances in its modules dict.
+Generally, it is <tt class="docutils literal"><span class="pre">ImportTracker</span></tt> who will accumulate the warnings generated
+during the structural phase, and <tt class="docutils literal"><span class="pre">Modules</span></tt> that will get the warnings generated
+during the code scan.</p>
+<p>Note that by using a hook module, you can silence some particularly tiresome
+warnings, but not all of them.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id60" id="cross-reference" name="cross-reference">Cross Reference</a></h3>
+<p>Once a full analysis (that is, an <tt class="docutils literal"><span class="pre">analyze_r</span></tt> call) has been done, you can get a
+cross reference by using <tt class="docutils literal"><span class="pre">getxref()</span></tt>. This returns a list of tuples. Each tuple
+is <tt class="docutils literal"><span class="pre">(modulename,</span> <span class="pre">importers)</span></tt>, where importers is a list of the (fully qualified)
+names of the modules importing <tt class="docutils literal"><span class="pre">modulename</span></tt>. Both the returned list and the
+importers list are sorted.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id61" id="usage" name="usage">Usage</a></h3>
+<p>A simple example follows:</p>
+<blockquote>
+<pre class="doctest-block">
+&gt;&gt;&gt; import mf
+&gt;&gt;&gt; a = mf.ImportTracker()
+&gt;&gt;&gt; a.analyze_r(&quot;os&quot;)
+['os', 'sys', 'posixpath', 'nt', 'stat', 'string', 'strop',
+'re', 'pcre', 'ntpath', 'dospath', 'macpath', 'win32api',
+'UserDict', 'copy', 'types', 'repr', 'tempfile']
+&gt;&gt;&gt; a.analyze_one(&quot;os&quot;)
+['os']
+&gt;&gt;&gt; a.modules['string'].imports
+[('strop', 0, 0), ('strop.*', 0, 0), ('re', 1, 1)]
+&gt;&gt;&gt;
+</pre>
+</blockquote>
+<p>The tuples in the imports list are (name, delayed, conditional).</p>
+<blockquote>
+<pre class="doctest-block">
+&gt;&gt;&gt; for w in a.modules['string'].warnings: print w
+...
+W: delayed  eval hack detected at line 359
+W: delayed  eval hack detected at line 389
+W: delayed  eval hack detected at line 418
+&gt;&gt;&gt; for w in a.getwarnings(): print w
+...
+W: no module named pwd (delayed, conditional import by posixpath)
+W: no module named dos (conditional import by os)
+W: no module named os2 (conditional import by os)
+W: no module named posix (conditional import by os)
+W: no module named mac (conditional import by os)
+W: no module named MACFS (delayed, conditional import by tempfile)
+W: no module named macfs (delayed, conditional import by tempfile)
+W: top-level conditional exec statment detected at line 47
+   - os (C:\Program Files\Python\Lib\os.py)
+W: delayed  eval hack detected at line 359
+   - string (C:\Program Files\Python\Lib\string.py)
+W: delayed  eval hack detected at line 389
+   - string (C:\Program Files\Python\Lib\string.py)
+W: delayed  eval hack detected at line 418
+   - string (C:\Program Files\Python\Lib\string.py)
+&gt;&gt;&gt;
+</pre>
+</blockquote>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+</div>
+<div class="section">
+<h2><a class="toc-backref" href="#id62" id="iu-py-an-imputil-replacement" name="iu-py-an-imputil-replacement"><span id="iu-py"></span><tt class="docutils literal docutils literal"><span class="pre">iu.py</span></tt>: An <em>imputil</em> Replacement</a></h2>
+<p>Module <tt class="docutils literal"><span class="pre">iu</span></tt> grows out of the pioneering work that Greg Stein did with <tt class="docutils literal"><span class="pre">imputil</span></tt>
+(actually, it includes some verbatim <tt class="docutils literal"><span class="pre">imputil</span></tt> code, but since Greg didn't
+copyright it, we won't mention it). Both modules can take over Python's
+builtin import and ease writing of at least certain kinds of import hooks.</p>
+<p><tt class="docutils literal"><span class="pre">iu</span></tt> differs from <tt class="docutils literal"><span class="pre">imputil</span></tt>:
+* faster
+* better emulation of builtin import
+* more managable</p>
+<p>There is an <tt class="docutils literal"><span class="pre">ImportManager</span></tt> which provides the replacement for builtin import
+and hides all the semantic complexities of a Python import request from it's
+delegates.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+<div class="section">
+<h3><a class="toc-backref" href="#id63" id="importmanager" name="importmanager"><tt class="docutils literal docutils literal"><span class="pre">ImportManager</span></tt></a></h3>
+<p><tt class="docutils literal"><span class="pre">ImportManager</span></tt> formalizes the concept of a metapath. This concept implicitly
+exists in native Python in that builtins and frozen modules are searched
+before <tt class="docutils literal"><span class="pre">sys.path</span></tt>, (on Windows there's also a search of the registry while on
+Mac, resources may be searched). This metapath is a list populated with
+<tt class="docutils literal"><span class="pre">ImportDirector</span></tt> instances. There are <tt class="docutils literal"><span class="pre">ImportDirector</span></tt> subclasses for builtins,
+frozen modules, (on Windows) modules found through the registry and a
+<tt class="docutils literal"><span class="pre">PathImportDirector</span></tt> for handling <tt class="docutils literal"><span class="pre">sys.path</span></tt>. For a top-level import (that is, not
+an import of a module in a package), <tt class="docutils literal"><span class="pre">ImportManager</span></tt> tries each director on it's
+metapath until one succeeds.</p>
+<p><tt class="docutils literal"><span class="pre">ImportManager</span></tt> hides the semantic complexity of an import from the directors.
+It's up to the <tt class="docutils literal"><span class="pre">ImportManager</span></tt> to decide if an import is relative or absolute;
+to see if the module has already been imported; to keep <tt class="docutils literal"><span class="pre">sys.modules</span></tt> up to
+date; to handle the fromlist and return the correct module object.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id64" id="importdirector" name="importdirector"><tt class="docutils literal docutils literal"><span class="pre">ImportDirector</span></tt></a></h3>
+<p>An <tt class="docutils literal"><span class="pre">ImportDirector</span></tt> just needs to respond to <tt class="docutils literal"><span class="pre">getmod(name)</span></tt> by returning a module
+object or <tt class="docutils literal"><span class="pre">None</span></tt>. As you will see, an <tt class="docutils literal"><span class="pre">ImportDirector</span></tt> can consider name to be
+atomic - it has no need to examine name to see if it is dotted.</p>
+<p>To see how this works, we need to examine the <tt class="docutils literal"><span class="pre">PathImportDirector</span></tt>.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id65" id="pathimportdirector" name="pathimportdirector"><tt class="docutils literal docutils literal"><span class="pre">PathImportDirector</span></tt></a></h3>
+<p>The <tt class="docutils literal"><span class="pre">PathImportDirector</span></tt> subclass manages a list of names - most notably,
+<tt class="docutils literal"><span class="pre">sys.path</span></tt>. To do so, it maintains a shadowpath - a dictionary mapping the names
+on its pathlist (eg, <tt class="docutils literal"><span class="pre">sys.path</span></tt>) to their associated <tt class="docutils literal"><span class="pre">Owners</span></tt>. (It could do this
+directly, but the assumption that sys.path is occupied solely by strings seems
+ineradicable.) <tt class="docutils literal"><span class="pre">Owners</span></tt> of the appropriate kind are created as needed (if all
+your imports are satisfied by the first two elements of <tt class="docutils literal"><span class="pre">sys.path</span></tt>, the
+<tt class="docutils literal"><span class="pre">PathImportDirector</span></tt>'s shadowpath will only have two entries).</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id66" id="owner" name="owner"><tt class="docutils literal docutils literal"><span class="pre">Owner</span></tt></a></h3>
+<p>An <tt class="docutils literal"><span class="pre">Owner</span></tt> is much like an <tt class="docutils literal"><span class="pre">ImportDirector</span></tt> but manages a much more concrete piece
+of turf. For example, a <tt class="docutils literal"><span class="pre">DirOwner</span></tt> manages one directory. Since there are no
+other officially recognized filesystem-like namespaces for importing, that's
+all that's included in iu, but it's easy to imagine <tt class="docutils literal"><span class="pre">Owners</span></tt> for zip files
+(and I have one for my own <tt class="docutils literal"><span class="pre">.pyz</span></tt> archive format) or even URLs.</p>
+<p>As with <tt class="docutils literal"><span class="pre">ImportDirectors</span></tt>, an <tt class="docutils literal"><span class="pre">Owner</span></tt> just needs to respond to <tt class="docutils literal"><span class="pre">getmod(name)</span></tt> by
+returning a module object or <tt class="docutils literal"><span class="pre">None</span></tt>, and it can consider name to be atomic.</p>
+<p>So structurally, we have a tree, rooted at the <tt class="docutils literal"><span class="pre">ImportManager</span></tt>. At the next
+level, we have a set of <tt class="docutils literal"><span class="pre">ImportDirectors</span></tt>. At least one of those directors, the
+<tt class="docutils literal"><span class="pre">PathImportDirector</span></tt> in charge of <tt class="docutils literal"><span class="pre">sys.path</span></tt>, has another level beneath it,
+consisting of <tt class="docutils literal"><span class="pre">Owners</span></tt>. This much of the tree covers the entire top-level import
+namespace.</p>
+<p>The rest of the import namespace is covered by treelets, each rooted in a
+package module (an <tt class="docutils literal"><span class="pre">__init__.py</span></tt>).</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id67" id="packages" name="packages">Packages</a></h3>
+<p>To make this work, <tt class="docutils literal"><span class="pre">Owners</span></tt> need to recognize when a module is a package. For a
+<tt class="docutils literal"><span class="pre">DirOwner</span></tt>, this means that name is a subdirectory which contains an <tt class="docutils literal"><span class="pre">__init__.py</span></tt>.
+The <tt class="docutils literal"><span class="pre">__init__</span></tt> module is loaded and its <tt class="docutils literal"><span class="pre">__path__</span></tt> is initialized with the
+subdirectory. Then, a <tt class="docutils literal"><span class="pre">PathImportDirector</span></tt> is created to manage this <tt class="docutils literal"><span class="pre">__path__</span></tt>.
+Finally the new <tt class="docutils literal"><span class="pre">PathImportDirector</span></tt>'s <tt class="docutils literal"><span class="pre">getmod</span></tt> is assigned to the package's
+<tt class="docutils literal"><span class="pre">__importsub__</span></tt> function.</p>
+<p>When a module within the package is imported, the request is routed (by the
+<tt class="docutils literal"><span class="pre">ImportManager</span></tt>) diretly to the package's <tt class="docutils literal"><span class="pre">__importsub__</span></tt>. In a hierarchical
+namespace (like a filesystem), this means that <tt class="docutils literal"><span class="pre">__importsub__</span></tt> (which is really
+the bound getmod method of a <tt class="docutils literal"><span class="pre">PathImportDirector</span></tt> instance) needs only the
+module name, not the package name or the fully qualified name. And that's
+exactly what it gets. (In a flat namespace - like most archives - it is
+perfectly easy to route the request back up the package tree to the archive
+<tt class="docutils literal"><span class="pre">Owner</span></tt>, qualifying the name at each step.)</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id68" id="possibilities" name="possibilities">Possibilities</a></h3>
+<p>Let's say we want to import from zip files. So, we subclass <tt class="docutils literal"><span class="pre">Owner</span></tt>. The
+<tt class="docutils literal"><span class="pre">__init__</span></tt> method should take a filename, and raise a <tt class="docutils literal"><span class="pre">ValueError</span></tt> if the file is
+not an acceptable <tt class="docutils literal"><span class="pre">.zip</span></tt> file, (when a new name is encountered on <tt class="docutils literal"><span class="pre">sys.path</span></tt> or a
+package's <tt class="docutils literal"><span class="pre">__path__</span></tt>, registered Owners are tried until one accepts the name).
+The <tt class="docutils literal"><span class="pre">getmod</span></tt> method would check the zip file's contents and return <tt class="docutils literal"><span class="pre">None</span></tt> if the
+name is not found. Otherwise, it would extract the marshalled code object from
+the zip, create a new module object and perform a bit of initialization (12
+lines of code all told for my own archive format, including initializing a pack
+age with it's <tt class="docutils literal"><span class="pre">__subimporter__</span></tt>).</p>
+<p>Once the new <tt class="docutils literal"><span class="pre">Owner</span></tt> class is registered with <tt class="docutils literal"><span class="pre">iu</span></tt>, you can put a zip file on
+<tt class="docutils literal"><span class="pre">sys.path</span></tt>. A package could even put a zip file on its <tt class="docutils literal"><span class="pre">__path__</span></tt>.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id69" id="compatibility" name="compatibility">Compatibility</a></h3>
+<p>This code has been tested with the PyXML, mxBase and Win32 packages, covering
+over a dozen import hacks from manipulations of <tt class="docutils literal"><span class="pre">__path__</span></tt> to replacing a module
+in <tt class="docutils literal"><span class="pre">sys.modules</span></tt> with a different one. Emulation of Python's native import is
+nearly exact, including the names recorded in <tt class="docutils literal"><span class="pre">sys.modules</span></tt> and module attributes
+(packages imported through <tt class="docutils literal"><span class="pre">iu</span></tt> have an extra attribute - <tt class="docutils literal"><span class="pre">__importsub__</span></tt>).</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id70" id="performance" name="performance">Performance</a></h3>
+<p>In most cases, <tt class="docutils literal"><span class="pre">iu</span></tt> is slower than builtin import (by 15 to 20%) but faster than
+<tt class="docutils literal"><span class="pre">imputil</span></tt> (by 15 to 20%). By inserting archives at the front of <tt class="docutils literal"><span class="pre">sys.path</span></tt>
+containing the standard lib and the package being tested, this can be reduced
+to 5 to 10% slower (or, on my 1.52 box, 10% faster!) than builtin import. A bit
+more can be shaved off by manipulating the <tt class="docutils literal"><span class="pre">ImportManager</span></tt>'s metapath.</p>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id71" id="limitations" name="limitations">Limitations</a></h3>
+<p>This module makes no attempt to facilitate policy import hacks. It is easy to
+implement certain kinds of policies within a particular domain, but
+fundamentally iu works by dividing up the import namespace into independent
+domains.</p>
+<p>Quite simply, I think cross-domain import hacks are a very bad idea. As author
+of the original package on which PyInstaller is based, McMillan worked with
+import hacks for many years. Many of them are highly fragile; they often rely
+on undocumented (maybe even accidental) features of implementation.
+A cross-domain import hack is not likely to work with PyXML, for example.</p>
+<p>That rant aside, you can modify <tt class="docutils literal"><span class="pre">ImportManger</span></tt> to implement different policies.
+For example, a version that implements three import primitives: absolute
+import, relative import and recursive-relative import. No idea what the Python
+syntax for those should be, but <tt class="docutils literal"><span class="pre">__aimport__</span></tt>, <tt class="docutils literal"><span class="pre">__rimport__</span></tt> and <tt class="docutils literal"><span class="pre">__rrimport__</span></tt> were
+easy to implement.</p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id72" id="id1" name="id1">Usage</a></h3>
+<p>Here's a simple example of using <tt class="docutils literal"><span class="pre">iu</span></tt> as a builtin import replacement.</p>
+<blockquote>
+<pre class="doctest-block">
+&gt;&gt;&gt; import iu
+&gt;&gt;&gt; iu.ImportManager().install()
+&gt;&gt;&gt;
+&gt;&gt;&gt; import DateTime
+&gt;&gt;&gt; DateTime.__importsub__
+&lt;method PathImportDirector.getmod
+  of PathImportDirector instance at 825900&gt;
+&gt;&gt;&gt;
+</pre>
+</blockquote>
+<p><a class="reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference reference" href="#pyinstaller-manual">Back to Top</a></p>
+</div>
+</div>
+</div>
+</div>
+<div class="footer">
+<hr class="footer" />
+<a class="reference" href="source/Manual.rst">View document source</a>.
+Generated on: 2006-02-08 14:02 UTC.
+Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
+
+</div>
+</body>
+</html>
Binary file srcanamdw/codescanner/pyinstaller/doc/images/CArchive.png has changed
Binary file srcanamdw/codescanner/pyinstaller/doc/images/SE_exe.png has changed
Binary file srcanamdw/codescanner/pyinstaller/doc/images/ZlibArchive.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/doc/source/Makefile	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,53 @@
+#
+# Generate PyInstaller documentation
+#
+
+.PHONY: doc pdf
+
+all:
+	@echo "make doc   ===> To generate a html and pdf of the documentation"
+	@echo "make html  ===> To generate a html of the documentation"
+	@echo "make pdf   ===> To generate a pdf of the documentation"
+
+
+doc: html pdf cleanlogs
+	@echo "Documentation generated: Please see ../*.html and ../*.pdf for files"
+
+
+html: ../Manual.html
+pdf: ../Manual.pdf
+
+../Manual.html: Manual.rst
+	tools/buildrecursive.py --local --strict --title='PyInstaller Manual' --outpath=..
+
+Manual.tex: Manual.rst
+	tools/rst2newlatex.py --stylesheet-path=stylesheets/latex.tex Manual.rst Manual.tex
+
+../Manual.pdf: Manual.tex
+	cd .. ; pdflatex source/Manual.tex
+	@echo "#############################################################################"
+	@echo "# Executing again to fix Table of Content...                                #"
+	@echo "#############################################################################"
+	cd .. ; pdflatex source/Manual.tex
+
+clean:
+	@echo "make cleanall  ===> To clean everything"
+	@echo "make cleanlogs ===> To clean *.log, *.aux, etc. but not the .html or .pdf"
+
+
+cleanall: cleanlogs
+	rm -f ../*.pdf
+	rm -f ../*.html
+	@echo "All logs and documentation removed."
+
+
+cleanlogs:
+	rm -f ../*.aux
+	rm -f ../*.out
+	rm -f .log *.log  ../*.log
+	@echo "All logs and aux removed."
+
+
+#
+# END OF FILE
+#
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/doc/source/Manual.rst	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,1644 @@
+==================
+PyInstaller Manual
+==================
+:Author: William Caban (based on Gordon McMillan's manual)
+:Contact: william@hpcf.upr.edu
+:Revision: $Rev: 257 $
+:Source URL: $HeadURL: http://svn.pyinstaller.python-hosting.com/trunk/doc/source/Manual.rst $
+:Copyright: This document has been placed in the public domain.
+
+.. contents::
+
+
+Getting Started
++++++++++++++++
+
+Installing PyInstaller
+----------------------
+
+First, unpack the archive on you path of choice. Installer is **not** a Python
+package, so it doesn't need to go in site-packages, or have a .pth file. For
+the purpose of this documentation we will assume |install_path|. You will be
+using a couple of scripts in the |install_path| directory, and these will find
+everything they need from their own location. For convenience, keep the paths
+to these scripts short (don't install in a deeply nested subdirectory).
+
+|PyInstaller| is dependant to the version of python you configure it for. In
+other words, you will need a separate copy of |PyInstaller| for each Python
+version you wish to work with *or* you'll need to rerun ``Configure.py`` every
+time you switch the Python version).
+
+|GOBACK|
+
+
+Building the runtime executables
+--------------------------------
+
+*Note:* Windows users can skip this step, because all of Python is contained in
+pythonXX.dll, and |PyInstaller| will use your pythonXX.dll.
+
+On Linux the first thing to do is build the runtime executables.
+
+Change to the |install_path| ``source/linux`` subdirectory. Run ``Make.py
+[-n|-e]`` and then make. This will produce ``support/loader/run`` and
+``support/loader/run_d``, which are the bootloaders.
+
+.. sidebar:: Bootloader
+
+   The bootloader (also known as *stub* in literature) is the small program
+   which starts up your packaged program. Usually, the archive containing the
+   bytecoded modules of your program is simply attended to it. See
+   `Self-extracting executables`_ for more details on the process.
+
+*Note:* If you have multiple versions of Python, the Python you use to run
+``Make.py`` is the one whose configuration is used.
+
+The ``-n`` and ``-e`` options set a non-elf or elf flag in your ``config.dat``.
+As of |InitialVersion|, the executable will try both strategies, and this flag
+just sets how you want your executables built. In the elf strategy, the archive
+is concatenated to the executable. In the non-elf strategy, the executable
+expects an archive with the same name as itself in the executable's directory.
+Note that the executable chases down symbolic links before determining it's name
+and directory, so putting the archive in the same directory as the symbolic link
+will not work.
+
+Windows distributions come with several executables in the ``support/loader``
+directory: ``run_*.exe`` (bootloader for regular programs), and
+``inprocsrvr_*.dll`` (bootloader for in-process COM servers). To rebuild this,
+you need to install Scons_, and then just run ``scons`` from the |install_path|
+directory.
+
+|GOBACK|
+
+Configuring your PyInstaller setup
+----------------------------------
+
+In the |install_path| directory, run ``Configure.py``. This saves some
+information into ``config.dat`` that would otherwise be recomputed every time.
+It can be rerun at any time if your configuration changes. It must be run before
+trying to build anything.
+
+|GOBACK|
+
+
+Create a spec file for your project
+-----------------------------------
+
+[For Windows COM server support, see section `Windows COM Server Support`_]
+
+The root directory has a script Makespec.py for this purpose::
+
+       python Makespec.py [opts] <scriptname> [<scriptname> ...]
+
+Where allowed OPTIONS are:
+
+-F, --onefile
+    produce a single file deployment (see below).
+
+-D, --onedir
+    produce a single directory deployment (default).
+
+-K, --tk
+    include TCL/TK in the deployment.
+
+-a, --ascii
+    do not include encodings. The default (on Python versions with unicode
+    support) is now to include all encodings.
+
+-d, --debug
+    use debug (verbose) versions of the executables.
+
+-w, --windowed, --noconsole
+    Use the Windows subsystem executable, which does not open
+    the console when the program is launched. **(Windows only)**
+
+-c, --nowindowed, --console
+    Use the console subsystem executable. This is the default. **(Windows only)**
+
+-s, --strip
+    the executable and all shared libraries will be run through strip. Note
+    that cygwin's strip tends to render normal Win32 dlls unusable.
+
+-X, --upx
+    if you have UPX installed (detected by Configure), this will use it to
+    compress your executable (and, on Windows, your dlls). See note below.
+
+-o DIR, --out=DIR
+    create the spec file in *directory*. If not specified, and the current
+    directory is Installer's root directory, an output subdirectory will be
+    created. Otherwise the current directory is used.
+
+-p DIR, --paths=DIR
+    set base path for import (like using PYTHONPATH). Multiple directories are
+    allowed, separating them with the path separator (';' under Windows, ':'
+    under Linux), or using this option multiple times.
+
+--icon=<FILE.ICO>
+    add *file.ico* to the executable's resources. **(Windows only)**
+
+--icon=<FILE.EXE,N>
+    add the *n*-th incon in *file.exe* to the executable's resources. **(Windows
+    only)**
+
+-v FILE, --version=FILE
+    add verfile as a version resource to the executable. **(Windows only)**
+
+-n NAME, --name=NAME
+    optional *name* to assign to the project (from which the spec file name is
+    generated). If omitted, the basename of the (first) script is used.
+
+[For building with optimization on (like ``Python -O``), see section
+`Building Optimized`_]
+
+For simple projects, the generated spec file will probably be sufficient. For
+more complex projects, it should be regarded as a template. The spec file is
+actually Python code, and modifying it should be ease. See `Spec Files`_ for
+details.
+
+
+|GOBACK|
+
+Build your project
+------------------
+
+::
+
+      python Build.py specfile
+
+
+A ``buildproject`` subdirectory will be created in the specfile's directory. This
+is a private workspace so that ``Build.py`` can act like a makefile. Any named
+targets will appear in the specfile's directory. For ``--onedir``
+configurations, it will create also ``distproject``, which is the directory you're
+interested in. For a ``--onefile``, the executable will be in the specfile's
+directory.
+
+In most cases, this will be all you have to do. If not, see `When things go
+wrong`_ and be sure to read the introduction to `Spec Files`_.
+
+|GOBACK|
+
+Windows COM Server support
+--------------------------
+
+For Windows COM support execute::
+
+       python MakeCOMServer.py [OPTION] script...
+
+
+This will generate a new script ``drivescript.py`` and a spec file for the script.
+
+These options are allowed:
+
+--debug
+    Use the verbose version of the executable.
+
+--verbose
+    Register the COM server(s) with the quiet flag off.
+
+--ascii
+    do not include encodings (this is passed through to Makespec).
+
+--out <dir>
+    Generate the driver script and spec file in dir.
+
+Now `Build your project`_ on the generated spec file.
+
+If you have the win32dbg package installed, you can use it with the generated
+COM server. In the driver script, set ``debug=1`` in the registration line.
+
+**Warnings**: the inprocess COM server support will not work when the client
+process already has Python loaded. It would be rather tricky to
+non-obtrusively hook into an already running Python, but the show-stopper is
+that the Python/C API won't let us find out which interpreter instance I should
+hook into. (If this is important to you, you might experiment with using
+apartment threading, which seems the best possibility to get this to work). To
+use a "frozen" COM server from a Python process, you'll have to load it as an
+exe::
+
+      o = win32com.client.Dispatch(progid,
+                       clsctx=pythoncom.CLSCTX_LOCAL_SERVER)
+
+
+MakeCOMServer also assumes that your top level code (registration etc.) is
+"normal". If it's not, you will have to edit the generated script.
+
+|GOBACK|
+
+
+Building Optimized
+------------------
+
+There are two facets to running optimized: gathering ``.pyo``'s, and setting the
+``Py_OptimizeFlag``. Installer will gather ``.pyo``'s if it is run optimized::
+
+       python -O Build.py ...
+
+
+The ``Py_OptimizeFlag`` will be set if you use a ``('O','','OPTION')`` in one of
+the ``TOCs`` building the ``EXE``::
+
+      exe = EXE(pyz,
+                a.scripts + [('O','','OPTION')],
+                ...
+
+See `Spec Files`_ for details.
+
+|GOBACK|
+
+
+A Note on using UPX
+-------------------
+
+On both Windows and Linux, UPX can give truly startling compression - the days
+of fitting something useful on a diskette are not gone forever! Installer has
+been tested with many UPX versions without problems. Just get it and install it
+on your PATH, then rerun configure.
+
+For Windows, there is a problem of compatibility between UPX and executables
+generated by Microsoft Visual Studio .NET 2003 (or the equivalent free
+toolkit available for download). This is especially worrisome for users of
+Python 2.4+, where most extensions (and Python itself) are compiled with that
+compiler. This issue has been fixed in later beta versions of UPX, so you
+will need at least UPX 1.92 beta. `Configure.py`_ will check this for you
+and complain if you have an older version of UPX and you are using Python 2.4.
+
+.. sidebar:: UPX and Unix
+
+    Under UNIX, old versions of UPX were not able to expand and execute the
+    executable in memory, and they were extracting it into a temporary file
+    in the filesystem, before spawning it. This is no longer valid under Linux,
+    but the information in this paragraph still needs to be updated.
+
+.. _`Configure.py`: `Configuring your PyInstaller setup`_
+
+For Linux, a bit more discussion is in order. First, UPX is only useful on
+executables, not shared libs. Installer accounts for that, but to get the full
+benefit, you might rebuild Python with more things statically linked.
+
+More importantly, when ``run`` finds that its ``sys.argv[0]`` does not contain a path,
+it will use ``/proc/pid/exe`` to find itself (if it can). This happens, for
+example, when executed by Apache. If it has been upx-ed, this symbolic link
+points to the tempfile created by the upx stub and |PyInstaller| will fail (please
+see the UPX docs for more information). So for now, at least, you can't use upx
+for CGI's executed by Apache. Otherwise, you can ignore the warnings in the UPX
+docs, since what PyInstaller opens is the executable Installer created, not the
+temporary upx-created executable.
+
+|GOBACK|
+
+A Note on ``--onefile``
+-----------------------
+
+A ``--onefile`` works by packing all the shared libs / dlls into the archive
+attached to the bootloader executable (or next to the executable in a non-elf
+configuration). When first started, it finds that it needs to extract these
+files before it can run "for real". That's because locating and loading a
+shared lib or linked-in dll is a system level action, not user-level. With
+|PyInstallerVersion| it always uses a temporary directory (``_MEIpid``) in the
+user's temp directory. It then executes itself again, setting things up so
+the system will be able to load the shared libs / dlls. When executing is
+complete, it recursively removes the entire directory it created.
+
+This has a number of implications:
+
+* You can run multiple copies - they won't collide.
+
+* Running multiple copies will be rather expensive to the system (nothing is
+  shared).
+
+* If you're using the cheat of adding user data as ``'BINARY'``, it will be in
+  ``os.environ['_MEIPASS2']``, not in the executable's directory.
+
+* On Windows, using Task Manager to kill the parent process will leave the
+  directory behind.
+
+* On \*nix, a kill -9 (or crash) will leave the directory behind.
+
+* Otherwise, on both platforms, the directory will be recursively deleted.
+
+* So any files you might create in ``os.environ['_MEIPASS2']`` will be deleted.
+
+* The executable can be in a protected or read-only directory.
+
+* If for some reason, the ``_MEIpid`` directory already exists, the executable
+  will fail. It is created mode 0700, so only the one user can modify it
+  (on \*nix, of course).
+
+While we are not a security expert, we believe the scheme is good enough for
+most of the users.
+
+**Notes for \*nix users**: Take notice that if the executable does a setuid root,
+a determined hacker could possibly (given enough tries) introduce a malicious
+lookalike of one of the shared libraries during the hole between when the
+library is extracted and when it gets loaded by the execvp'd process. So maybe
+you shouldn't do setuid root programs using ``--onefile``. **In fact, we do not
+recomend the use of --onefile on setuid programs.**
+
+|GOBACK|
+
+A Note on .egg files and setuptools
+-----------------------------------
+`setuptools`_ is a distutils extensions which provide many benefits, including
+the ability to distribute the extension as ``egg`` files. Together with the
+nifty `easy_install`_ (a tool which automatically locates, downloads and
+installs Python extensions), ``egg`` files are becoming more and more
+widespread as a way for distributing Python extensions.
+
+``egg`` files are actually ZIP files under the hood, and they rely on the fact
+that Python 2.4 is able to transparently import modules stored within ZIP
+files. PyInstaller is currently *not* able to import and extract modules
+within ZIP files, so code which uses extensions packaged as ``egg`` files
+cannot be packaged with PyInstaller.
+
+The workaround is pretty easy: you can use ``easy_install -Z`` at installation
+time to ask ``easy_install`` to always decompress egg files. This will allow
+PyInstaller to see the files and make the package correctly. If you have already
+installed the modules, you can simply decompress them within a directory with
+the same name of the ``egg`` file (including also the extension).
+
+Support for ``egg`` files is planned for a future release of PyInstaller.
+
+.. _`setuptools`: http://peak.telecommunity.com/DevCenter/setuptools
+.. _`easy_install`: http://peak.telecommunity.com/DevCenter/EasyInstall
+
+
+|GOBACK|
+
+
+PyInstaller Utilities
++++++++++++++++++++++
+
+ArchiveViewer
+-------------
+
+::
+
+      python ArchiveViewer.py <archivefile>
+
+
+ArchiveViewer lets you examine the contents of any archive build with
+|PyInstaller| or executable (PYZ, PKG or exe). Invoke it with the target as the
+first arg (It has been set up as a Send-To so it shows on the context menu in
+Explorer). The archive can be navigated using these commands:
+
+O <nm>
+    Open the embedded archive <nm> (will prompt if omitted).
+
+U
+    Go up one level (go back to viewing the embedding archive).
+
+X <nm>
+    Extract nm (will prompt if omitted). Prompts for output filename. If none
+    given, extracted to stdout.
+
+Q
+    Quit.
+
+
+|GOBACK|
+
+
+bindepend
+---------
+
+::
+
+    python bindepend.py <executable_or_dynamic_library>
+
+bindepend will analyze the executable you pass to it, and write to stdout all
+its binary dependencies. This is handy to find out which DLLs are required by
+an executable or another DLL. This module is used by |PyInstaller| itself to
+follow the chain of dependencies of binary extensions and make sure that all
+of them get included in the final package.
+
+
+GrabVersion (Windows)
+---------------------
+
+::
+
+      python GrabVersion.py <executable_with_version_resource>
+
+
+GrabVersion outputs text which can be eval'ed by ``versionInfo.py`` to reproduce
+a version resource. Invoke it with the full path name of a Windows executable
+(with a version resource) as the first argument. If you cut & paste (or
+redirect to a file), you can then edit the version information. The edited
+text file can be used in a ``version = myversion.txt`` option on any executable
+in an |PyInstaller| spec file.
+
+This was done in this way because version resources are rather strange beasts,
+and fully understanding them is probably impossible. Some elements are
+optional, others required, but you could spend unbounded amounts of time
+figuring this out, because it's not well documented. When you view the version
+tab on a properties dialog, there's no straightforward relationship between
+how the data is displayed and the structure of the resource itself. So the
+easiest thing to do is find an executable that displays the kind of
+information you want, grab it's resource and edit it. Certainly easier than
+the Version resource wizard in VC++.
+
+|GOBACK|
+
+
+Analyzing Dependencies
+----------------------
+
+You can interactively track down dependencies, including getting
+cross-references by using ``mf.py``, documented in section `mf.py: A modulefinder
+Replacement`_
+
+|GOBACK|
+
+
+Spec Files
+++++++++++
+
+Introduction
+------------
+
+Spec files are in Python syntax. They are evaluated by Build.py. A simplistic
+spec file might look like this::
+
+      a = Analysis(['myscript.py'])
+      pyz = PYZ(a.pure)
+      exe = EXE(pyz, a.scripts, a.binaries, name="myapp.exe")
+
+This creates a single file deployment with all binaries (extension modules and
+their dependencies) packed into the executable.
+
+A simplistic single directory deployment might look like this::
+
+      a = Analysis(['myscript.py'])
+      pyz = PYZ(a.pure)
+      exe = EXE(a.scripts, pyz, name="myapp.exe", exclude_binaries=1)
+      dist = COLLECT(exe, a.binaries, name="dist")
+
+
+Note that neither of these examples are realistic. Use ``Makespec.py`` (documented
+in section `Create a spec file for your project`_) to create your specfile,
+and tweak it (if necessary) from there.
+
+All of the classes you see above are subclasses of ``Build.Target``. A Target acts
+like a rule in a makefile. It knows enough to cache its last inputs and
+outputs. If its inputs haven't changed, it can assume its outputs wouldn't
+change on recomputation. So a spec file acts much like a makefile, only
+rebuilding as much as needs rebuilding. This means, for example, that if you
+change an ``EXE`` from ``debug=1`` to ``debug=0``, the rebuild will be nearly
+instantaneous.
+
+The high level view is that an ``Analysis`` takes a list of scripts as input,
+and generates three "outputs", held in attributes named ``scripts``, ``pure``
+and ``binaries``. A ``PYZ`` (a ``.pyz`` archive) is built from the modules in
+pure. The ``EXE`` is built from the ``PYZ``, the scripts and, in the case of a
+single-file deployment, the binaries. In a single-directory deployment, a
+directory is built containing a slim executable and the binaries.
+
+|GOBACK|
+
+TOC Class (Table of Contents)
+-----------------------------
+
+Before you can do much with a spec file, you need to understand the
+``TOC`` (Table Of Contents) class.
+
+A ``TOC`` appears to be a list of tuples of the form (name, path, typecode).
+In fact, it's an ordered set, not a list. A TOC contains no duplicates, where
+uniqueness is based on name only. Furthermore, within this constraint, a TOC
+preserves order.
+
+Besides the normal list methods and operations, TOC supports taking differences
+and intersections (and note that adding or extending is really equivalent to
+union). Furthermore, the operations can take a real list of tuples on the right
+hand side. This makes excluding modules quite easy. For a pure Python module::
+
+      pyz = PYZ(a.pure - [('badmodule', '', '')])
+
+
+or for an extension module in a single-directory deployment::
+
+      dist = COLLECT(..., a.binaries - [('badmodule', '', '')], ...)
+
+
+or for a single-file deployment::
+
+      exe = EXE(..., a.binaries - [('badmodule', '', '')], ...)
+
+To add files to a TOC, you need to know about the typecodes (or the step using
+the TOC won't know what to do with the entry).
+
++---------------+-------------------------------------------------------+-----------------------+-------------------------------+
+| **typecode** 	| **description**					| **name**		| **path**			|
++===============+=======================================================+=======================+===============================+
+| 'EXTENSION' 	| An extension module.					| Python internal name.	| Full path name in build.	|
++---------------+-------------------------------------------------------+-----------------------+-------------------------------+
+| 'PYSOURCE'	| A script.						| Python internal name.	| Full path name in build.	|
++---------------+-------------------------------------------------------+-----------------------+-------------------------------+
+| 'PYMODULE'	| A pure Python module (including __init__ modules).	| Python internal name.	| Full path name in build.	|
++---------------+-------------------------------------------------------+-----------------------+-------------------------------+
+| 'PYZ'		| A .pyz archive (archive_rt.ZlibArchive).		| Runtime name.		| Full path name in build.	|
++---------------+-------------------------------------------------------+-----------------------+-------------------------------+
+| 'PKG'		| A pkg archive (carchive4.CArchive).			| Runtime name. 	| Full path name in build.	|
++---------------+-------------------------------------------------------+-----------------------+-------------------------------+
+| 'BINARY' 	| A shared library. 					| Runtime name. 	| Full path name in build.	|
++---------------+-------------------------------------------------------+-----------------------+-------------------------------+
+| 'DATA' 	| Aribitrary files. 					| Runtime name. 	| Full path name in build.	|
++---------------+-------------------------------------------------------+-----------------------+-------------------------------+
+| 'OPTION' 	| A runtime runtime option (frozen into the executable).| The option.		| Unused.			|
++---------------+-------------------------------------------------------+-----------------------+-------------------------------+
+
+You can force the include of any file in much the same way you do excludes::
+
+      collect = COLLECT(a.binaries +
+                [('readme', '/my/project/readme', 'DATA')], ...)
+
+
+or even::
+
+      collect = COLLECT(a.binaries,
+                [('readme', '/my/project/readme', 'DATA')], ...)
+
+
+(that is, you can use a list of tuples in place of a ``TOC`` in most cases).
+
+There's not much reason to use this technique for ``PYSOURCE``, since an ``Analysis``
+takes a list of scripts as input. For ``PYMODULEs`` and ``EXTENSIONs``, the hook
+mechanism discussed here is better because you won't have to remember how you
+got it working next time.
+
+This technique is most useful for data files (see the ``Tree`` class below for a
+way to build a ``TOC`` from a directory tree), and for runtime options. The options
+the run executables understand are:
+
++---------------+-----------------------+-------------------------------+-------------------------------------------------------------------------------------------------------+
+| **Option**	| **Description**	| **Example**			| **Notes**												|
++===============+=======================+===============================+=======================================================================================================+
+| v 		| Verbose imports	| ('v', '', 'OPTION')		| Same as Python -v ... 										|
++---------------+-----------------------+-------------------------------+-------------------------------------------------------------------------------------------------------+
+| u		| Unbuffered stdio	| ('u', '', 'OPTION')		| Same as Python -u ... 										|
++---------------+-----------------------+-------------------------------+-------------------------------------------------------------------------------------------------------+
+| W spec	| Warning option	| ('W ignore', '', 'OPTION')	| Python 2.1+ only. 											|
++---------------+-----------------------+-------------------------------+-------------------------------------------------------------------------------------------------------+
+| s		| Use site.py		| ('s', '', 'OPTION')		| The opposite of Python's -S flag. Note that site.py must be in the executable's directory to be used. |
++---------------+-----------------------+-------------------------------+-------------------------------------------------------------------------------------------------------+
+| f		| Force execvp		| ('f', '', 'OPTION')		| Linux/unix only. Ensures that LD_LIBRARY_PATH is set properly.					|
++---------------+-----------------------+-------------------------------+-------------------------------------------------------------------------------------------------------+
+
+Advanced users should note that by using set differences and intersections, it
+becomes possible to factor out common modules, and deploy a project containing
+multiple executables with minimal redundancy. You'll need some top level code
+in each executable to mount the common ``PYZ``.
+
+|GOBACK|
+
+Target Subclasses
+-----------------
+
+Analysis
+********
+
+::
+
+      Analysis(scripts, pathex=None, hookspath=None, excludes=None)
+
+
+``scripts``
+    a list of scripts specified as file names.
+
+``pathex``
+    an optional list of paths to be searched before sys.path.
+
+``hookspath``
+    an optional list of paths used to extend the hooks package.
+
+``excludes``
+    an optional list of module or package names (their Python names, not path
+    names) that will be ignored (as though they were not found).
+
+An Analysis has three outputs, all ``TOCs`` accessed as attributes of the ``Analysis``.
+
+``scripts``
+    The scripts you gave Analysis as input, with any runtime hook scripts
+    prepended.
+
+``pure``
+    The pure Python modules.
+
+``binaries``
+    The extension modules and their dependencies. The secondary dependencies are
+    filtered. On Windows, a long list of MS dlls are excluded. On Linux/Unix,
+    any shared lib in ``/lib`` or ``/usr/lib`` is excluded.
+
+|GOBACK|
+
+PYZ
+***
+
+::
+
+      PYZ(toc, name=None, level=9)
+
+
+``toc``
+    a ``TOC``, normally an ``Analysis.pure``.
+
+``name``
+    A filename for the ``.pyz``. Normally not needed, as the generated name will do fine.
+
+``level``
+    The Zlib compression level to use. If 0, the zlib module is not required.
+
+
+|GOBACK|
+
+PKG
+***
+
+Generally, you will not need to create your own ``PKGs``, as the ``EXE`` will do it for
+you. This is one way to include read-only data in a single-file deployment,
+however. A single-file deployment including TK support will use this technique.
+
+::
+
+      PKG(toc, name=None, cdict=None, exclude_binaries=0)
+
+
+``toc``
+    a ``TOC``.
+
+``name``
+    a filename for the ``PKG`` (optional).
+
+``cdict``
+    a dictionary that specifies compression by typecode. For example, ``PYZ`` is
+    left uncompressed so that it can be accessed inside the ``PKG``. The default
+    uses sensible values. If zlib is not available, no compression is used.
+
+``exclude_binaries``
+    If 1, ``EXTENSIONs`` and ``BINARYs`` will be left out of the ``PKG``, and
+    forwarded to its container (usually a ``COLLECT``).
+
+|GOBACK|
+
+EXE
+***
+
+::
+
+      EXE(*args, **kws)
+
+
+``args``
+    One or more arguments which are either ``TOCs`` or ``Targets``.
+
+``kws``
+    Possible keyword arguments:
+
+    ``console``
+        Always 1 on Linux/unix. On Windows, governs whether to use the console
+        executable, or the Windows subsystem executable.
+
+    ``debug``
+        Setting to 1 gives you progress messages from the executable (for a
+        ``console=0``, these will be annoying MessageBoxes).
+
+    ``name``
+        The filename for the executable.
+
+    ``exclude_binaries``
+        Forwarded to the ``PKG`` the ``EXE`` builds.
+
+    ``icon``
+        Windows NT family only. ``icon='myicon.ico'`` to use an icon file, or
+        ``icon='notepad.exe,0'`` to grab an icon resource.
+
+    ``version``
+        Windows NT family only. ``version='myversion.txt'``. Use ``GrabVersion.py`` to
+        steal a version resource from an executable, and then edit the ouput to
+        create your own. (The syntax of version resources is so arcane that I
+        wouldn't attempt to write one from scratch.)
+
+
+There are actually two ``EXE`` classes - one for ELF platforms (where the
+bootloader, that is the ``run`` executable, and the ``PKG`` are concatenated),
+and one for non-ELF platforms (where the run executable is simply renamed, and
+expects a ``exename.pkg`` in the same directory). Which class becomes available
+as ``EXE`` is determined by a flag in ``config.dat``. This flag is set to
+non-ELF when using ``Make.py -n``.
+
+|GOBACK|
+
+DLL
+***
+
+On Windows, this provides support for doing in-process COM servers. It is not
+generalized. However, embedders can follow the same model to build a special
+purpose DLL so the Python support in their app is hidden. You will need to
+write your own dll, but thanks to Allan Green for refactoring the C code and
+making that a managable task.
+
+|GOBACK|
+
+COLLECT
+*******
+
+::
+
+      COLLECT(*args, **kws)
+
+
+``args``
+    One or more arguments which are either ``TOCs`` or ``Targets``.
+
+``kws``
+    Possible keyword arguments:
+
+    ``name``
+        The name of the directory to be built.
+
+|GOBACK|
+
+Tree
+****
+
+::
+
+      Tree(root, prefix=None, excludes=None)
+
+
+``root``
+    The root of the tree (on the build system).
+
+``prefix``
+    Optional prefix to the names on the target system.
+
+``excludes``
+    A list of names to exclude. Two forms are allowed:
+
+    ``name``
+        files with this basename will be excluded (do not include the path).
+
+    ``*.ext``
+        any file with the given extension will be excluded.
+
+Since a ``Tree`` is a ``TOC``, you can also use the exclude technique described above
+in the section on ``TOCs``.
+
+
+|GOBACK|
+
+When Things Go Wrong
+++++++++++++++++++++
+
+Finding out What Went Wrong
+---------------------------
+
+Buildtime Warnings
+******************
+
+When an ``Analysis`` step runs, it produces a warnings file (named ``warnproject.txt``)
+in the spec file's directory. Generally, most of these warnings are harmless.
+For example, ``os.py`` (which is cross-platform) works by figuring out what
+platform it is on, then importing (and rebinding names from) the appropriate
+platform-specific module. So analyzing ``os.py`` will produce a set of warnings
+like::
+
+      W: no module named dos (conditional import by os)
+      W: no module named ce (conditional import by os)
+      W: no module named os2 (conditional import by os)
+
+
+Note that the analysis has detected that the import is within a conditional
+block (an if statement). The analysis also detects if an import within a
+function or class, (delayed) or at the top level. A top-level, non-conditional
+import failure is really a hard error. There's at least a reasonable chance
+that conditional and / or delayed import will be handled gracefully at runtime.
+
+Ignorable warnings may also be produced when a class or function is declared in
+a package (an ``__init__.py`` module), and the import specifies
+``package.name``. In this case, the analysis can't tell if name is supposed to
+refer to a submodule of package.
+
+Warnings are also produced when an ``__import__``, ``exec`` or ``eval`` statement is
+encountered. The ``__import__`` warnings should almost certainly be investigated.
+Both ``exec`` and ``eval`` can be used to implement import hacks, but usually their use
+is more benign.
+
+Any problem detected here can be handled by hooking the analysis of the module.
+See `Listing Hidden Imports`_ below for how to do it.
+
+|GOBACK|
+
+Getting Debug Messages
+**********************
+
+Setting ``debug=1`` on an ``EXE`` will cause the executable to put out progress
+messages (for console apps, these go to stdout; for Windows apps, these show as
+MessageBoxes). This can be useful if you are doing complex packaging, or your
+app doesn't seem to be starting, or just to learn how the runtime works.
+
+|GOBACK|
+
+Getting Python's Verbose Imports
+********************************
+
+You can also pass a ``-v`` (verbose imports) flag to the embedded Python. This can
+be extremely useful. I usually try it even on apparently working apps, just to
+make sure that I'm always getting my copies of the modules and no import has
+leaked out to the installed Python.
+
+You set this (like the other runtime options) by feeding a phone ``TOC`` entry to
+the ``EXE``. The easiest way to do this is to change the ``EXE`` from::
+
+       EXE(..., anal.scripts, ....)
+
+to::
+
+       EXE(..., anal.scripts + [('v', '', 'OPTION')], ...)
+
+These messages will always go to ``stdout``, so you won't see them on Windows if
+``console=0``.
+
+|GOBACK|
+
+Helping Installer Find Modules
+------------------------------
+
+Extending the Path
+******************
+
+When the analysis phase cannot find needed modules, it may be that the code is
+manipulating ``sys.path``. The easiest thing to do in this case is tell ``Analysis``
+about the new directory through the second arg to the constructor::
+
+       anal = Analysis(['somedir/myscript.py'],
+                       ['path/to/thisdir', 'path/to/thatdir'])
+
+
+In this case, the ``Analysis`` will have a search path::
+
+       ['somedir', 'path/to/thisdir', 'path/to/thatdir'] + sys.path
+
+
+You can do the same when running ``Makespec.py``::
+
+       Makespec.py --paths=path/to/thisdir;path/to/thatdir ...
+
+
+(on \*nix, use ``:`` as the path separator).
+
+|GOBACK|
+
+Listing Hidden Imports
+**********************
+
+Hidden imports are fairly common. These can occur when the code is using
+``__import__`` (or, perhaps ``exec`` or ``eval``), in which case you will see a warning in
+the ``warnproject.txt`` file. They can also occur when an extension module uses the
+Python/C API to do an import, in which case Analysis can't detect anything. You
+can verify that hidden import is the problem by using Python's verbose imports
+flag. If the import messages say "module not found", but the ``warnproject.txt``
+file has no "no module named..." message for the same module, then the problem
+is a hidden import.
+
+.. sidebar:: Standard hidden imports are already included!
+
+    If you are getting worried while reading this paragraph, do not worry:
+    having hidden imports is the exception, not the norm! And anyway,
+    PyInstaller already ships with a large set of hooks that take care of
+    hidden imports for the most common packages out there. For instance,
+    PIL_, PyWin32_, PyQt_ are already taken care of.
+
+Hidden imports are handled by hooking the module (the one doing the hidden
+imports) at ``Analysis`` time. Do this by creating a file named ``hook-module.py``
+(where module is the fully-qualified Python name, eg, ``hook-xml.dom.py``), and
+placing it in the ``hooks`` package under |PyInstaller|'s root directory,
+(alternatively, you can save it elsewhere, and then use the ``hookspath`` arg to
+``Analysis`` so your private hooks directory will be searched). Normally, it will
+have only one line::
+
+      hiddenimports = ['module1', 'module2']
+
+When the ``Analysis`` finds this file, it will proceed exactly as though the module
+explicitly imported ``module1`` and ``module2``. (Full details on the analysis-time
+hook mechanism is in the `Hooks`_ section).
+
+If you successfully hook a publicly distributed module in this way, please send
+us the hook so we can make it available to others.
+
+|GOBACK|
+
+Extending a Package's ``__path__``
+**********************************
+
+Python allows a package to extend the search path used to find modules and
+sub-packages through the ``__path__`` mechanism. Normally, a package's ``__path__`` has
+only one entry - the directory in which the ``__init__.py`` was found. But
+``__init__.py`` is free to extend its ``__path__`` to include other directories. For
+example, the ``win32com.shell.shell`` module actually resolves to
+``win32com/win32comext/shell/shell.pyd``. This is because ``win32com/__init__.py``
+appends ``../win32comext`` to its ``__path__``.
+
+Because the ``__init__.py`` is not actually run during an analysis, we use the same
+hook mechanism we use for hidden imports. A static list of names won't do,
+however, because the new entry on ``__path__`` may well require computation. So
+``hook-module.py`` should define a method ``hook(mod)``. The mod argument is an
+instance of ``mf.Module`` which has (more or less) the same attributes as a real
+module object. The hook function should return a ``mf.Module`` instance - perhaps
+a brand new one, but more likely the same one used as an arg, but mutated.
+See `mf.py: A Modulefinder Replacement`_ for details, and `hooks\/hook-win32com.py`_
+for an example.
+
+Note that manipulations of ``__path__`` hooked in this way apply to the analysis,
+and only the analysis. That is, at runtime ``win32com.shell`` is resolved the same
+way as ``win32com.anythingelse``, and ``win32com.__path__`` knows nothing of ``../win32comext``.
+
+Once in awhile, that's not enough.
+
+|GOBACK|
+
+Changing Runtime Behavior
+*************************
+
+More bizarre situations can be accomodated with runtime hooks. These are small
+scripts that manipulate the environment before your main script runs,
+effectively providing additional top-level code to your script.
+
+At the tail end of an analysis, the module list is examined for matches in
+``rthooks.dat``, which is the string representation of a Python dictionary. The
+key is the module name, and the value is a list of hook-script pathnames.
+
+So putting an entry::
+
+       'somemodule': ['path/to/somescript.py'],
+
+into ``rthooks.dat`` is almost the same thing as doing this::
+
+       anal = Analysis(['path/to/somescript.py', 'main.py'], ...
+
+
+except that in using the hook, ``path/to/somescript.py`` will not be analyzed,
+(that's not a feature - we just haven't found a sane way fit the recursion into
+my persistence scheme).
+
+Hooks done in this way, while they need to be careful of what they import, are
+free to do almost anything. One provided hook sets things up so that win32com
+can generate modules at runtime (to disk), and the generated modules can be
+found in the win32com package.
+
+|GOBACK|
+
+Adapting to being "frozen"
+**************************
+
+In most sophisticated apps, it becomes necessary to figure out (at runtime)
+whether you're running "live" or "frozen". For example, you might have a
+configuration file that (running "live") you locate based on a module's
+``__file__`` attribute. That won't work once the code is packaged up. You'll
+probably want to look for it based on ``sys.executable`` instead.
+
+The bootloaders set ``sys.frozen=1`` (and, for in-process COM servers, the
+embedding DLL sets ``sys.frozen='dll'``).
+
+For really advanced users, you can access the ``iu.ImportManager`` as
+``sys.importManager``. See `iu.py`_ for how you might make use of this fact.
+
+|GOBACK|
+
+Accessing Data Files
+********************
+
+In a ``--onedir`` distribution, this is easy: pass a list of your data files
+(in ``TOC`` format) to the ``COLLECT``, and they will show up in the distribution
+directory tree. The name in the ``(name, path, 'DATA')`` tuple can be a relative
+path name. Then, at runtime, you can use code like this to find the file::
+
+       os.path.join(os.path.dirname(sys.executable), relativename))
+
+
+In a ``--onefile``, it's a bit trickier. You can cheat, and add the files to the
+``EXE`` as ``BINARY``. They will then be extracted at runtime into the work directory
+by the C code (which does not create directories, so the name must be a plain
+name), and cleaned up on exit. The work directory is best found by
+``os.environ['_MEIPASS2']``. Be awawre, though, that if you use ``--strip`` or ``--upx``,
+strange things may happen to your data - ``BINARY`` is really for shared
+libs / dlls.
+
+If you add them as ``'DATA'`` to the ``EXE``, then it's up to you to extract them. Use
+code like this::
+
+       import sys, carchive
+       this = carchive.CArchive(sys.executable)
+       data = this.extract('mystuff')[1]
+
+
+to get the contents as a binary string. See `support\/unpackTK.py`_ for an advanced
+example (the TCL and TK lib files are in a PKG which is opened in place, and
+then extracted to the filesystem).
+
+|GOBACK|
+
+Miscellaneous
++++++++++++++
+
+Pmw -- Python Mega Widgets
+--------------------------
+
+`Pmw`_ comes with a script named ``bundlepmw`` in the bin directory. If you follow the
+instructions in that script, you'll end up with a module named ``Pmw.py``. Ensure
+that Builder finds that module and not the development package.
+
+|GOBACK|
+
+Win9xpopen
+----------
+
+If you're using popen on Windows and want the code to work on Win9x, you'll
+need to distribute ``win9xpopen.exe`` with your app. On older Pythons with
+Win32all, this would apply to Win32pipe and ``win32popenWin9x.exe``. (On yet older
+Pythons, no form of popen worked on Win9x).
+
+|GOBACK|
+
+Self-extracting executables
+---------------------------
+
+The ELF executable format (Windows, Linux and some others) allows arbitrary
+data to be concatenated to the end of the executable without disturbing its
+functionality. For this reason, a ``CArchive``'s Table of Contents is at the end of
+the archive. The executable can open itself as a binary file name, seek to the
+end and 'open' the ``CArchive`` (see figure 3).
+
+On other platforms, the archive and the executable are separate, but the
+archive is named ``executable.pkg``, and expected to be in the same directory.
+Other than that, the process is the same.
+
+|GOBACK|
+
+One Pass Execution
+******************
+
+In a single directory deployment (``--onedir``, which is the default), all of the
+binaries are already in the file system. In that case, the embedding app:
+
+* opens the archive
+
+* starts Python (on Windows, this is done with dynamic loading so one embedding
+  app binary can be used with any Python version)
+
+* imports all the modules which are at the top level of the archive (basically,
+  bootstraps the import hooks)
+
+* mounts the ``ZlibArchive(s)`` in the outer archive
+
+* runs all the scripts which are at the top level of the archive
+
+* finalizes Python
+
+|GOBACK|
+
+Two Pass Execution
+******************
+
+There are a couple situations which require two passes:
+
+* a ``--onefile`` deployment (on Windows, the files can't be cleaned up afterwards
+  because Python does not call ``FreeLibrary``; on other platforms, Python won't
+  find them if they're extracted in the same process that uses them)
+
+* ``LD_LIBRARY_PATH`` needs to be set to find the binaries (not extension modules,
+  but modules the extensions are linked to).
+
+The first pass:
+
+* opens the archive
+
+* extracts all the binaries in the archive (in |PyInstallerVersion|, this is always to a
+  temporary directory).
+
+* sets a magic environment variable
+
+* sets ``LD_LIBRARY_PATH`` (non-Windows)
+
+* executes itself as a child process (letting the child use his stdin, stdout
+  and stderr)
+
+* waits for the child to exit (on \*nix, the child actually replaces the parent)
+
+* cleans up the extracted binaries (so on \*nix, this is done by the child)
+
+The child process executes as in `One Pass Execution`_ above (the magic
+environment variable is what tells it that this is pass two).
+
+|SE_exeImage| figure 3 - Self Extracting Executable
+
+There are, of course, quite a few differences between the Windows and
+Unix/Linux versions. The major one is that because all of Python on Windows is
+in ``pythonXX.dll``, and dynamic loading is so simple-minded, that one binary can
+be use with any version of Python. There's much in common, though, and that C
+code can be found in `source/common/launch.c`_.
+
+The Unix/Linux build process (which you need to run just once for any version
+of Python) makes use of the config information in your install (if you
+installed from RPM, you need the Python-development RPM). It also overrides
+``getpath.c`` since we don't want it hunting around the filesystem to build
+``sys.path``.
+
+In both cases, while one |PyInstaller| download can be used with any Python
+version, you need to have separate installations for each Python version.
+
+|GOBACK|
+
+PyInstaller Archives
+++++++++++++++++++++
+
+Archives Introduction
+---------------------
+You know what an archive is: a ``.tar`` file, a ``.jar`` file, a ``.zip`` file. Two kinds
+of archives are used here. One is equivalent to a Java ``.jar`` file - it allows
+Python modules to be stored efficiently and, (with some import hooks) imported
+directly. This is a ``ZlibArchive``. The other (a ``CArchive``) is equivalent to a
+``.zip`` file - a general way of packing up (and optionally compressing) arbitrary
+blobs of data. It gets its name from the fact that it can be manipulated easily
+from C, as well as from Python. Both of these derive from a common base class,
+making it fairly easy to create new kinds of archives.
+
+|GOBACK|
+
+``ZlibArchive``
+---------------
+A ``ZlibArchive`` contains compressed ``.pyc`` (or ``.pyo``) files. The Table of Contents
+is a marshalled dictionary, with the key (the module's name as given in an
+``import`` statement) associated with a seek position and length. Because it is
+all marshalled Python, ``ZlibArchives`` are completely cross-platform.
+
+A ``ZlibArchive`` hooks in with `iu.py`_ so that, with a little setup, the archived
+modules can be imported transparently. Even with compression at level 9, this
+works out to being faster than the normal import. Instead of searching
+``sys.path``, there's a lookup in the dictionary. There's no ``stat``-ing of the ``.py``
+and ``.pyc`` and no file opens (the file is already open). There's just a seek, a
+read and a decompress. A traceback will point to the source file the archive
+entry was created from (the ``__file__`` attribute from the time the ``.pyc`` was
+compiled). On a user's box with no source installed, this is not terribly
+useful, but if they send you the traceback, at least you can make sense of it.
+
+|ZlibArchiveImage|
+
+|GOBACK|
+
+``CArchive``
+------------
+A ``CArchive`` contains whatever you want to stuff into it. It's very much like a
+``.zip`` file. They are easy to create in Python and unpack from C code. ``CArchives``
+can be appended to other files (like ELF and COFF executables, for example).
+To allow this, they are opened from the end, so the ``TOC`` for a ``CArchive`` is at
+the back, followed only by a cookie that tells you where the ``TOC`` starts and
+where the archive itself starts.
+
+``CArchives`` can also be embedded within other ``CArchives``. The inner archive can be
+opened in place (without extraction).
+
+Each ``TOC`` entry is variable length. The first field in the entry tells you the
+length of the entry. The last field is the name of the corresponding packed
+file. The name is null terminated. Compression is optional by member.
+
+There is also a type code associated with each entry. If you're using a
+``CArchive`` as a ``.zip`` file, you don't need to worry about this. The type codes
+are used by the self-extracting executables.
+
+|CArchiveImage|
+
+|GOBACK|
+
+
+License
++++++++
+PyInstaller is mainly distributed  under the
+`GPL License <http://pyinstaller.hpcf.upr.edu/pyinstaller/browser/trunk/doc/LICENSE.GPL?rev=latest>`_
+but it has an exception such that you can use it to compile commercial products.
+
+In a nutshell, the license is GPL for the source code with the exception that:
+
+ #. You may use PyInstaller to compile commercial applications out of your
+    source code.
+
+ #. The resulting binaries generated by PyInstaller from your source code can be
+    shipped with whatever license you want.
+
+ #. You may modify PyInstaller for your own needs but *these* changes to the
+    PyInstaller source code falls under the terms of the GPL license. In other
+    words, any modifications to will *have* to be distributed under GPL.
+
+For updated information or clarification see our
+`FAQ <http://pyinstaller.hpcf.upr.edu/pyinstaller/wiki/FAQ>`_ at `PyInstaller`_
+home page: http://pyinstaller.hpcf.upr.edu
+
+
+
+|GOBACK|
+
+Appendix
+++++++++
+
+.. sidebar:: You can stop reading here...
+
+    ... if you are not interested in technical details. This appendix contains
+    insights of the internal workings of |PyInstaller|, and you do not need this
+    information unless you plan to work on |PyInstaller| itself.
+
+
+``mf.py``: A Modulefinder Replacement
+-------------------------------------
+
+Module ``mf`` is modelled after ``iu``.
+
+It also uses ``ImportDirectors`` and ``Owners`` to partition the import name space.
+Except for the fact that these return ``Module`` instances instead of real module
+objects, they are identical.
+
+Instead of an ``ImportManager``, ``mf`` has an ``ImportTracker`` managing things.
+
+|GOBACK|
+
+ImportTracker
+*************
+
+``ImportTracker`` can be called in two ways: ``analyze_one(name, importername=None)``
+or ``analyze_r(name, importername=None)``. The second method does what modulefinder
+does - it recursively finds all the module names that importing name would
+cause to appear in ``sys.modules``. The first method is non-recursive. This is
+useful, because it is the only way of answering the question "Who imports
+name?" But since it is somewhat unrealistic (very few real imports do not
+involve recursion), it deserves some explanation.
+
+|GOBACK|
+
+``analyze_one()``
+*****************
+
+When a name is imported, there are structural and dynamic effects. The dynamic
+effects are due to the execution of the top-level code in the module (or
+modules) that get imported. The structural effects have to do with whether the
+import is relative or absolute, and whether the name is a dotted name (if there
+are N dots in the name, then N+1 modules will be imported even without any code
+running).
+
+The analyze_one method determines the structural effects, and defers the
+dynamic effects. For example, ``analyze_one("B.C", "A")`` could return ``["B", "B.C"]``
+or ``["A.B", "A.B.C"]`` depending on whether the import turns out to be relative or
+absolute. In addition, ImportTracker's modules dict will have Module instances
+for them.
+
+|GOBACK|
+
+Module Classes
+**************
+
+There are Module subclasses for builtins, extensions, packages and (normal)
+modules. Besides the normal module object attributes, they have an attribute
+imports. For packages and normal modules, imports is a list populated by
+scanning the code object (and therefor, the names in this list may be relative
+or absolute names - we don't know until they have been analyzed).
+
+The highly astute will notice that there is a hole in ``analyze_one()`` here. The
+first thing that happens when ``B.C`` is being imported is that ``B`` is imported and
+it's top-level code executed. That top-level code can do various things so that
+when the import of ``B.C`` finally occurs, something completely different happens
+(from what a structural analysis would predict). But mf can handle this through
+it's hooks mechanism.
+
+|GOBACK|
+
+code scanning
+*************
+
+Like modulefinder, ``mf`` scans the byte code of a module, looking for imports. In
+addition, ``mf`` will pick out a module's ``__all__`` attribute, if it is built as a
+list of constant names. This means that if a package declares an ``__all__`` list
+as a list of names, ImportTracker will track those names if asked to analyze
+``package.*``. The code scan also notes the occurance of ``__import__``, ``exec`` and ``eval``,
+and can issue warnings when they're found.
+
+The code scanning also keeps track (as well as it can) of the context of an
+import. It recognizes when imports are found at the top-level, and when they
+are found inside definitions (deferred imports). Within that, it also tracks
+whether the import is inside a condition (conditional imports).
+
+|GOBACK|
+
+Hooks
+*****
+
+In modulefinder, scanning the code takes the place of executing the code
+object. ``mf`` goes further and allows a module to be hooked (after it has been
+scanned, but before analyze_one is done with it). A hook is a module named
+``hook-fullyqualifiedname`` in the ``hooks`` package. These modules should have one or
+more of the following three global names defined:
+
+``hiddenimports``
+    a list of modules names (relative or absolute) that the module imports in some untrackable way.
+
+``attrs``
+    a list of ``(name, value)`` pairs (where value is normally meaningless).
+
+``hook(mod)``
+    a function taking a ``Module`` instance and returning a ``Module`` instance (so it can modify or replace).
+
+
+The first hook (``hiddenimports``) extends the list created by scanning the code.
+``ExtensionModules``, of course, don't get scanned, so this is the only way of
+recording any imports they do.
+
+The second hook (``attrs``) exists mainly so that ImportTracker won't issue
+spurious warnings when the rightmost node in a dotted name turns out to be an
+attribute in a package module, instead of a missing submodule.
+
+The callable hook exists for things like dynamic modification of a package's
+``__path__`` or perverse situations, like ``xml.__init__`` replacing itself in
+``sys.modules`` with ``_xmlplus.__init__``. (It takes nine hook modules to properly
+trace through PyXML-using code, and I can't believe that it's any easier for
+the poor programmer using that package). The ``hook(mod)`` (if it exists) is
+called before looking at the others - that way it can, for example, test
+``sys.version`` and adjust what's in ``hiddenimports``.
+
+|GOBACK|
+
+Warnings
+********
+
+``ImportTracker`` has a ``getwarnings()`` method that returns all the warnings
+accumulated by the instance, and by the ``Module`` instances in its modules dict.
+Generally, it is ``ImportTracker`` who will accumulate the warnings generated
+during the structural phase, and ``Modules`` that will get the warnings generated
+during the code scan.
+
+Note that by using a hook module, you can silence some particularly tiresome
+warnings, but not all of them.
+
+|GOBACK|
+
+Cross Reference
+***************
+
+Once a full analysis (that is, an ``analyze_r`` call) has been done, you can get a
+cross reference by using ``getxref()``. This returns a list of tuples. Each tuple
+is ``(modulename, importers)``, where importers is a list of the (fully qualified)
+names of the modules importing ``modulename``. Both the returned list and the
+importers list are sorted.
+
+|GOBACK|
+
+Usage
+*****
+
+A simple example follows:
+
+      >>> import mf
+      >>> a = mf.ImportTracker()
+      >>> a.analyze_r("os")
+      ['os', 'sys', 'posixpath', 'nt', 'stat', 'string', 'strop',
+      're', 'pcre', 'ntpath', 'dospath', 'macpath', 'win32api',
+      'UserDict', 'copy', 'types', 'repr', 'tempfile']
+      >>> a.analyze_one("os")
+      ['os']
+      >>> a.modules['string'].imports
+      [('strop', 0, 0), ('strop.*', 0, 0), ('re', 1, 1)]
+      >>>
+
+
+The tuples in the imports list are (name, delayed, conditional).
+
+      >>> for w in a.modules['string'].warnings: print w
+      ...
+      W: delayed  eval hack detected at line 359
+      W: delayed  eval hack detected at line 389
+      W: delayed  eval hack detected at line 418
+      >>> for w in a.getwarnings(): print w
+      ...
+      W: no module named pwd (delayed, conditional import by posixpath)
+      W: no module named dos (conditional import by os)
+      W: no module named os2 (conditional import by os)
+      W: no module named posix (conditional import by os)
+      W: no module named mac (conditional import by os)
+      W: no module named MACFS (delayed, conditional import by tempfile)
+      W: no module named macfs (delayed, conditional import by tempfile)
+      W: top-level conditional exec statment detected at line 47
+         - os (C:\Program Files\Python\Lib\os.py)
+      W: delayed  eval hack detected at line 359
+         - string (C:\Program Files\Python\Lib\string.py)
+      W: delayed  eval hack detected at line 389
+         - string (C:\Program Files\Python\Lib\string.py)
+      W: delayed  eval hack detected at line 418
+         - string (C:\Program Files\Python\Lib\string.py)
+      >>>
+
+
+|GOBACK|
+
+
+.. _iu.py:
+
+``iu.py``: An *imputil* Replacement
+-----------------------------------
+
+Module ``iu`` grows out of the pioneering work that Greg Stein did with ``imputil``
+(actually, it includes some verbatim ``imputil`` code, but since Greg didn't
+copyright it, we won't mention it). Both modules can take over Python's
+builtin import and ease writing of at least certain kinds of import hooks.
+
+``iu`` differs from ``imputil``:
+* faster
+* better emulation of builtin import
+* more managable
+
+There is an ``ImportManager`` which provides the replacement for builtin import
+and hides all the semantic complexities of a Python import request from it's
+delegates.
+
+|GOBACK|
+
+``ImportManager``
+*****************
+
+``ImportManager`` formalizes the concept of a metapath. This concept implicitly
+exists in native Python in that builtins and frozen modules are searched
+before ``sys.path``, (on Windows there's also a search of the registry while on
+Mac, resources may be searched). This metapath is a list populated with
+``ImportDirector`` instances. There are ``ImportDirector`` subclasses for builtins,
+frozen modules, (on Windows) modules found through the registry and a
+``PathImportDirector`` for handling ``sys.path``. For a top-level import (that is, not
+an import of a module in a package), ``ImportManager`` tries each director on it's
+metapath until one succeeds.
+
+``ImportManager`` hides the semantic complexity of an import from the directors.
+It's up to the ``ImportManager`` to decide if an import is relative or absolute;
+to see if the module has already been imported; to keep ``sys.modules`` up to
+date; to handle the fromlist and return the correct module object.
+
+|GOBACK|
+
+``ImportDirector``
+******************
+
+An ``ImportDirector`` just needs to respond to ``getmod(name)`` by returning a module
+object or ``None``. As you will see, an ``ImportDirector`` can consider name to be
+atomic - it has no need to examine name to see if it is dotted.
+
+To see how this works, we need to examine the ``PathImportDirector``.
+
+|GOBACK|
+
+``PathImportDirector``
+**********************
+
+The ``PathImportDirector`` subclass manages a list of names - most notably,
+``sys.path``. To do so, it maintains a shadowpath - a dictionary mapping the names
+on its pathlist (eg, ``sys.path``) to their associated ``Owners``. (It could do this
+directly, but the assumption that sys.path is occupied solely by strings seems
+ineradicable.) ``Owners`` of the appropriate kind are created as needed (if all
+your imports are satisfied by the first two elements of ``sys.path``, the
+``PathImportDirector``'s shadowpath will only have two entries).
+
+|GOBACK|
+
+``Owner``
+*********
+
+An ``Owner`` is much like an ``ImportDirector`` but manages a much more concrete piece
+of turf. For example, a ``DirOwner`` manages one directory. Since there are no
+other officially recognized filesystem-like namespaces for importing, that's
+all that's included in iu, but it's easy to imagine ``Owners`` for zip files
+(and I have one for my own ``.pyz`` archive format) or even URLs.
+
+As with ``ImportDirectors``, an ``Owner`` just needs to respond to ``getmod(name)`` by
+returning a module object or ``None``, and it can consider name to be atomic.
+
+So structurally, we have a tree, rooted at the ``ImportManager``. At the next
+level, we have a set of ``ImportDirectors``. At least one of those directors, the
+``PathImportDirector`` in charge of ``sys.path``, has another level beneath it,
+consisting of ``Owners``. This much of the tree covers the entire top-level import
+namespace.
+
+The rest of the import namespace is covered by treelets, each rooted in a
+package module (an ``__init__.py``).
+
+|GOBACK|
+
+Packages
+********
+
+To make this work, ``Owners`` need to recognize when a module is a package. For a
+``DirOwner``, this means that name is a subdirectory which contains an ``__init__.py``.
+The ``__init__`` module is loaded and its ``__path__`` is initialized with the
+subdirectory. Then, a ``PathImportDirector`` is created to manage this ``__path__``.
+Finally the new ``PathImportDirector``'s ``getmod`` is assigned to the package's
+``__importsub__`` function.
+
+When a module within the package is imported, the request is routed (by the
+``ImportManager``) diretly to the package's ``__importsub__``. In a hierarchical
+namespace (like a filesystem), this means that ``__importsub__`` (which is really
+the bound getmod method of a ``PathImportDirector`` instance) needs only the
+module name, not the package name or the fully qualified name. And that's
+exactly what it gets. (In a flat namespace - like most archives - it is
+perfectly easy to route the request back up the package tree to the archive
+``Owner``, qualifying the name at each step.)
+
+|GOBACK|
+
+Possibilities
+*************
+
+Let's say we want to import from zip files. So, we subclass ``Owner``. The
+``__init__`` method should take a filename, and raise a ``ValueError`` if the file is
+not an acceptable ``.zip`` file, (when a new name is encountered on ``sys.path`` or a
+package's ``__path__``, registered Owners are tried until one accepts the name).
+The ``getmod`` method would check the zip file's contents and return ``None`` if the
+name is not found. Otherwise, it would extract the marshalled code object from
+the zip, create a new module object and perform a bit of initialization (12
+lines of code all told for my own archive format, including initializing a pack
+age with it's ``__subimporter__``).
+
+Once the new ``Owner`` class is registered with ``iu``, you can put a zip file on
+``sys.path``. A package could even put a zip file on its ``__path__``.
+
+|GOBACK|
+
+Compatibility
+*************
+
+This code has been tested with the PyXML, mxBase and Win32 packages, covering
+over a dozen import hacks from manipulations of ``__path__`` to replacing a module
+in ``sys.modules`` with a different one. Emulation of Python's native import is
+nearly exact, including the names recorded in ``sys.modules`` and module attributes
+(packages imported through ``iu`` have an extra attribute - ``__importsub__``).
+
+|GOBACK|
+
+Performance
+***********
+
+In most cases, ``iu`` is slower than builtin import (by 15 to 20%) but faster than
+``imputil`` (by 15 to 20%). By inserting archives at the front of ``sys.path``
+containing the standard lib and the package being tested, this can be reduced
+to 5 to 10% slower (or, on my 1.52 box, 10% faster!) than builtin import. A bit
+more can be shaved off by manipulating the ``ImportManager``'s metapath.
+
+|GOBACK|
+
+Limitations
+***********
+
+This module makes no attempt to facilitate policy import hacks. It is easy to
+implement certain kinds of policies within a particular domain, but
+fundamentally iu works by dividing up the import namespace into independent
+domains.
+
+Quite simply, I think cross-domain import hacks are a very bad idea. As author
+of the original package on which |PyInstaller| is based, McMillan worked with
+import hacks for many years. Many of them are highly fragile; they often rely
+on undocumented (maybe even accidental) features of implementation.
+A cross-domain import hack is not likely to work with PyXML, for example.
+
+That rant aside, you can modify ``ImportManger`` to implement different policies.
+For example, a version that implements three import primitives: absolute
+import, relative import and recursive-relative import. No idea what the Python
+syntax for those should be, but ``__aimport__``, ``__rimport__`` and ``__rrimport__`` were
+easy to implement.
+
+
+Usage
+*****
+
+Here's a simple example of using ``iu`` as a builtin import replacement.
+
+      >>> import iu
+      >>> iu.ImportManager().install()
+      >>>
+      >>> import DateTime
+      >>> DateTime.__importsub__
+      <method PathImportDirector.getmod
+        of PathImportDirector instance at 825900>
+      >>>
+
+|GOBACK|
+
+.. _PyInstaller: http://pyinstaller.hpcf.upr.edu/pyinstaller
+.. _Roadmap: http://pyinstaller.hpcf.upr.edu/pyinstaller/roadmap
+.. _`Submit a Bug`: http://pyinstaller.hpcf.upr.edu/pyinstaller/newticket
+.. _Scons: http://www.scons.org
+.. _hooks\/hook-win32com.py: http://pyinstaller.hpcf.upr.edu/pyinstaller/browser/trunk/hooks/hook-win32com.py?rev=latest
+.. _support\/unpackTK.py: http://pyinstaller.hpcf.upr.edu/pyinstaller/browser/trunk/support/unpackTK.py?rev=latest
+.. _source/common/launch.c: http://pyinstaller.hpcf.upr.edu/pyinstaller/browser/trunk/source/common/launch.c?rev=latest
+.. _Pmw: http://pmw.sourceforge.net/
+.. _PIL: http://www.pythonware.com/products/pil/
+.. _PyQt: http://www.riverbankcomputing.co.uk/pyqt/index.php
+.. _PyWin32: http://starship.python.net/crew/mhammond/win32/
+.. |ZlibArchiveImage| image:: images/ZlibArchive.png
+.. |CArchiveImage| image:: images/CArchive.png
+.. |SE_exeImage| image:: images/SE_exe.png
+.. |PyInstaller| replace:: PyInstaller
+.. |PyInstallerVersion| replace:: PyInstaller v1.0
+.. |InitialVersion| replace:: v1.0
+.. |install_path| replace:: /your/path/to/pyinstaller/
+.. |GOBACK| replace:: `Back to Top`_
+.. _`Back to Top`: `PyInstaller Manual`_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/doc/source/docutils.conf	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,12 @@
+[general]
+# These entries affect all processing:
+source-link: yes
+datestamp: %Y-%m-%d %H:%M UTC
+generator: on
+embed-stylesheet: no
+
+[html4css1 writer]
+# These entries affect HTML output:
+stylesheet-path: ../stylesheets/default.css
+field-name-limit: 20
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/doc/source/tools/README	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,16 @@
+#
+# About doc/tools
+#
+
+These tools require docutils available from http://docutils.sourceforge.net
+
+These file are available from docutils respository but since they are not
+installed by default as on "Sep  8 2005" we are including them here as
+reference. If any of them has been modified it is specified in the file header.
+
+We use these and other tools from docutils to generate the documentation on
+different formats
+
+#
+# END OF FILE
+#
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/doc/source/tools/buildrecursive.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,243 @@
+#!/usr/bin/env python
+
+# Author: David Goodger
+# Contact: goodger@users.sourceforge.net
+# Revision: $Revision: 1.1 $
+# Date: $Date: 2009/02/05 23:03:30 $
+# Copyright: This module has been placed in the public domain.
+
+# Addapted by William Caban to look for .rst by default instead of .txt
+# added docutils availability
+
+"""
+Generates .html from all the .rst files in a directory.
+
+Ordinary .rst files are understood to be standalone reStructuredText.
+Files named ``pep-*.rst`` are interpreted as reStructuredText PEPs.
+"""
+# Once PySource is here, build .html from .py as well.
+
+__docformat__ = 'reStructuredText'
+
+
+try:
+    import locale
+    locale.setlocale(locale.LC_ALL, '')
+except:
+    pass
+
+import sys
+import os
+import os.path
+import copy
+try:
+	import docutils
+	from docutils import ApplicationError
+	from docutils import core, frontend
+	from docutils.parsers import rst
+	from docutils.readers import standalone, pep
+	from docutils.writers import html4css1, pep_html
+except:
+	print "################################################################"
+	print "# You need 'docutils' installed to execute this program.       #"
+	print "# 'docutils' is available from http://docutils.sourceforge.net #"
+	print "################################################################"
+	sys.exit(1)
+
+
+usage = '%prog [options] [<directory> ...]'
+description = ('Generates .html from all the reStructuredText .rst files '
+               '(including PEPs) in each <directory> '
+               '(default is the current directory).')
+
+
+class SettingsSpec(docutils.SettingsSpec):
+
+    """
+    Runtime settings & command-line options for the front end.
+    """
+
+    # Can't be included in OptionParser below because we don't want to
+    # override the base class.
+    settings_spec = (
+        'Build-HTML Options',
+        None,
+        (('Recursively scan subdirectories for files to process.  This is '
+          'the default.',
+          ['--recurse'],
+          {'action': 'store_true', 'default': 1,
+           'validator': frontend.validate_boolean}),
+         ('Generate output files in the specified directory.  The default is '
+          'to put them in the same directory of the input files.',
+          ['--outpath'], {'metavar': '<directory>', 'type': 'string'}),
+         ('Do not scan subdirectories for files to process.',
+          ['--local'], {'dest': 'recurse', 'action': 'store_false'}),
+         ('Do not process files in <directory>.  This option may be used '
+          'more than once to specify multiple directories.',
+          ['--prune'],
+          {'metavar': '<directory>', 'action': 'append',
+           'validator': frontend.validate_colon_separated_string_list}),
+         ('Work silently (no progress messages).  Independent of "--quiet".',
+          ['--silent'],
+          {'action': 'store_true', 'validator': frontend.validate_boolean}),))
+
+    relative_path_settings = ('prune',)
+    config_section = 'buildhtml application'
+    config_section_dependencies = ('applications',)
+
+
+class OptionParser(frontend.OptionParser):
+
+    """
+    Command-line option processing for the ``buildhtml.py`` front end.
+    """
+
+    def check_values(self, values, args):
+        frontend.OptionParser.check_values(self, values, args)
+        values._source = None
+        return values
+
+    def check_args(self, args):
+        source = destination = None
+        if args:
+            self.values._directories = args
+        else:
+            self.values._directories = [os.getcwd()]
+        return source, destination
+
+
+class Struct:
+
+    """Stores data attributes for dotted-attribute access."""
+
+    def __init__(self, **keywordargs):
+        self.__dict__.update(keywordargs)
+
+
+class Builder:
+
+    def __init__(self):
+        self.publishers = {
+            '': Struct(components=(pep.Reader, rst.Parser, pep_html.Writer,
+                                   SettingsSpec)),
+            '.rst': Struct(components=(rst.Parser, standalone.Reader,
+                                       html4css1.Writer, SettingsSpec),
+                           reader_name='standalone',
+                           writer_name='html'),
+            'PEPs': Struct(components=(rst.Parser, pep.Reader,
+                                       pep_html.Writer, SettingsSpec),
+                           reader_name='pep',
+                           writer_name='pep_html')}
+        """Publisher-specific settings.  Key '' is for the front-end script
+        itself.  ``self.publishers[''].components`` must contain a superset of
+        all components used by individual publishers."""
+
+        self.setup_publishers()
+
+    def setup_publishers(self):
+        """
+        Manage configurations for individual publishers.
+
+        Each publisher (combination of parser, reader, and writer) may have
+        its own configuration defaults, which must be kept separate from those
+        of the other publishers.  Setting defaults are combined with the
+        config file settings and command-line options by
+        `self.get_settings()`.
+        """
+        for name, publisher in self.publishers.items():
+            option_parser = OptionParser(
+                components=publisher.components, read_config_files=1,
+                usage=usage, description=description)
+            publisher.option_parser = option_parser
+            publisher.setting_defaults = option_parser.get_default_values()
+            frontend.make_paths_absolute(publisher.setting_defaults.__dict__,
+                                         option_parser.relative_path_settings)
+            publisher.config_settings = (
+                option_parser.get_standard_config_settings())
+        self.settings_spec = self.publishers[''].option_parser.parse_args(
+            values=frontend.Values())   # no defaults; just the cmdline opts
+        self.initial_settings = self.get_settings('')
+
+    def get_settings(self, publisher_name, directory=None):
+        """
+        Return a settings object, from multiple sources.
+
+        Copy the setting defaults, overlay the startup config file settings,
+        then the local config file settings, then the command-line options.
+        Assumes the current directory has been set.
+        """
+        publisher = self.publishers[publisher_name]
+        settings = frontend.Values(publisher.setting_defaults.__dict__)
+        settings.update(publisher.config_settings, publisher.option_parser)
+        if directory:
+            local_config = publisher.option_parser.get_config_file_settings(
+                os.path.join(directory, 'docutils.conf'))
+            frontend.make_paths_absolute(
+                local_config, publisher.option_parser.relative_path_settings,
+                directory)
+            settings.update(local_config, publisher.option_parser)
+        settings.update(self.settings_spec.__dict__, publisher.option_parser)
+        return settings
+
+    def run(self, directory=None, recurse=1):
+        recurse = recurse and self.initial_settings.recurse
+        if directory:
+            self.directories = [directory]
+        elif self.settings_spec._directories:
+            self.directories = self.settings_spec._directories
+        else:
+            self.directories = [os.getcwd()]
+        for directory in self.directories:
+            os.path.walk(directory, self.visit, recurse)
+
+    def visit(self, recurse, directory, names):
+        settings = self.get_settings('', directory)
+        if settings.prune and (os.path.abspath(directory) in settings.prune):
+            print >>sys.stderr, '/// ...Skipping directory (pruned):', directory
+            sys.stderr.flush()
+            names[:] = []
+            return
+        if not self.initial_settings.silent:
+            print >>sys.stderr, '/// Processing directory:', directory
+            sys.stderr.flush()
+        prune = 0
+        for name in names:
+            if name.endswith('.rst'):
+                prune = self.process_rst(directory, name)
+                if prune:
+                    break
+        if not recurse:
+            del names[:]
+
+    def process_rst(self, directory, name):
+        if name.startswith('pep-'):
+            publisher = 'PEPs'
+        else:
+            publisher = '.rst'
+        settings = self.get_settings(publisher, directory)
+        pub_struct = self.publishers[publisher]
+        if settings.prune and (directory in settings.prune):
+            return 1
+        settings._source = os.path.normpath(os.path.join(directory, name))
+        settings._destination = settings._source[:-4]+'.html'
+        if settings.outpath:
+            # FIXME: we should probably try and recreate the exising structure here,
+            # but that's more work than we need right now.
+            settings._destination = os.path.join(settings.outpath, os.path.basename(settings._destination))
+        if not self.initial_settings.silent:
+            print >>sys.stderr, '    ::: Processing:', name
+            sys.stderr.flush()
+        try:
+            core.publish_file(source_path=settings._source,
+                              destination_path=settings._destination,
+                              reader_name=pub_struct.reader_name,
+                              parser_name='restructuredtext',
+                              writer_name=pub_struct.writer_name,
+                              settings=settings)
+        except ApplicationError, error:
+            print >>sys.stderr, ('        Error (%s): %s'
+                                 % (error.__class__.__name__, error))
+
+
+if __name__ == "__main__":
+    Builder().run()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/doc/source/tools/rst2newlatex.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,27 @@
+#!/usr/bin/env python
+
+# Author: David Goodger
+# Contact: goodger@users.sourceforge.net
+# Revision: $Revision: 1.1 $
+# Date: $Date: 2009/02/05 23:03:30 $
+# Copyright: This module has been placed in the public domain.
+
+"""
+A minimal front end to the Docutils Publisher, producing LaTeX using
+the new LaTeX writer.
+"""
+
+try:
+    import locale
+    locale.setlocale(locale.LC_ALL, '')
+except:
+    pass
+
+from docutils.core import publish_cmdline, default_description
+
+
+description = ('Generates LaTeX documents from standalone reStructuredText '
+               'sources. This writer is EXPERIMENTAL and should not be used '
+               'in a production environment. ' + default_description)
+
+publish_cmdline(writer_name='newlatex2e', description=description)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/doc/source/tools/rst2xml.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,25 @@
+#!/usr/bin/env python
+
+# Author: David Goodger
+# Contact: goodger@users.sourceforge.net
+# Revision: $Revision: 1.1 $
+# Date: $Date: 2009/02/05 23:03:30 $
+# Copyright: This module has been placed in the public domain.
+
+"""
+A minimal front end to the Docutils Publisher, producing Docutils XML.
+"""
+
+try:
+    import locale
+    locale.setlocale(locale.LC_ALL, '')
+except:
+    pass
+
+from docutils.core import publish_cmdline, default_description
+
+
+description = ('Generates Docutils-native XML from standalone '
+               'reStructuredText sources.  ' + default_description)
+
+publish_cmdline(writer_name='xml', description=description)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/doc/stylesheets/default.css	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,98 @@
+/*
+ * CSS for PyInstaller Documentation
+ */
+
+body, th, td {
+	font-family: verdana, Arial, sans-serif;
+	font-size: 10pt;
+	background-color: white;
+}
+
+p, dl, table {
+	margin-left: 2em;
+	margin-right: 2em;
+}
+
+h1, h2, h3, h4, h5, h6 {
+	color: #006699;
+}
+
+h1 {
+	text-align: center;
+ 	font-size: 24pt;
+	font-variant: small-caps;
+}
+h2 {
+ 	font-size: 14pt;
+}
+
+h3 {
+	font-size: 12pt;
+}
+
+h4 {
+	font-size: 11pt;
+}
+
+ul {background: #FFD596;}
+
+ul, a:link, a:visited { color: #006699; }
+
+a:hover {background-color:#006699; color:white;}
+li { color: #006699; margin-left: 2 em; }
+
+table { font-size: 12pt; }
+table.option-list kbd {padding: 3px; background: #FFD596; white-space: nowrap }
+
+th {
+  	background: #FFD596;
+	font-weight: bold;
+	font-variant: small-caps;
+}
+
+td {
+  	background: white;;
+}
+
+dt {
+	white-space: nowrap;
+	font-weight: bold;
+}
+
+pre {
+  border: solid 1px black;
+  background: #FFD596;
+  font-size: 12pt;
+  padding: 1em;
+  margin-left: 4em;
+  margin-right: 4em;
+}
+
+tt, code {
+	font-family: monospace;
+	font-size: larger;
+}
+
+div.sidebar {
+	margin-left: 1em;
+	margin-bottom: 1em;
+	font-size: smaller;
+	border: medium outset;
+	padding: 1em 0em;  /* needed by IE */
+	background-color: #ffffee;
+	width: 35%;
+	float: right;
+	clear: right;
+}
+
+p.sidebar-title {
+	font-weight: bold;
+	font-size: larger;
+	color: #006699;
+	font-variant: small-caps;
+}
+
+
+/*
+ * END OF FILE
+ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/doc/stylesheets/docutils.conf	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,5 @@
+# This configuration file is to prevent tools/buildhtml.py from
+# processing text files in and below this directory.
+
+[buildhtml application]
+prune: .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/doc/stylesheets/latex.tex	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,1082 @@
+\makeatletter
+
+% Development notes at
+% http://docutils.python-hosting.com/wiki/NewLatex
+
+
+\providecommand{\Dprinting}{false}
+
+
+\providecommand{\DSearly}{}
+\providecommand{\DSlate}{}
+
+\providecommand{\Ddocumentclass}{scrartcl}
+\providecommand{\Ddocumentoptions}{a4paper}
+
+\documentclass[\Ddocumentoptions]{\Ddocumentclass}
+
+\DSearly
+
+
+\providecommand{\DSfontencoding}{
+  % Set up font encoding.
+  % AE is a T1-emulation.  It provides most characters and features
+  % as T1-encoded fonts but doesn't use ugly bitmap fonts.
+  \usepackage{ae}
+  % Provide the characters not contained in AE from EC bitmap fonts.
+  \usepackage{aecompl}
+  % Guillemets ("<<", ">>") in AE.
+  \usepackage{aeguill}
+}
+
+
+\providecommand{\DSsymbols}{%
+  % Fix up symbols.
+  % The Euro symbol in Computer Modern looks, um, funny.  Let's get a
+  % proper Euro symbol.
+  \RequirePackage{eurosym}%
+  \renewcommand{\texteuro}{\euro}%
+}
+
+
+% Taken from
+% <http://groups.google.de/groups?selm=1i0n5tgtplti420e1omp4pctlv19jpuhbb%404ax.com>
+% and modified.  Used with permission.
+\providecommand{\Dprovidelength}[2]{%
+  \begingroup%
+    \escapechar\m@ne%
+    \xdef\@gtempa{{\string#1}}%
+  \endgroup%
+  \expandafter\@ifundefined\@gtempa%
+  {\newlength{#1}\setlength{#1}{#2}}%
+  {}%
+}
+
+\providecommand{\Dprovidecounter}[1]{%
+  % Like \newcounter except that it doesn't crash if the counter
+  % already exists.
+  \@ifundefined{c@#1}{\newcounter{#1}}{}
+}
+
+\Dprovidelength{\Dboxparindent}{\parindent}
+\providecommand{\Dmakeboxminipage}[1]{%
+  % Make minipage for use in a box created by \Dmakefbox.
+  \begin{minipage}[t]{0.9\linewidth}%
+    \setlength{\parindent}{\Dboxparindent}%
+    #1%
+  \end{minipage}%
+}
+\providecommand{\Dmakefbox}[1]{%
+  % Make a centered, framed box.  Useful e.g. for admonitions.
+  \vspace{0.4\baselineskip}%
+  \begin{center}%
+    \fbox{\Dmakeboxminipage{#1}}%
+  \end{center}%
+  \vspace{0.4\baselineskip}%
+}
+\providecommand{\Dmakebox}[1]{%
+  % Make a centered, frameless box.  Useful e.g. for block quotes.
+  % Do not use minipages here, but create pseudo-lists to allow
+  % page-breaking.  (Don't use KOMA-script's addmargin environment
+  % because it messes up bullet lists.)
+  \Dmakelistenvironment{}{}{%
+    \setlength{\parskip}{0pt}%
+    \setlength{\parindent}{\Dboxparindent}%
+    \item{#1}%
+  }%
+}
+
+
+\RequirePackage{ifthen}
+\providecommand{\Dfrenchspacing}{true}
+\ifthenelse{\equal{\Dfrenchspacing}{true}}{\frenchspacing}{}
+
+
+\Dprovidelength{\Dblocklevelvspace}{%
+  % Space between block-level elements other than paragraphs.
+  0.7\baselineskip plus 0.3\baselineskip minus 0.2\baselineskip%
+}
+\providecommand{\Dauxiliaryspace}{%
+  \ifthenelse{\equal{\Dneedvspace}{true}}{\vspace{\Dblocklevelvspace}}{}%
+  \par\noindent%
+}
+\providecommand{\Dauxiliaryparspace}{%
+  \ifthenelse{\equal{\Dneedvspace}{true}}{\vspace{\Dblocklevelvspace}}{}%
+  \par%
+}
+\providecommand{\Dparagraphspace}{\par}
+\providecommand{\Dneedvspace}{true}
+
+
+\providecommand{\DSlinks}{
+  % Targets and references.
+  \RequirePackage[colorlinks=false,pdfborder={0 0 0}]{hyperref}
+
+  \providecommand{\Draisedlink}[1]{\Hy@raisedlink{##1}}
+  
+  % References.
+  % We're assuming here that the "refid" and "refuri" attributes occur
+  % only in inline context (in TextElements).
+  \providecommand{\DArefid}[5]{%
+    \ifthenelse{\equal{##4}{reference}}{%
+      \Dexplicitreference{\###3}{##5}%
+    }{%
+      % If this is not a target node (targets with refids are
+      % uninteresting and should be silently dropped).
+      \ifthenelse{\not\equal{##4}{target}}{%
+        % If this is a footnote reference, call special macro.
+        \ifthenelse{\equal{##4}{footnotereference}}{%
+          \Dimplicitfootnotereference{\###3}{##5}%
+        }{%
+          \ifthenelse{\equal{##4}{citationreference}}{%
+            \Dimplicitcitationreference{\###3}{##5}%
+          }{%
+            \Dimplicitreference{\###3}{##5}%
+          }%
+        }%
+      }{}%
+    }%
+  }
+  \providecommand{\DArefuri}[5]{%
+    \ifthenelse{\equal{##4}{target}}{%
+      % Hyperlink targets can (and should be) ignored because they are
+      % invisible.
+    }{%
+      % We only have explicit URI references, so one macro suffices.
+      \Durireference{##3}{##5}%
+    }%
+  }
+  % Targets.
+  \providecommand{\DAids}[5]{%
+    \label{##3}%
+    \ifthenelse{\equal{##4}{footnotereference}}{%
+      {%
+        \renewcommand{\HyperRaiseLinkDefault}{%
+          % Dirty hack to make backrefs to footnote references work.
+          % For some reason, \baselineskip is 0pt in fn references.
+          0.5\Doriginalbaselineskip%
+        }%
+        \Draisedlink{\hypertarget{##3}{}}##5%
+      }%
+    }{%
+      \Draisedlink{\hypertarget{##3}{}}##5%
+    }%
+  }
+  % Color in references.
+  \RequirePackage{color}
+  \providecommand{\Dimplicitreference}[2]{%
+    % Create implicit reference to ID.  Implicit references occur
+    % e.g. in TOC-backlinks of section titles.  Parameters:
+    % 1. Target.
+    % 2. Link text.
+    \href{##1}{##2}%
+  }
+  \providecommand{\Dimplicitfootnotereference}[2]{%
+    % Ditto, but for the special case of footnotes.
+    % We want them to be rendered like explicit references.
+    \Dexplicitreference{##1}{##2}%
+  }
+  \providecommand{\Dimplicitcitationreference}[2]{%
+    % Ditto for citation references.
+    \Dimplicitfootnotereference{##1}{##2}%
+  }
+  \ifthenelse{\equal{\Dprinting}{true}}{
+    \providecommand{\Dexplicitreferencecolor}{black}
+  }{
+    \providecommand{\Dexplicitreferencecolor}{blue}
+  }
+  \providecommand{\Dexplicitreference}[2]{%
+    % Create explicit reference to ID, e.g. created with "foo_".
+    % Parameters:
+    % 1. Target.
+    % 2. Link text.
+    \href{##1}{{\color{\Dexplicitreferencecolor}##2}}%
+  }
+  \providecommand{\Durireferencecolor}{\Dexplicitreferencecolor}
+  \providecommand{\Durireference}[2]{%
+    % Create reference to URI.  Parameters:
+    % 1. Target.
+    % 2. Link text.
+    \href{##1}{{\color{\Durireferencecolor}##2}}%
+  }
+}
+
+
+\providecommand{\DSlanguage}{%
+  % Set up babel.
+  \ifthenelse{\equal{\Dlanguagebabel}{}}{}{
+    \RequirePackage[\Dlanguagebabel]{babel}
+  }
+}
+
+
+
+
+\providecommand{\DAclasses}[5]{%
+  \Difdefined{DN#4C#3}{%
+    % Pass only contents, nothing else!
+    \csname DN#4C#3\endcsname{#5}%
+  }{%
+    \Difdefined{DC#3}{%
+      \csname DC#3\endcsname{#5}%
+    }{%
+      #5%
+    }%
+  }%
+}
+
+\providecommand{\Difdefined}[3]{\@ifundefined{#1}{#3}{#2}}
+
+\providecommand{\Dattr}[5]{%
+  % Global attribute dispatcher.
+  % Parameters:
+  % 1. Attribute number.
+  % 2. Attribute name.
+  % 3. Attribute value.
+  % 4. Node name.
+  % 5. Node contents.
+  \Difdefined{DN#4A#2V#3}{%
+    \csname DN#4A#2V#3\endcsname{#1}{#2}{#3}{#4}{#5}%
+  }{\Difdefined{DN#4A#2}{%
+    \csname DN#4A#2\endcsname{#1}{#2}{#3}{#4}{#5}%
+  }{\Difdefined{DA#2V#3}{%
+    \csname DA#2V#3\endcsname{#1}{#2}{#3}{#4}{#5}%
+  }{\Difdefined{DA#2}{%
+    \csname DA#2\endcsname{#1}{#2}{#3}{#4}{#5}%
+  }{#5%
+  }}}}%
+}
+
+\providecommand{\DNparagraph}[1]{#1}
+\providecommand{\Dformatboxtitle}[1]{{\Large\textbf{#1}}}
+\providecommand{\Dformatboxsubtitle}[1]{{\large\textbf{#1}}}
+\providecommand{\Dtopictitle}[1]{%
+  \Difinsidetoc{\vspace{1em}\par}{}%
+  \noindent\Dformatboxtitle{#1}%
+  \ifthenelse{\equal{\Dhassubtitle}{false}}{\vspace{1em}}{\vspace{0.5em}}%
+  \par%
+}
+\providecommand{\Dtopicsubtitle}[1]{%
+  \noindent\Dformatboxsubtitle{#1}%
+  \vspace{1em}%
+  \par%
+}
+\providecommand{\Dsidebartitle}[1]{\Dtopictitle{#1}}
+\providecommand{\Dsidebarsubtitle}[1]{\Dtopicsubtitle{#1}}
+\providecommand{\Ddocumenttitle}[1]{%
+  \begin{center}{\Huge#1}\end{center}%
+  \ifthenelse{\equal{\Dhassubtitle}{true}}{\vspace{0.1cm}}{\vspace{1cm}}%
+}
+\providecommand{\Ddocumentsubtitle}[1]{%
+  \begin{center}{\huge#1}\end{center}%
+  \vspace{1cm}%
+}
+% Can be overwritten by user stylesheet.
+\providecommand{\Dformatsectiontitle}[1]{#1}
+\providecommand{\Dformatsectionsubtitle}[1]{\Dformatsectiontitle{#1}}
+\providecommand{\Dbookmarksectiontitle}[1]{%
+  % Return text suitable for use in \section*, \subsection*, etc.,
+  % containing a PDF bookmark.  Parameter:  The title (as node tree).
+  \Draisedlink{\Dpdfbookmark{\Dtitleastext}}%
+  #1%
+}
+\providecommand{\Dsectiontitlehook}[1]{#1}
+\providecommand{\Dsectiontitle}[1]{%
+  \Dsectiontitlehook{%
+    \Ddispatchsectiontitle{\Dbookmarksectiontitle{\Dformatsectiontitle{#1}}}%
+  }%
+}
+\providecommand{\Ddispatchsectiontitle}[1]{%
+  \@ifundefined{Dsectiontitle\roman{Dsectionlevel}}{%
+    \Ddeepsectiontitle{#1}%
+  }{%
+    \csname Dsectiontitle\roman{Dsectionlevel}\endcsname{#1}%
+  }%
+}
+\providecommand{\Ddispatchsectionsubtitle}[1]{%
+  \Ddispatchsectiontitle{#1}%
+}
+\providecommand{\Dsectiontitlei}[1]{\section*{#1}}
+\providecommand{\Dsectiontitleii}[1]{\subsection*{#1}}
+\providecommand{\Ddeepsectiontitle}[1]{%
+  % Anything below \subsubsection (like \paragraph or \subparagraph)
+  % is useless because it uses the same font.  The only way to
+  % (visually) distinguish such deeply nested sections is to use
+  % section numbering.
+  \subsubsection*{#1}%
+}
+\providecommand{\Dsectionsubtitlehook}[1]{#1}
+\Dprovidelength{\Dsectionsubtitleraisedistance}{0.7em}
+\providecommand{\Dsectionsubtitlescaling}{0.85}
+\providecommand{\Dsectionsubtitle}[1]{%
+  \Dsectionsubtitlehook{%
+    % Move the subtitle nearer to the title.
+    \vspace{-\Dsectionsubtitleraisedistance}%
+    % Don't create a PDF bookmark.
+    \Ddispatchsectionsubtitle{%
+      \Dformatsectionsubtitle{\scalebox{\Dsectionsubtitlescaling}{#1}}%
+    }%
+  }%
+}
+% Boolean variable.
+\providecommand{\Dhassubtitle}{false}
+\providecommand{\DNtitle}[1]{%
+  \csname D\Dparent title\endcsname{#1}%
+}
+\providecommand{\DNsubtitle}[1]{%
+  \csname D\Dparent subtitle\endcsname{#1}%
+}
+\newcounter{Dpdfbookmarkid}
+\setcounter{Dpdfbookmarkid}{0}
+\providecommand{\Dpdfbookmark}[1]{%
+  % Temporarily decrement Desctionlevel counter.
+  \addtocounter{Dsectionlevel}{-1}%
+  %\typeout{\arabic{Dsectionlevel}}%
+  %\typeout{#1}%
+  %\typeout{docutils\roman{Dpdfbookmarkid}}%
+  %\typeout{}%
+  \pdfbookmark[\arabic{Dsectionlevel}]{#1}{docutils\arabic{Dpdfbookmarkid}}%
+  \addtocounter{Dsectionlevel}{1}%
+  \addtocounter{Dpdfbookmarkid}{1}%
+}
+
+%\providecommand{\DNliteralblock}[1]{\begin{quote}\ttfamily\raggedright#1\end{quote}}
+\providecommand{\DNliteralblock}[1]{%
+  \Dmakelistenvironment{}{%
+    \ifthenelse{\equal{\Dinsidetabular}{true}}{%
+      \setlength{\leftmargin}{0pt}%
+    }{}%
+    \setlength{\rightmargin}{0pt}%
+  }{%
+    \raggedright\item\noindent\nohyphens{\textnhtt{#1\Dfinalstrut}}%
+  }%
+}
+\providecommand{\DNdoctestblock}[1]{%
+  % Treat doctest blocks the same as literal blocks.
+  \DNliteralblock{#1}%
+}
+\RequirePackage{hyphenat}
+\providecommand{\DNliteral}[1]{\textnhtt{#1}}
+\providecommand{\DNemphasis}[1]{\emph{#1}}
+\providecommand{\DNstrong}[1]{\textbf{#1}}
+\providecommand{\Dvisitdocument}{\begin{document}\noindent}
+\providecommand{\Ddepartdocument}{\end{document}}
+\providecommand{\DNtopic}[1]{%
+  \ifthenelse{\equal{\DcurrentNtopicAcontents}{1}}{%
+    \addtocounter{Dtoclevel}{1}%
+    \par\noindent%
+    #1%
+    \addtocounter{Dtoclevel}{-1}%
+  }{%
+    \par\noindent%
+    \Dmakebox{#1}%
+  }%
+}
+\providecommand{\Dformatrubric}[1]{\textbf{#1}}
+\Dprovidelength{\Dprerubricspace}{0.3em}
+\providecommand{\DNrubric}[1]{%
+  \vspace{\Dprerubricspace}\par\noindent\Dformatrubric{#1}\par%
+}
+
+\providecommand{\Dbullet}{}
+\providecommand{\Dsetbullet}[1]{\renewcommand{\Dbullet}{#1}}
+\providecommand{\DNbulletlist}[1]{%
+  \Difinsidetoc{%
+    \Dtocbulletlist{#1}%
+  }{%
+    \Dmakelistenvironment{\Dbullet}{}{#1}%
+  }%
+}
+\renewcommand{\@pnumwidth}{2.2em}
+\providecommand{\DNlistitem}[1]{%
+  \Difinsidetoc{%
+    \ifthenelse{\equal{\theDtoclevel}{1}\and\equal{\Dlocaltoc}{false}}{%
+      {%
+        \par\addvspace{1em}\noindent%
+        \sectfont%
+        #1\hfill\pageref{\DcurrentNlistitemAtocrefid}%
+      }%
+    }{%
+      \@dottedtocline{0}{\Dtocindent}{0em}{#1}{%
+        \pageref{\DcurrentNlistitemAtocrefid}%
+      }%
+    }%
+  }{%
+    \item{#1}%
+  }%
+}
+\providecommand{\DNenumeratedlist}[1]{#1}
+\newcounter{Dsectionlevel}
+\providecommand{\Dvisitsectionhook}{}
+\providecommand{\Ddepartsectionhook}{}
+\providecommand{\Dvisitsection}{%
+  \addtocounter{Dsectionlevel}{1}%
+  \Dvisitsectionhook%
+}
+\providecommand{\Ddepartsection}{%
+  \Ddepartsectionhook%
+  \addtocounter{Dsectionlevel}{-1}%
+}
+
+% Using \_ will cause hyphenation after _ even in \textnhtt-typewriter
+% because the hyphenat package redefines \_.  So we use
+% \textunderscore here.
+\providecommand{\Dtextunderscore}{\textunderscore}
+
+\providecommand{\Dtextinlineliteralfirstspace}{{ }}
+\providecommand{\Dtextinlineliteralsecondspace}{{~}}
+
+\Dprovidelength{\Dlistspacing}{0.8\baselineskip}
+
+\providecommand{\Dsetlistrightmargin}{%
+  \ifthenelse{\lengthtest{\linewidth>10em}}{%
+    % Equal margins.
+    \setlength{\rightmargin}{\leftmargin}%
+  }{%
+    % If the line is narrower than 10em, we don't remove any further
+    % space from the right.
+    \setlength{\rightmargin}{0pt}%
+  }%
+}
+\providecommand{\Dresetlistdepth}{false}
+\Dprovidelength{\Doriginallabelsep}{\labelsep}
+\providecommand{\Dmakelistenvironment}[3]{%
+  % Make list environment with support for unlimited nesting and with
+  % reasonable default lengths.  Parameters:
+  % 1. Label (same as in list environment).
+  % 2. Spacing (same as in list environment).
+  % 3. List contents (contents of list environment).
+  \ifthenelse{\equal{\Dinsidetabular}{true}}{%
+    % Unfortunately, vertical spacing doesn't work correctly when
+    % using lists inside tabular environments, so we use a minipage.
+    \begin{minipage}[t]{\linewidth}%
+  }{}%
+    {%
+      \renewcommand{\Dneedvspace}{false}%
+      % \parsep0.5\baselineskip
+      \renewcommand{\Dresetlistdepth}{false}%
+      \ifnum \@listdepth>5%
+      \protect\renewcommand{\Dresetlistdepth}{true}%
+      \@listdepth=5%
+      \fi%
+      \begin{list}{%
+          #1%
+        }{%
+          \setlength{\itemsep}{0pt}%
+          \setlength{\partopsep}{0pt}%
+          \setlength{\topsep}{0pt}%
+                                  % List should take 90% of total width.
+          \setlength{\leftmargin}{0.05\linewidth}%
+          \ifthenelse{\lengthtest{\leftmargin<1.8em}}{%
+            \setlength{\leftmargin}{1.8em}%
+          }{}%
+          \setlength{\labelsep}{\Doriginallabelsep}%
+          \Dsetlistrightmargin%
+          #2%
+        }{%
+          #3%
+        }%
+      \end{list}%
+      \ifthenelse{\equal{\Dresetlistdepth}{true}}{\@listdepth=5}{}%
+    }%
+  \ifthenelse{\equal{\Dinsidetabular}{true}}{\end{minipage}}{}%
+}
+\providecommand{\Dfinalstrut}{\@finalstrut\@arstrutbox}
+\providecommand{\DAlastitem}[5]{#5\Dfinalstrut}
+
+\Dprovidelength{\Ditemsep}{0pt}
+\providecommand{\Dmakeenumeratedlist}[6]{%
+  % Make enumerated list.
+  % Parameters:
+  % - prefix
+  % - type (\arabic, \roman, ...)
+  % - suffix
+  % - suggested counter name
+  % - start number - 1
+  % - list contents
+  \newcounter{#4}%
+  \Dmakelistenvironment{#1#2{#4}#3}{%
+    % Use as much space as needed for the label.
+    \setlength{\labelwidth}{10em}%
+    % Reserve enough space so that the label doesn't go beyond the
+    % left margin of preceding paragraphs.  Like that:
+    %
+    %    A paragraph.
+    %
+    %   1. First item.
+    \setlength{\leftmargin}{2.5em}%
+    \Dsetlistrightmargin%
+    \setlength{\itemsep}{\Ditemsep}%
+    % Use counter recommended by Python module.
+    \usecounter{#4}%
+    % Set start value.
+    \addtocounter{#4}{#5}%
+  }{%
+    % The list contents.
+    #6%
+  }%
+}
+
+
+% Single quote in literal mode.  \textquotesingle from package
+% textcomp has wrong width when using package ae, so we use a normal
+% single curly quote here.
+\providecommand{\Dtextliteralsinglequote}{'}
+
+
+% "Tabular lists" are field lists and options lists (not definition
+% lists because there the term always appears on its own line).  We'll
+% use the terminology of field lists now ("field", "field name",
+% "field body"), but the same is also analogously applicable to option
+% lists.
+%
+% We want these lists to be breakable across pages.  We cannot
+% automatically get the narrowest possible size for the left column
+% (i.e. the field names or option groups) because tabularx does not
+% support multi-page tables, ltxtable needs to have the table in an
+% external file and we don't want to clutter the user's directories
+% with auxiliary files created by the filecontents environment, and
+% ltablex is not included in teTeX.
+%
+% Thus we set a fixed length for the left column and use list
+% environments.  This also has the nice side effect that breaking is
+% now possible anywhere, not just between fields.
+%
+% Note that we are creating a distinct list environment for each
+% field.  There is no macro for a whole tabular list!
+\Dprovidelength{\Dtabularlistfieldnamewidth}{6em}
+\Dprovidelength{\Dtabularlistfieldnamesep}{0.5em}
+\providecommand{\Dinsidetabular}{false}
+\providecommand{\Dsavefieldname}{}
+\providecommand{\Dsavefieldbody}{}
+\Dprovidelength{\Dusedfieldnamewidth}{0pt}
+\Dprovidelength{\Drealfieldnamewidth}{0pt}
+\providecommand{\Dtabularlistfieldname}[1]{\renewcommand{\Dsavefieldname}{#1}}
+\providecommand{\Dtabularlistfieldbody}[1]{\renewcommand{\Dsavefieldbody}{#1}}
+\Dprovidelength{\Dparskiptemp}{0pt}
+\providecommand{\Dtabularlistfield}[1]{%
+  {%
+    % This only saves field name and field body in \Dsavefieldname and
+    % \Dsavefieldbody, resp.  It does not insert any text into the
+    % document.
+    #1%
+    % Recalculate the real field name width everytime we encounter a
+    % tabular list field because it may have been changed using a
+    % "raw" node.
+    \setlength{\Drealfieldnamewidth}{\Dtabularlistfieldnamewidth}%
+    \addtolength{\Drealfieldnamewidth}{\Dtabularlistfieldnamesep}%
+    \Dmakelistenvironment{%
+      \makebox[\Drealfieldnamewidth][l]{\Dsavefieldname}%
+    }{%
+      \setlength{\labelwidth}{\Drealfieldnamewidth}%
+      \setlength{\leftmargin}{\Drealfieldnamewidth}%
+      \setlength{\rightmargin}{0pt}%
+      \setlength{\labelsep}{0pt}%
+    }{%
+      \item%
+      \settowidth{\Dusedfieldnamewidth}{\Dsavefieldname}%
+      \setlength{\Dparskiptemp}{\parskip}%
+      \ifthenelse{%
+        \lengthtest{\Dusedfieldnamewidth>\Dtabularlistfieldnamewidth}%
+      }{%
+        \mbox{}\par%
+        \setlength{\parskip}{0pt}%
+      }{}%
+      \Dsavefieldbody%
+      \setlength{\parskip}{\Dparskiptemp}%
+      %XXX Why did we need this?
+      %\@finalstrut\@arstrutbox%
+    }%
+    \par%
+  }%
+}
+
+\providecommand{\Dformatfieldname}[1]{\textbf{#1:}}
+\providecommand{\DNfieldlist}[1]{#1}
+\providecommand{\DNfield}[1]{\Dtabularlistfield{#1}}
+\providecommand{\DNfieldname}[1]{%
+  \Dtabularlistfieldname{%
+    \Dformatfieldname{#1}%
+  }%
+}
+\providecommand{\DNfieldbody}[1]{\Dtabularlistfieldbody{#1}}
+
+\providecommand{\Dformatoptiongroup}[1]{%
+  % Format option group, e.g. "-f file, --input file".
+  \texttt{#1}%
+}
+\providecommand{\Dformatoption}[1]{%
+  % Format option, e.g. "-f file".
+  % Put into mbox to avoid line-breaking at spaces.
+  \mbox{#1}%
+}
+\providecommand{\Dformatoptionstring}[1]{%
+  % Format option string, e.g. "-f".
+  #1%
+}
+\providecommand{\Dformatoptionargument}[1]{%
+  % Format option argument, e.g. "file".
+  \textsl{#1}%
+}
+\providecommand{\Dformatoptiondescription}[1]{%
+  % Format option description, e.g.
+  % "\DNparagraph{Read input data from file.}"
+  #1%
+}
+\providecommand{\DNoptionlist}[1]{#1}
+\providecommand{\Doptiongroupjoiner}{,{ }}
+\providecommand{\Disfirstoption}{%
+  % Auxiliary macro indicating if a given option is the first child
+  % of its option group (if it's not, it has to preceded by
+  % \Doptiongroupjoiner).
+  false%
+}
+\providecommand{\DNoptionlistitem}[1]{%
+  \Dtabularlistfield{#1}%
+}
+\providecommand{\DNoptiongroup}[1]{%
+  \renewcommand{\Disfirstoption}{true}%
+  \Dtabularlistfieldname{\Dformatoptiongroup{#1}}%
+}
+\providecommand{\DNoption}[1]{%
+  % If this is not the first option in this option group, add a
+  % joiner.
+  \ifthenelse{\equal{\Disfirstoption}{true}}{%
+    \renewcommand{\Disfirstoption}{false}%
+  }{%
+    \Doptiongroupjoiner%
+  }%
+  \Dformatoption{#1}%
+}
+\providecommand{\DNoptionstring}[1]{\Dformatoptionstring{#1}}
+\providecommand{\DNoptionargument}[1]{{ }\Dformatoptionargument{#1}}
+\providecommand{\DNdescription}[1]{%
+  \Dtabularlistfieldbody{\Dformatoptiondescription{#1}}%
+}
+
+\providecommand{\DNdefinitionlist}[1]{%
+  \begin{description}%
+    \parskip0pt%
+    #1%
+  \end{description}%
+}
+\providecommand{\DNdefinitionlistitem}[1]{%
+  % LaTeX expects the label in square brackets; we provide an empty
+  % label.
+  \item[]#1%
+}
+\providecommand{\Dformatterm}[1]{#1}
+\providecommand{\DNterm}[1]{\hspace{-5pt}\Dformatterm{#1}}
+% I'm still not sure what's the best rendering for classifiers.  The
+% colon syntax is used by reStructuredText, so it's at least WYSIWYG.
+% Use slanted text because italic would cause too much emphasis.
+\providecommand{\Dformatclassifier}[1]{\textsl{#1}}
+\providecommand{\DNclassifier}[1]{~:~\Dformatclassifier{#1}}
+\providecommand{\Dformatdefinition}[1]{#1}
+\providecommand{\DNdefinition}[1]{\par\Dformatdefinition{#1}}
+
+\providecommand{\Dlineblockindentation}{2.5em}
+\providecommand{\DNlineblock}[1]{%
+  \Dmakelistenvironment{}{%
+    \ifthenelse{\equal{\Dparent}{lineblock}}{%
+      % Parent is a line block, so indent.
+      \setlength{\leftmargin}{\Dlineblockindentation}%
+    }{%
+      % At top level; don't indent.
+      \setlength{\leftmargin}{0pt}%
+    }%
+    \setlength{\rightmargin}{0pt}%
+    \setlength{\parsep}{0pt}%
+  }{%
+    #1%
+  }%
+}
+\providecommand{\DNline}[1]{\item#1}
+
+
+\providecommand{\DNtransition}{%
+  \raisebox{0.25em}{\parbox{\linewidth}{\hspace*{\fill}\hrulefill\hrulefill\hspace*{\fill}}}%
+}
+
+
+\providecommand{\Dformatblockquote}[1]{%
+  % Format contents of block quote.
+  % This occurs in block-level context, so we cannot use \textsl.
+  {\slshape#1}%
+}
+\providecommand{\Dformatattribution}[1]{---\textup{#1}}
+\providecommand{\DNblockquote}[1]{%
+  \Dmakebox{%
+    \Dformatblockquote{#1}
+  }%
+}
+\providecommand{\DNattribution}[1]{%
+  \par%
+  \begin{flushright}\Dformatattribution{#1}\end{flushright}%
+}
+
+
+% Sidebars:
+\RequirePackage{picins}
+% Vertical and horizontal margins.
+\Dprovidelength{\Dsidebarvmargin}{0.5em}
+\Dprovidelength{\Dsidebarhmargin}{1em}
+% Padding (space between contents and frame).
+\Dprovidelength{\Dsidebarpadding}{1em}
+% Frame width.
+\Dprovidelength{\Dsidebarframewidth}{2\fboxrule}
+% Position ("l" or "r").
+\providecommand{\Dsidebarposition}{r}
+% Width.
+\Dprovidelength{\Dsidebarwidth}{0.45\linewidth}
+\providecommand{\DNsidebar}[1]{
+  \parpic[\Dsidebarposition]{%
+    \begin{minipage}[t]{\Dsidebarwidth}%
+      % Doing this with nested minipages is ugly, but I haven't found
+      % another way to place vertical space before and after the fbox.
+      \vspace{\Dsidebarvmargin}%
+      {%
+        \setlength{\fboxrule}{\Dsidebarframewidth}%
+        \setlength{\fboxsep}{\Dsidebarpadding}%
+        \fbox{%
+          \begin{minipage}[t]{\linewidth}%
+            \setlength{\parindent}{\Dboxparindent}%
+            #1%
+          \end{minipage}%
+        }%
+      }%
+      \vspace{\Dsidebarvmargin}%
+    \end{minipage}%
+  }%
+}
+
+
+% Citations and footnotes.
+\providecommand{\Dformatfootnote}[1]{%
+  % Format footnote.
+  {%
+    \footnotesize#1%
+    % \par is necessary for LaTeX to adjust baselineskip to the
+    % changed font size.
+    \par%
+  }%
+}
+\providecommand{\Dformatcitation}[1]{\Dformatfootnote{#1}}
+\Dprovidelength{\Doriginalbaselineskip}{0pt}
+\providecommand{\DNfootnotereference}[1]{%
+  {%
+    % \baselineskip is 0pt in \textsuperscript, so we save it here.
+    \setlength{\Doriginalbaselineskip}{\baselineskip}%
+    \textsuperscript{#1}%
+  }%
+}
+\providecommand{\DNcitationreference}[1]{{[}#1{]}}
+\Dprovidelength{\Dfootnotesep}{3.5pt}
+\providecommand{\Dsetfootnotespacing}{%
+  % Spacing commands executed at the beginning of footnotes.
+  \setlength{\parindent}{0pt}%
+  \hspace{1em}%
+}
+\providecommand{\DNfootnote}[1]{%
+  % See ltfloat.dtx for details.
+  {%
+    \insert\footins{%
+      \vspace{\Dfootnotesep}%
+      \Dsetfootnotespacing%
+      \Dformatfootnote{#1}%
+    }%
+  }%
+}
+\providecommand{\DNcitation}[1]{\DNfootnote{#1}}
+\providecommand{\Dformatfootnotelabel}[1]{%
+  % Keep \footnotesize in footnote labels (\textsuperscript would
+  % reduce the font size even more).
+  \textsuperscript{\footnotesize#1{ }}%
+}
+\providecommand{\Dformatcitationlabel}[1]{{[}#1{]}{ }}
+\providecommand{\Dformatmultiplebackrefs}[1]{%
+  % If in printing mode, do not write out multiple backrefs.
+  \ifthenelse{\equal{\Dprinting}{true}}{}{\textsl{#1}}%
+}
+\providecommand{\Dthislabel}{}
+\providecommand{\DNlabel}[1]{%
+  \renewcommand{\Dthislabel}{#1}
+  \ifthenelse{\not\equal{\Dsinglebackref}{}}{%
+    \let\Doriginallabel=\Dthislabel%
+    \def\Dthislabel{%
+      \Dsinglefootnotebacklink{\Dsinglebackref}{\Doriginallabel}%
+    }%
+  }{}%
+  \ifthenelse{\equal{\Dparent}{footnote}}{%
+    % Footnote label.
+    \Dformatfootnotelabel{\Dthislabel}%
+  }{%
+    \ifthenelse{\equal{\Dparent}{citation}}{%
+      % Citation label.
+      \Dformatcitationlabel{\Dthislabel}%
+    }{}%
+  }%
+  % If there are multiple backrefs, add them now.
+  \Dformatmultiplebackrefs{\Dmultiplebackrefs}%
+}
+\providecommand{\Dsinglefootnotebacklink}[2]{%
+  % Create normal backlink of a footnote label.  Parameters:
+  % 1. ID.
+  % 2. Link text.
+  % Treat like a footnote reference.
+  \Dimplicitfootnotereference{\##1}{#2}%
+}
+\providecommand{\Dmultifootnotebacklink}[2]{%
+  % Create generated backlink, as in (1, 2).  Parameters:
+  % 1. ID.
+  % 2. Link text.
+  % Treat like a footnote reference.
+  \Dimplicitfootnotereference{\##1}{#2}%
+}
+\providecommand{\Dsinglecitationbacklink}[2]{\Dsinglefootnotebacklink{#1}{#2}}
+\providecommand{\Dmulticitationbacklink}[2]{\Dmultifootnotebacklink{#1}{#2}}
+
+
+\RequirePackage{longtable}
+\providecommand{\Dmaketable}[2]{%
+  % Make table.  Parameters:
+  % 1. Table spec (like "|p|p|").
+  % 2. Table contents.
+  {%
+    \renewcommand{\Dinsidetabular}{true}%
+    \begin{longtable}{#1}%
+      \hline%
+      #2%
+    \end{longtable}%
+  }%
+}
+\providecommand{\DNthead}[1]{%
+  #1%
+  \endhead%
+}
+\providecommand{\DNrow}[1]{%
+  #1\tabularnewline%
+  \hline%
+}
+\providecommand{\Dcolspan}[2]{%
+  % Take care of the morecols attribute (but incremented by 1).
+  &\multicolumn{#1}{l|}{#2}%
+}
+\providecommand{\Dcolspanleft}[2]{%
+  % Like \Dmorecols, but called for the leftmost entries in a table
+  % row.
+  \multicolumn{#1}{|l|}{#2}%
+}
+\providecommand{\Dsubsequententry}[1]{%
+  &#1%
+}
+% \DNentry is not used because we set the ampersand ("&") in the
+% \DAcolspan... macros.
+\providecommand{\DAtableheaderentry}[5]{\Dformattableheaderentry{#5}}
+\providecommand{\Dformattableheaderentry}[1]{{\bfseries#1}}
+
+
+\providecommand{\DNsystemmessage}[1]{%
+  {%
+    \ifthenelse{\equal{\Dprinting}{false}}{\color{red}}{}%
+    \bfseries%
+    #1%
+  }%
+}
+
+
+\providecommand{\Dinsidehalign}{false}
+\newsavebox{\Dalignedimagebox}
+\Dprovidelength{\Dalignedimagewidth}{0pt}
+\providecommand{\Dhalign}[2]{%
+  % Horizontally align the contents to the left or right so that the
+  % text flows around it.
+  % Parameters:
+  % 1. l or r
+  % 2. Contents.
+  \renewcommand{\Dinsidehalign}{true}%
+  % For some obscure reason \parpic consumes some vertical space.
+  \vspace{-3pt}%
+  % Now we do something *really* ugly, but this enables us to wrap the
+  % image in a minipage while still allowing tight frames when
+  % class=border (see \DNimageCborder).
+  \sbox{\Dalignedimagebox}{#2}%
+  \settowidth{\Dalignedimagewidth}{\usebox{\Dalignedimagebox}}%
+  \parpic[#1]{%
+    \begin{minipage}[b]{\Dalignedimagewidth}%
+      % Compensate for previously added space, but not entirely.
+      \vspace*{2.0pt}%
+      \vspace*{\Dfloatimagetopmargin}%
+      \usebox{\Dalignedimagebox}%
+      \vspace*{1.5pt}%
+      \vspace*{\Dfloatimagebottommargin}%
+    \end{minipage}%
+  }%
+  \renewcommand{\Dinsidehalign}{false}%
+}
+
+
+\RequirePackage{graphicx}
+% Maximum width of an image.
+\providecommand{\Dimagemaxwidth}{\linewidth}
+\providecommand{\Dfloatimagemaxwidth}{0.5\linewidth}
+% Auxiliary variable.
+\Dprovidelength{\Dcurrentimagewidth}{0pt}
+\providecommand{\DNimageAalign}[5]{%
+  \ifthenelse{\equal{#3}{left}}{%
+    \Dhalign{l}{#5}%
+  }{%
+    \ifthenelse{\equal{#3}{right}}{%
+      \Dhalign{r}{#5}%
+    }{%
+      \ifthenelse{\equal{#3}{center}}{%
+        % Text floating around centered figures is a bad idea.  Thus
+        % we use a center environment.  Note that no extra space is
+        % added by the writer, so the space added by the center
+        % environment is fine.
+        \begin{center}#5\end{center}%
+      }{%
+        #5%
+      }%
+    }%
+  }%
+}
+% Base path for images.
+\providecommand{\Dimagebase}{}
+% Auxiliary command.  Current image path.
+\providecommand{\Dimagepath}{}
+\providecommand{\DNimageAuri}[5]{%
+  % Insert image.  We treat the URI like a path here.
+  \renewcommand{\Dimagepath}{\Dimagebase#3}%
+  \Difdefined{DcurrentNimageAwidth}{%
+    \Dwidthimage{\DcurrentNimageAwidth}{\Dimagepath}%
+  }{%
+    \Dsimpleimage{\Dimagepath}%
+  }%
+}
+\Dprovidelength{\Dfloatimagevmargin}{0pt}
+\providecommand{\Dfloatimagetopmargin}{\Dfloatimagevmargin}
+\providecommand{\Dfloatimagebottommargin}{\Dfloatimagevmargin}
+\providecommand{\Dwidthimage}[2]{%
+  % Image with specified width.
+  % Parameters:
+  % 1. Image width.
+  % 2. Image path.
+  % Need to make bottom-alignment dependent on align attribute (add
+  % functional test first).  Need to observe height attribute.
+  %\begin{minipage}[b]{#1}%
+    \includegraphics[width=#1,height=\textheight,keepaspectratio]{#2}%
+  %\end{minipage}%
+}  
+\providecommand{\Dcurrentimagemaxwidth}{}
+\providecommand{\Dsimpleimage}[1]{%
+  % Insert image, without much parametrization.
+  \settowidth{\Dcurrentimagewidth}{\includegraphics{#1}}%
+  \ifthenelse{\equal{\Dinsidehalign}{true}}{%
+    \renewcommand{\Dcurrentimagemaxwidth}{\Dfloatimagemaxwidth}%
+  }{%
+    \renewcommand{\Dcurrentimagemaxwidth}{\Dimagemaxwidth}%
+  }%
+  \ifthenelse{\lengthtest{\Dcurrentimagewidth>\Dcurrentimagemaxwidth}}{%
+    \Dwidthimage{\Dcurrentimagemaxwidth}{#1}%
+  }{%
+    \Dwidthimage{\Dcurrentimagewidth}{#1}%
+  }%
+}
+\providecommand{\Dwidthimage}[2]{%
+  % Image with specified width.
+  % Parameters:
+  % 1. Image width.
+  % 2. Image path.
+  \Dwidthimage{#1}{#2}%
+}
+
+% Figures.
+\providecommand{\DNfigureAalign}[5]{%
+  % Hack to make it work Right Now.
+  %\def\DcurrentNimageAwidth{\DcurrentNfigureAwidth}%
+  %
+    %\def\DcurrentNimageAwidth{\linewidth}%
+    \DNimageAalign{#1}{#2}{#3}{#4}{%
+      \begin{minipage}[b]{0.4\linewidth}#5\end{minipage}}%
+    %\let\DcurrentNimageAwidth=\relax%
+  %
+  %\let\DcurrentNimageAwidth=\relax%
+}
+\providecommand{\DNcaption}[1]{\par\noindent{\slshape#1}}
+\providecommand{\DNlegend}[1]{\Dauxiliaryspace#1}
+
+\providecommand{\DCborder}[1]{\fbox{#1}}
+% No padding between image and border.
+\providecommand{\DNimageCborder}[1]{\frame{#1}}
+
+
+% Need to replace with language-specific stuff.  Maybe look at
+% csquotes.sty and ask the author for permission to use parts of it.
+\providecommand{\Dtextleftdblquote}{``}
+\providecommand{\Dtextrightdblquote}{''}
+
+% Table of contents:
+\Dprovidelength{\Dtocininitialsectnumwidth}{2.4em}
+\Dprovidelength{\Dtocadditionalsectnumwidth}{0.7em}
+% Level inside a table of contents.  While this is at -1, we are not
+% inside a TOC.
+\Dprovidecounter{Dtoclevel}%
+\setcounter{Dtoclevel}{-1}
+\providecommand{\Dlocaltoc}{false}%
+\providecommand{\DNtopicClocal}[1]{%
+  \renewcommand{\Dlocaltoc}{true}%
+  \addtolength{\Dtocsectnumwidth}{2\Dtocadditionalsectnumwidth}%
+  \addtolength{\Dtocindent}{-2\Dtocadditionalsectnumwidth}%
+  #1%
+  \addtolength{\Dtocindent}{2\Dtocadditionalsectnumwidth}%
+  \addtolength{\Dtocsectnumwidth}{-2\Dtocadditionalsectnumwidth}%
+  \renewcommand{\Dlocaltoc}{false}%
+}
+\Dprovidelength{\Dtocindent}{0pt}%
+\Dprovidelength{\Dtocsectnumwidth}{\Dtocininitialsectnumwidth}
+% Compensate for one additional TOC indentation space so that the
+% top-level is unindented.
+\addtolength{\Dtocsectnumwidth}{-\Dtocadditionalsectnumwidth}
+\addtolength{\Dtocindent}{-\Dtocsectnumwidth}
+\providecommand{\Difinsidetoc}[2]{%
+  \ifthenelse{\not\equal{\theDtoclevel}{-1}}{#1}{#2}%
+}
+\providecommand{\DNgeneratedCsectnum}[1]{%
+  \Difinsidetoc{%
+    % Section number inside TOC.
+    \makebox[\Dtocsectnumwidth][l]{#1}%
+  }{%
+    % Section number inside section title.
+    #1\quad%
+  }%
+}
+\providecommand{\Dtocbulletlist}[1]{%
+  \addtocounter{Dtoclevel}{1}%
+  \addtolength{\Dtocindent}{\Dtocsectnumwidth}%
+  \addtolength{\Dtocsectnumwidth}{\Dtocadditionalsectnumwidth}%
+  #1%
+  \addtolength{\Dtocsectnumwidth}{-\Dtocadditionalsectnumwidth}%
+  \addtolength{\Dtocindent}{-\Dtocsectnumwidth}%
+  \addtocounter{Dtoclevel}{-1}%
+}
+
+
+% For \Dpixelunit, the length value is pre-multiplied with 0.75, so by
+% specifying "pt" we get the same notion of "pixel" as graphicx.
+\providecommand{\Dpixelunit}{pt}
+% Normally lengths are relative to the current linewidth.
+\providecommand{\Drelativeunit}{\linewidth}
+
+
+%\RequirePackage{fixmath}
+%\RequirePackage{amsmath}
+
+
+\DSfontencoding
+\DSlanguage
+\DSlinks
+\DSsymbols
+\DSlate
+
+\makeatother
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/doc/stylesheets/style.tex	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,74 @@
+% latex include file for docutils latex writer
+% --------------------------------------------
+%
+% CVS: $Id: style.tex 2548 2004-08-29 20:04:53Z felixwiemann $
+%
+% This is included at the end of the latex header in the generated file,
+% to allow overwriting defaults, although this could get hairy.
+% Generated files should process well standalone too, LaTeX might give a
+% message about a missing file.
+
+% donot indent first line of paragraph.
+\setlength{\parindent}{0pt}
+\setlength{\parskip}{5pt plus 2pt minus 1pt}
+
+% sloppy
+% ------
+% Less strict (opposite to default fussy) space size between words. Therefore
+% less hyphenation.
+\sloppy
+
+% fonts
+% -----
+% times for pdf generation, gives smaller pdf files.
+%
+% But in standard postscript fonts: courier and times/helvetica do not fit.
+% Maybe use pslatex.
+\usepackage{times}
+
+% pagestyle
+% ---------
+% headings might put section titles in the page heading, but not if
+% the table of contents is done by docutils.
+% If pagestyle{headings} is used, \geometry{headheight=10pt,headsep=1pt}
+% should be set too.
+%\pagestyle{plain}
+%
+% or use fancyhdr (untested !)
+%\usepackage{fancyhdr}
+%\pagestyle{fancy}
+%\addtolength{\headheight}{\\baselineskip}
+%\renewcommand{\sectionmark}[1]{\markboth{#1}{}}
+%\renewcommand{\subsectionmark}[1]{\markright{#1}}
+%\fancyhf{}
+%\fancyhead[LE,RO]{\\bfseries\\textsf{\Large\\thepage}}
+%\fancyhead[LO]{\\textsf{\\footnotesize\\rightmark}}
+%\fancyhead[RE]{\\textsc{\\textsf{\\footnotesize\leftmark}}}
+%\\fancyfoot[LE,RO]{\\bfseries\\textsf{\scriptsize Docutils}}
+%\fancyfoot[RE,LO]{\\textsf{\scriptsize\\today}}
+
+% geometry 
+% --------
+% = papersizes and margins
+%\geometry{a4paper,twoside,tmargin=1.5cm,
+%          headheight=1cm,headsep=0.75cm}
+
+% Do section number display
+% -------------------------
+%\makeatletter
+%\def\@seccntformat#1{}
+%\makeatother
+% no numbers in toc
+%\renewcommand{\numberline}[1]{}
+
+
+% change maketitle
+% ----------------
+%\renewcommand{\maketitle}{
+%  \begin{titlepage}
+%    \begin{center}
+%    \textsf{TITLE \@title} \\
+%       Date: \today
+%    \end{center}
+%  \end{titlepage}
+%}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/e2etests/common/hanoi.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,154 @@
+# Animated Towers of Hanoi using Tk with optional bitmap file in
+# background.
+#
+# Usage: tkhanoi [n [bitmapfile]]
+#
+# n is the number of pieces to animate; default is 4, maximum 15.
+#
+# The bitmap file can be any X11 bitmap file (look in
+# /usr/include/X11/bitmaps for samples); it is displayed as the
+# background of the animation.  Default is no bitmap.
+
+# This uses Steen Lumholt's Tk interface
+from Tkinter import *
+
+
+# Basic Towers-of-Hanoi algorithm: move n pieces from a to b, using c
+# as temporary.  For each move, call report()
+def hanoi(n, a, b, c, report):
+	if n <= 0: return
+	hanoi(n-1, a, c, b, report)
+	report(n, a, b)
+	hanoi(n-1, c, b, a, report)
+
+
+# The graphical interface
+class Tkhanoi:
+
+	# Create our objects
+	def __init__(self, n, bitmap = None):
+		self.n = n
+		self.tk = tk = Tk()
+		self.canvas = c = Canvas(tk)
+		c.pack()
+		width, height = tk.getint(c['width']), tk.getint(c['height'])
+
+		# Add background bitmap
+		if bitmap:
+			self.bitmap = c.create_bitmap(width/2, height/2,
+						      bitmap=bitmap,
+						      foreground='blue')
+
+		# Generate pegs
+		pegwidth = 10
+		pegheight = height/2
+		pegdist = width/3
+		x1, y1 = (pegdist-pegwidth)/2, height*1/3
+		x2, y2 = x1+pegwidth, y1+pegheight
+		self.pegs = []
+		p = c.create_rectangle(x1, y1, x2, y2, fill='black')
+		self.pegs.append(p)
+		x1, x2 = x1+pegdist, x2+pegdist
+		p = c.create_rectangle(x1, y1, x2, y2, fill='black')
+		self.pegs.append(p)
+		x1, x2 = x1+pegdist, x2+pegdist
+		p = c.create_rectangle(x1, y1, x2, y2, fill='black')
+		self.pegs.append(p)
+		self.tk.update()
+
+		# Generate pieces
+		pieceheight = pegheight/16
+		maxpiecewidth = pegdist*2/3
+		minpiecewidth = 2*pegwidth
+		self.pegstate = [[], [], []]
+		self.pieces = {}
+		x1, y1 = (pegdist-maxpiecewidth)/2, y2-pieceheight-2
+		x2, y2 = x1+maxpiecewidth, y1+pieceheight
+		dx = (maxpiecewidth-minpiecewidth) / (2*max(1, n-1))
+		for i in range(n, 0, -1):
+			p = c.create_rectangle(x1, y1, x2, y2, fill='red')
+			self.pieces[i] = p
+			self.pegstate[0].append(i)
+			x1, x2 = x1 + dx, x2-dx
+			y1, y2 = y1 - pieceheight-2, y2-pieceheight-2
+			self.tk.update()
+			self.tk.after(25)
+
+	# Run -- never returns
+	def run(self):
+		while 1:
+			hanoi(self.n, 0, 1, 2, self.report)
+			hanoi(self.n, 1, 2, 0, self.report)
+			hanoi(self.n, 2, 0, 1, self.report)
+			hanoi(self.n, 0, 2, 1, self.report)
+			hanoi(self.n, 2, 1, 0, self.report)
+			hanoi(self.n, 1, 0, 2, self.report)
+
+	# Reporting callback for the actual hanoi function
+	def report(self, i, a, b):
+		if self.pegstate[a][-1] != i: raise RuntimeError # Assertion
+		del self.pegstate[a][-1]
+		p = self.pieces[i]
+		c = self.canvas
+
+		# Lift the piece above peg a
+		ax1, ay1, ax2, ay2 = c.bbox(self.pegs[a])
+		while 1:
+			x1, y1, x2, y2 = c.bbox(p)
+			if y2 < ay1: break
+			c.move(p, 0, -1)
+			self.tk.update()
+
+		# Move it towards peg b
+		bx1, by1, bx2, by2 = c.bbox(self.pegs[b])
+		newcenter = (bx1+bx2)/2
+		while 1:
+			x1, y1, x2, y2 = c.bbox(p)
+			center = (x1+x2)/2
+			if center == newcenter: break
+			if center > newcenter: c.move(p, -1, 0)
+			else: c.move(p, 1, 0)
+			self.tk.update()
+
+		# Move it down on top of the previous piece
+		pieceheight = y2-y1
+		newbottom = by2 - pieceheight*len(self.pegstate[b]) - 2
+		while 1:
+			x1, y1, x2, y2 = c.bbox(p)
+			if y2 >= newbottom: break
+			c.move(p, 0, 1)
+			self.tk.update()
+
+		# Update peg state
+		self.pegstate[b].append(i)
+
+
+# Main program
+def main():
+	import sys, string
+
+	# First argument is number of pegs, default 4
+	if sys.argv[1:]:
+		n = string.atoi(sys.argv[1])
+	else:
+		n = 4
+
+	# Second argument is bitmap file, default none
+	if sys.argv[2:]:
+		bitmap = sys.argv[2]
+		# Reverse meaning of leading '@' compared to Tk
+		if bitmap[0] == '@': bitmap = bitmap[1:]
+		else: bitmap = '@' + bitmap
+	else:
+		bitmap = None
+
+	# Create the graphical objects...
+	h = Tkhanoi(n, bitmap)
+
+	# ...and run!
+	h.run()
+
+
+# Call main when run as script
+if __name__ == '__main__':
+	main()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/e2etests/common/maketests.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,51 @@
+#!/usr/bin/env python
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 1999, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+import sys, string, os
+if sys.platform[:3] == 'win':
+    stripopts = ('',)
+    consoleopts = ('', '--noconsole')
+else:
+    stripopts = ('', '--strip')
+    consoleopts = ('',)
+if string.find(sys.executable, ' ') > -1:
+    exe = '"%s"' % sys.executable
+else:
+    exe = sys.executable
+if sys.platform[:3] == 'win':
+    spec = "%s ../../Makespec.py --tk %%s %%s %%s %%s %%s --out t%%d hanoi.py" % exe
+    bld = "%s ../../Build.py t%%d/hanoi.spec" % exe
+else:
+    spec = "%s ../../Makespec.py --tk %%s %%s %%s %%s %%s --out /u/temp/t%%d hanoi.py" % exe
+    bld = "%s ../../Build.py /u/temp/t%%d/hanoi.spec" % exe
+
+i = 0
+for bldconfig in ('--onedir', '--onefile'):
+    for console in consoleopts:
+        for dbg in ('--debug', ''):
+            for stripopt in stripopts:
+                for upxopt in ('', '--upx'):
+                    cmd = spec % (bldconfig, console, dbg, stripopt, upxopt, i)
+                    os.system(cmd)
+                    os.system(bld % i)
+                    if sys.platform[:5] == 'linux':
+                        if bldconfig == '--onedir':
+                            os.system("ln -s /u/temp/t%d/disthanoi/hanoi hanoi%d" % (i,i))
+                        else:
+                            os.system("ln -s /u/temp/t%d/hanoi hanoi%d" % (i,i))
+                    i += 1
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/e2etests/win32/NextID.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,79 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 1999, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+#import pythoncom
+pycomCLSCTX_INPROC = 3
+pycomCLSCTX_LOCAL_SERVER = 4
+import os
+d = {}
+
+class NextID:
+    _reg_clsid_ = '{25E06E61-2D18-11D5-945F-00609736B700}'
+    _reg_desc_ = 'Text COM server'
+    _reg_progid_ = 'MEInc.NextID'
+    _reg_clsctx_ = pycomCLSCTX_INPROC | pycomCLSCTX_LOCAL_SERVER
+    _public_methods_ = [
+        'getNextID'
+        ]
+    def __init__(self):
+        import win32api
+        win32api.MessageBox(0, "NextID.__init__ started", "NextID.py")
+        global d
+        if sys.frozen:
+            for entry in sys.path:
+                if entry.find('?') > -1:
+                    here = os.path.dirname(entry.split('?')[0])
+                    break
+            else:
+                here = os.getcwd()
+        else:
+            here = os.path.dirname(__file__)
+        self.fnm = os.path.join(here, 'id.cfg')
+        try:
+            d = eval(open(self.fnm, 'r').read()+'\n')
+        except:
+            d = {
+                'systemID': 0xaaaab,
+                'highID': 0
+            }
+        win32api.MessageBox(0, "NextID.__init__ complete", "NextID.py")
+    def getNextID(self):
+        global d
+        d['highID'] = d['highID'] + 1
+        open(self.fnm, 'w').write(repr(d))
+        return '%(systemID)-0.5x%(highID)-0.7x' % d
+
+def RegisterNextID():
+    from win32com.server import register
+    register.UseCommandLine(NextID)
+
+def UnRegisterNextID():
+    from win32com.server import register
+    register.UnregisterServer(NextID._reg_clsid_, NextID._reg_progid_)
+
+if __name__ == '__main__':
+    import sys
+    if "/unreg" in sys.argv:
+        UnRegisterNextID()
+    elif "/register" in sys.argv:
+        RegisterNextID()
+    else:
+        print "running as server"
+        import win32com.server.localserver
+        win32com.server.localserver.main()
+        raw_input("Press any key...")
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/e2etests/win32/readme.txt	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,23 @@
+NextID.py
+
+  ../../MakeCOMServer.py [options] NextID.py
+  ../../Build.py DriveNextID.spec
+  distdriveNextID\driveNextID --register
+  testNextID.vbs
+  python
+  >>> import win32com.client
+  >>> import pythoncom
+  >>> o = win32com.client.Dispatch('MEInc.NextID', clsctx = pythoncom.CLSCTX_LOCAL_SERVER)
+  >>> o.getNextID()
+  'aaaab0000003'
+  >>> ^Z
+  distdriveNextID\driveNextID --unregister
+
+the others:
+
+  ../../Makespec [options] <script>
+  <run it>
+  <run it again - esp the genpy stuff>
+
+The shell stuff doesn't work on my W2k box (permissions) or NT (old shell, old extensions).
+testEnsureDispatch doesn't work under old versions (no EnsureDispatch).
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/e2etests/win32/testEnsureDispatch.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,9 @@
+# for older Pythons, we need to set up for the import of cPickle
+import string
+import copy_reg
+
+import win32com.client.gencache
+x = win32com.client.gencache.EnsureDispatch('ADOR.Recordset')
+print x
+x = None
+#raw_input("Press any key to continue...")
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/e2etests/win32/testMSOffice.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,199 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 1999, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+
+# Test MSOffice
+#
+# Main purpose of test is to ensure that Dynamic COM objects
+# work as expected.
+
+# Assumes Word and Excel installed on your machine.
+
+import win32com, sys, string, win32api, traceback
+import win32com.client.dynamic
+from win32com.test.util import CheckClean
+import pythoncom
+from win32com.client import gencache
+from pywintypes import Unicode
+
+error = "MSOffice test error"
+
+# Test a few of the MSOffice components.
+def TestWord():
+	# Try and load the object exposed by Word 8
+	# Office 97 - _totally_ different object model!
+	try:
+		# NOTE - using "client.Dispatch" would return an msword8.py instance!
+		print "Starting Word 8 for dynamic test"
+		word = win32com.client.dynamic.Dispatch("Word.Application")
+		TestWord8(word)
+
+		word = None
+		# Now we will test Dispatch without the new "lazy" capabilities
+		print "Starting Word 8 for non-lazy dynamic test"
+		dispatch = win32com.client.dynamic._GetGoodDispatch("Word.Application")
+		typeinfo = dispatch.GetTypeInfo()
+		attr = typeinfo.GetTypeAttr()
+		olerepr = win32com.client.build.DispatchItem(typeinfo, attr, None, 0)
+		word = win32com.client.dynamic.CDispatch(dispatch, olerepr)
+		dispatch = typeinfo = attr = olerepr = None
+		TestWord8(word)
+
+	except pythoncom.com_error:
+		print "Starting Word 7 for dynamic test"
+		word = win32com.client.Dispatch("Word.Basic")
+		TestWord7(word)
+
+	try:
+		print "Starting MSWord for generated test"
+		# Typelib, lcid, major and minor for the typelib
+		try:
+			o = gencache.EnsureModule("{00020905-0000-0000-C000-000000000046}", 1033, 8, 0, bForDemand=1)
+		except TypeError:
+			o = gencache.EnsureModule("{00020905-0000-0000-C000-000000000046}", 1033, 8, 0)
+		if o is None :
+			raise ImportError, "Can not load the Word8 typelibrary."
+		word = win32com.client.Dispatch("Word.Application.8")
+		TestWord8(word)
+	except ImportError, details:
+		print "Can not test MSWord8 -", details
+
+def TestWord7(word):
+	word.FileNew()
+	# If not shown, show the app.
+	if not word.AppShow(): word._proc_("AppShow")
+
+	for i in xrange(12):
+		word.FormatFont(Color=i+1, Points=i+12)
+		word.Insert("Hello from Python %d\n" % i)
+
+	word.FileClose(2)
+
+def TestWord8(word):
+	word.Visible = 1
+	doc = word.Documents.Add()
+	wrange = doc.Range()
+	for i in range(10):
+		wrange.InsertAfter("Hello from Python %d\n" % i)
+	paras = doc.Paragraphs
+	for i in range(len(paras)):
+		paras[i]().Font.ColorIndex = i+1
+		paras[i]().Font.Size = 12 + (4 * i)
+	# XXX - note that
+	# for para in paras:
+	# 	para().Font...
+	# doesnt seem to work - no error, just doesnt work
+	# Should check if it works for VB!
+	doc.Close(SaveChanges = 0)
+	word.Quit()
+	win32api.Sleep(1000) # Wait for word to close, else we
+	# may get OA error.
+
+def TestWord8OldStyle():
+	try:
+		import win32com.test.Generated4Test.msword8
+	except ImportError:
+		print "Can not do old style test"
+
+
+def TextExcel(xl):
+	xl.Visible = 0
+	if xl.Visible: raise error, "Visible property is true."
+	xl.Visible = 1
+	if not xl.Visible: raise error, "Visible property not true."
+
+	if int(xl.Version[0])>=8:
+		xl.Workbooks.Add()
+	else:
+		xl.Workbooks().Add()
+
+
+	xl.Range("A1:C1").Value = (1,2,3)
+	xl.Range("A2:C2").Value = ('x','y','z')
+	xl.Range("A3:C3").Value = ('3','2','1')
+
+	for i in xrange(20):
+		xl.Cells(i+1,i+1).Value = "Hi %d" % i
+
+	if xl.Range("A1").Value <> "Hi 0":
+		raise error, "Single cell range failed"
+
+	if xl.Range("A1:B1").Value <> ((Unicode("Hi 0"),2),):
+		raise error, "flat-horizontal cell range failed"
+
+	if xl.Range("A1:A2").Value <> ((Unicode("Hi 0"),),(Unicode("x"),)):
+		raise error, "flat-vertical cell range failed"
+
+	if xl.Range("A1:C3").Value <> ((Unicode("Hi 0"),2,3),(Unicode("x"),Unicode("Hi 1"),Unicode("z")),(3,2,Unicode("Hi 2"))):
+		raise error, "square cell range failed"
+
+	xl.Range("A1:C3").Value =((3,2,1),("x","y","z"),(1,2,3))
+
+	if xl.Range("A1:C3").Value  <> ((3,2,1),(Unicode("x"),Unicode("y"),Unicode("z")),(1,2,3)):
+		raise error, "Range was not what I set it to!"
+
+	# test dates out with Excel
+	xl.Cells(5,1).Value = "Excel time"
+	xl.Cells(5,2).Formula = "=Now()"
+
+	import time
+	xl.Cells(6,1).Value = "Python time"
+	xl.Cells(6,2).Value = pythoncom.MakeTime(time.time())
+	xl.Cells(6,2).NumberFormat = "d/mm/yy h:mm"
+	xl.Columns("A:B").EntireColumn.AutoFit()
+
+	xl.Workbooks(1).Close(0)
+	xl.Quit()
+
+def TestAll():
+	try:
+		TestWord()
+
+		print "Starting Excel for Dynamic test..."
+		xl = win32com.client.dynamic.Dispatch("Excel.Application")
+		TextExcel(xl)
+
+		try:
+			print "Starting Excel 8 for generated excel8.py test..."
+			try:
+				mod = gencache.EnsureModule("{00020813-0000-0000-C000-000000000046}", 0, 1, 2, bForDemand=1)
+			except TypeError:
+				mod = gencache.EnsureModule("{00020813-0000-0000-C000-000000000046}", 0, 1, 2)
+			xl = win32com.client.Dispatch("Excel.Application")
+			TextExcel(xl)
+		except ImportError:
+			print "Could not import the generated Excel 97 wrapper"
+
+		try:
+			import xl5en32
+			mod = gencache.EnsureModule("{00020813-0000-0000-C000-000000000046}", 9, 1, 0)
+			xl = win32com.client.Dispatch("Excel.Application.5")
+			print "Starting Excel 95 for makepy test..."
+			TextExcel(xl)
+		except ImportError:
+			print "Could not import the generated Excel 95 wrapper"
+
+	except KeyboardInterrupt:
+		print "*** Interrupted MSOffice test ***"
+	except:
+		traceback.print_exc()
+
+if __name__=='__main__':
+	TestAll()
+	CheckClean()
+	pythoncom.CoUninitialize()
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/e2etests/win32/testNextID.vbs	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,9 @@
+WScript.Echo "Starting..."
+set ob = CreateObject("MEInc.NextID")
+WScript.Echo "created MEInc.NextID object"
+dim num
+num = ob.getNextID()
+WScript.Echo "Got " + num
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/e2etests/win32/testcomext.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,61 @@
+#! /usr/bin/env python
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 1999, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+from win32com.shell import shell
+import win32api
+import pythoncom
+import os
+import sys
+
+def CreateShortCut(Path, Target,Arguments = "", StartIn = "", Icon = ("",0), Description = ""):
+    # Get the shell interface.
+    sh = pythoncom.CoCreateInstance(shell.CLSID_ShellLink, None, \
+        pythoncom.CLSCTX_INPROC_SERVER, shell.IID_IShellLink)
+
+    # Get an IPersist interface
+    persist = sh.QueryInterface(pythoncom.IID_IPersistFile)
+
+    # Set the data
+    sh.SetPath(Target)
+    sh.SetDescription(Description)
+    sh.SetArguments(Arguments)
+    sh.SetWorkingDirectory(StartIn)
+    sh.SetIconLocation(Icon[0],Icon[1])
+#    sh.SetShowCmd( win32con.SW_SHOWMINIMIZED)
+
+    # Save the link itself.
+    persist.Save(Path, 1)
+    print "Saved to", Path
+
+if __name__ == "__main__":
+    try:
+        TempDir = os.environ["TEMP"]
+        WinRoot = os.environ["windir"]
+
+        Path        =  TempDir
+        Target      =  os.path.normpath(sys.executable)
+        Arguments   =  ""
+        StartIn     =  TempDir
+        Icon        = ("", 0)
+        Description = "py made shortcut"
+
+        CreateShortCut(Path,Target,Arguments,StartIn,Icon,Description)
+    except Exception, e:
+        print "Failed!", e
+        import traceback
+        traceback.print_exc()
+    raw_input("Press any key to continue...")
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/__init__.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,18 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+# empty
Binary file srcanamdw/codescanner/pyinstaller/hooks/__init__.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-DateTime.mxDateTime.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,17 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+attrs = [('__version__', '1.3.0')]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-DateTime.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,17 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+hiddenimports = ['ISO', 'ARPA', 'ODMG', 'Locale', 'Feasts', 'Parser', 'NIST']
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-Image.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,33 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+hiddenimports = []
+
+def install_Image(lis):
+    import Image
+    # PIL uses lazy initialization.
+    # you candecide if you want only the
+    # default stuff:
+    Image.preinit()
+    # or just everything:
+    Image.init()
+    import sys
+    for name in sys.modules:
+        if name[-11:] == "ImagePlugin":
+            lis.append(name)
+
+install_Image(hiddenimports)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-PIL.Image.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,41 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+hiddenimports = []
+
+# FIXME: for a strange bug in Python's import machinery, we need to adjust
+# the module name before proceeding to the PIL import. The name would
+# otherwise be "hooks.hook-PIL.Image", which will then produce this
+# monstruosity:
+#   <module 'hooks.hook-PIL.PIL.Image' from 'C:\python24\lib\site-packages\PIL\Image.pyc'>
+#
+__name__ = "hook-image"
+
+def install_Image(lis):
+    import Image
+    # PIL uses lazy initialization.
+    # you candecide if you want only the
+    # default stuff:
+    Image.preinit()
+    # or just everything:
+    Image.init()
+    import sys
+    for name in sys.modules:
+        if name[-11:] == "ImagePlugin":
+            lis.append(name)
+
+install_Image(hiddenimports)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-PIL.SpiderImagePlugin.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,28 @@
+# Copyright (C) 2006, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+# PIL's SpiderImagePlugin features a tkPhotoImage() method which imports
+# ImageTk (and thus brings the whole Tcl/Tk library in).
+# We cheat a little and remove the ImageTk import: I assume that if people
+# are really using ImageTk in their application, they will also import it
+# directly.
+def hook(mod):
+    for i in range(len(mod.imports)):
+        if mod.imports[i][0] == "ImageTk":
+            del mod.imports[i]
+            break
+    return mod
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-_sre.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,17 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+hiddenimports = ['copy_reg']
Binary file srcanamdw/codescanner/pyinstaller/hooks/hook-_sre.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-anydbm.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,19 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+#anydbm
+hiddenimports = ['dbhash', 'gdbm', 'dbm', 'dumbdbm']
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-cPickle.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,17 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+hiddenimports = ['copy_reg', 'types', 'string']
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-cStringIO.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,17 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+hiddenimports = ['copy_reg']
Binary file srcanamdw/codescanner/pyinstaller/hooks/hook-cStringIO.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-carchive.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,25 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+import sys
+
+def hook(mod):
+    if sys.version[0] > '1':
+        for i in range(len(mod.imports)-1, -1, -1):
+            if mod.imports[i][0] == 'strop':
+                del mod.imports[i]
+    return mod
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-codecs.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,17 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+hiddenimports = ['encodings']
Binary file srcanamdw/codescanner/pyinstaller/hooks/hook-codecs.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-dns.rdata.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,21 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+hiddenimports = [
+    "dns.rdtypes.*",
+    "dns.rdtypes.ANY.*"
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-encodings.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,29 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+#encodings',
+attrs = [('search_function',0)]
+
+import os, sys, glob
+from distutils import sysconfig
+hiddenimports = []
+libpath = sysconfig.get_python_lib(plat_specific=0, standard_lib=1)
+for f in glob.glob(os.path.join(libpath, "encodings", "*.py")):
+    f = os.path.basename(f)
+    f = os.path.splitext(f)[0]
+    if f != "__init__":
+        hiddenimports.append(f)
Binary file srcanamdw/codescanner/pyinstaller/hooks/hook-encodings.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-gtk.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,7 @@
+#
+
+#Submited by Seth Remington (ticket#15)
+
+hiddenimports = ['pango', 'atk', 'gobject', 'gtk.glade']
+
+#
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-iu.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,39 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+import sys, string
+
+def hook(mod):
+    names = sys.builtin_module_names
+    if 'posix' in names:
+        removes = ['nt', 'dos', 'os2', 'mac', 'win32api']
+    elif 'nt' in names:
+        removes = ['dos', 'os2', 'mac']
+    elif 'os2' in names:
+        removes = ['nt', 'dos', 'mac', 'win32api']
+    elif 'dos' in names:
+        removes = ['nt', 'os2', 'mac', 'win32api']
+    elif 'mac' in names:
+        removes = ['nt', 'dos', 'os2', 'win32api']
+    for i in range(len(mod.imports)-1, -1, -1):
+        nm = mod.imports[i][0]
+        pos = string.find(nm, '.')
+        if pos > -1:
+            nm = nm[:pos]
+        if nm in removes:
+            del mod.imports[i]
+    return mod
+
Binary file srcanamdw/codescanner/pyinstaller/hooks/hook-iu.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-kinterbasdb.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,25 @@
+# Copyirght (C) 2005, Eugene Prigorodov
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+# Courtesy of Eugene Prigorodov <eprigorodov at naumen dot ru>
+
+#kinterbasdb
+hiddenimports = ['k_exceptions', 'services', 'typeconv_naked',
+                 'typeconv_backcompat', 'typeconv_23plus',
+                 'typeconv_datetime_stdlib', 'typeconv_datetime_mx',
+                 'typeconv_datetime_naked', 'typeconv_fixed_fixedpoint',
+                 'typeconv_fixed_stdlib',  'typeconv_text_unicode',
+                 'typeconv_util_isinstance', '_kinterbasdb', '_kiservices']
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-os.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,44 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+import sys, string
+
+def hook(mod):
+    names = sys.builtin_module_names
+    if 'posix' in names:
+        removes = ['nt', 'ntpath', 'dos', 'dospath', 'os2', 'mac', 'macpath',
+                   'ce', 'riscos', 'riscospath', 'win32api', 'riscosenviron']
+    elif 'nt' in names:
+        removes = ['dos', 'dospath', 'os2', 'mac', 'macpath', 'ce', 'riscos',
+                   'riscospath', 'riscosenviron',]
+    elif 'os2' in names:
+        removes = ['nt', 'dos', 'dospath', 'mac', 'macpath', 'win32api', 'ce',
+                   'riscos', 'riscospath', 'riscosenviron',]
+    elif 'dos' in names:
+        removes = ['nt', 'ntpath', 'os2', 'mac', 'macpath', 'win32api', 'ce',
+                   'riscos', 'riscospath', 'riscosenviron',]
+    elif 'mac' in names:
+        removes = ['nt', 'ntpath', 'dos', 'dospath', 'os2', 'win32api', 'ce',
+                   'riscos', 'riscospath', 'riscosenviron',]
+    for i in range(len(mod.imports)-1, -1, -1):
+        nm = mod.imports[i][0]
+        pos = string.find(nm, '.')
+        if pos > -1:
+            nm = nm[:pos]
+        if nm in removes :
+            del mod.imports[i]
+    return mod
+
Binary file srcanamdw/codescanner/pyinstaller/hooks/hook-os.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-parser.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,17 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+hiddenimports = ['copy_reg']
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-pyexpat.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,18 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+hiddenimports = ['xmlparse', 'xmltok']
Binary file srcanamdw/codescanner/pyinstaller/hooks/hook-pyexpat.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-pythoncom.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,39 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+hiddenimports = ['win32com.server.policy']
+
+def hook(mod):
+    import sys
+    if hasattr(sys, 'version_info'):
+        vers = '%d%d' % (sys.version_info[0], sys.version_info[1])
+    else:
+        import string
+        toks = string.split(sys.version[:3], '.')
+        vers = '%s%s' % (toks[0], toks[1])
+    newname = 'pythoncom%s' % vers
+    if mod.typ == 'EXTENSION':
+        mod.__name__ = newname
+    else:
+        import win32api
+        h = win32api.LoadLibrary(newname+'.dll')
+        pth = win32api.GetModuleFileName(h)
+        #win32api.FreeLibrary(h)
+        import mf
+        mod = mf.ExtensionModule(newname, pth)
+    return mod
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-pywintypes.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,36 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+def hook(mod):
+    import sys
+    if hasattr(sys, 'version_info'):
+        vers = '%d%d' % (sys.version_info[0], sys.version_info[1])
+    else:
+        import string
+        toks = string.split(sys.version[:3], '.')
+        vers = '%s%s' % (toks[0], toks[1])
+    newname = 'PyWinTypes%s' % vers
+    if mod.typ == 'EXTENSION':
+        mod.__name__ = newname
+    else:
+        import win32api
+        h = win32api.LoadLibrary(newname+'.dll')
+        pth = win32api.GetModuleFileName(h)
+        #win32api.FreeLibrary(h)
+        import mf
+        mod = mf.ExtensionModule(newname, pth)
+    return mod
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-qt.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,19 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+# PyQt (qt.pyd) has a secret dependence on sip.pyd
+hiddenimports = ['sip']
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-regex.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,18 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+hiddenimports = ['warnings']
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-time.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,23 @@
+# Copyright (C) 2006, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+import sys
+
+# Since Python 2.3, builtin module "time" imports Python module _strptime
+# to implement "time.strptime".
+if hasattr(sys, "version_info") and sys.version_info >= (2,3):
+    hiddenimports = ['_strptime']
Binary file srcanamdw/codescanner/pyinstaller/hooks/hook-time.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-vtkpython.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,24 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+# courtesy of David C. Morrill (4/2/2002)
+import os
+if os.name == 'posix':
+   hiddenimports = ['libvtkCommonPython','libvtkFilteringPython','libvtkIOPython','libvtkImagingPython','libvtkGraphicsPython','libvtkRenderingPython','libvtkHybridPython','libvtkParallelPython','libvtkPatentedPython']
+else:
+   hiddenimports = ['vtkCommonPython','vtkFilteringPython','vtkIOPython','vtkImagingPython','vtkGraphicsPython','vtkRenderingPython','vtkHybridPython','vtkParallelPython','vtkPatentedPython']
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-win32com.client.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,18 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+attrs = [('NeedUnicodeConversions', 0), ('Dispatch',0)]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-win32com.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,25 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+import os
+
+def hook(mod):
+    pth = str(mod.__path__[0])
+    if os.path.isdir(pth):
+        mod.__path__.append(
+            os.path.normpath(os.path.join(pth, '../win32comext')))
+    return mod
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-win32ui.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,18 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+hiddenimports = ['cStringIO', 'traceback']
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-xml.dom.domreg.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,19 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+#xml.dom.domreg line 54
+hiddenimports = ['xml.dom.minidom','xml.dom.DOMImplementation']
Binary file srcanamdw/codescanner/pyinstaller/hooks/hook-xml.dom.domreg.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-xml.dom.ext.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,40 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+attrs = [('Node',0),
+         ('NodeFilter',0),
+         ('XML_NAMESPACE',0),
+         ('XMLNS_NAMESPACE',0),
+         ('DOMException',0),
+         ('HTML_4_TRANSITIONAL_INLINE',0),
+         ('IsDOMString',0),
+         ('FtDomException',0),
+         ('NodeTypeDict',0),
+         ('NodeTypeToClassName',0),
+         ('Print',0),
+         ('PrettyPrint',0),
+         ('XHtmlPrettyPrint',0),
+         ('XHtmlPrint',0),
+         ('ReleaseNode',0),
+         ('StripHtml',0),
+         ('StripXml',0),
+         ('GetElementById',0),
+         ('XmlSpaceState',0),
+         ('GetAllNs',0),
+         ('SplitQName',0),
+         ('SeekNss',0),
+    ]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-xml.dom.ext.reader.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,23 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+attrs = [('ReleaseNode',0),
+         ('StrStream',0),
+         ('BaseUriResolver',0),
+         ('BASIC_RESOLVER',0),
+         ('Reader',0),
+        ]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-xml.dom.html.HTMLDocument.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,74 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+#xml.dom.html.HTMLDocument
+hiddenimports = ['xml.dom.html.HTMLAnchorElement',
+                 'xml.dom.html.HTMLAppletElement',
+                 'xml.dom.html.HTMLAreaElement',
+                 'xml.dom.html.HTMLBaseElement',
+                 'xml.dom.html.HTMLBaseFontElement',
+                 'xml.dom.html.HTMLBodyElement',
+                 'xml.dom.html.HTMLBRElement',
+                 'xml.dom.html.HTMLButtonElement',
+                 'xml.dom.html.HTMLDirectoryElement',
+                 'xml.dom.html.HTMLDivElement',
+                 'xml.dom.html.HTMLDListElement',
+                 'xml.dom.html.HTMLElement',
+                 'xml.dom.html.HTMLFieldSetElement',
+                 'xml.dom.html.HTMLFontElement',
+                 'xml.dom.html.HTMLFormElement',
+                 'xml.dom.html.HTMLFrameElement',
+                 'xml.dom.html.HTMLFrameSetElement',
+                 'xml.dom.html.HTMLHeadElement',
+                 'xml.dom.html.HTMLHeadingElement',
+                 'xml.dom.html.HTMLHRElement',
+                 'xml.dom.html.HTMLHtmlElement',
+                 'xml.dom.html.HTMLIFrameElement',
+                 'xml.dom.html.HTMLImageElement',
+                 'xml.dom.html.HTMLInputElement',
+                 'xml.dom.html.HTMLIsIndexElement',
+                 'xml.dom.html.HTMLLabelElement',
+                 'xml.dom.html.HTMLLegendElement',
+                 'xml.dom.html.HTMLLIElement',
+                 'xml.dom.html.HTMLLinkElement',
+                 'xml.dom.html.HTMLMapElement',
+                 'xml.dom.html.HTMLMenuElement',
+                 'xml.dom.html.HTMLMetaElement',
+                 'xml.dom.html.HTMLModElement',
+                 'xml.dom.html.HTMLObjectElement',
+                 'xml.dom.html.HTMLOListElement',
+                 'xml.dom.html.HTMLOptGroupElement',
+                 'xml.dom.html.HTMLOptionElement',
+                 'xml.dom.html.HTMLParagraphElement',
+                 'xml.dom.html.HTMLParamElement',
+                 'xml.dom.html.HTMLPreElement',
+                 'xml.dom.html.HTMLQuoteElement',
+                 'xml.dom.html.HTMLScriptElement',
+                 'xml.dom.html.HTMLSelectElement',
+                 'xml.dom.html.HTMLStyleElement',
+                 'xml.dom.html.HTMLTableCaptionElement',
+                 'xml.dom.html.HTMLTableCellElement',
+                 'xml.dom.html.HTMLTableColElement',
+                 'xml.dom.html.HTMLTableElement',
+                 'xml.dom.html.HTMLTableRowElement',
+                 'xml.dom.html.HTMLTableSectionElement',
+                 'xml.dom.html.HTMLTextAreaElement',
+                 'xml.dom.html.HTMLTitleElement',
+                 'xml.dom.html.HTMLUListElement',
+        ]
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-xml.dom.html.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,35 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+attrs = [('HTML_4_STRICT_INLINE',0),
+         ('HTML_4_TRANSITIONAL_INLINE',0),
+          ('HTML_FORBIDDEN_END',0),
+          ('HTML_OPT_END',0),
+          ('HTML_BOOLEAN_ATTRS',0),
+          ('HTML_CHARACTER_ENTITIES',0),
+          ('HTML_NAME_ALLOWED',0),
+          ('HTML_DTD',0),
+          ('HTMLDOMImplementation',0),
+          ('htmlImplementation',0),
+          ('utf8_to_code',0),
+          ('ConvertChar',0),
+          ('UseHtmlCharEntities',0),
+          ('TranslateHtmlCdata',0),
+          ('SECURE_HTML_ELEMS',0),
+        ]
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-xml.dom.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,81 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+import string
+attrs = [('Node', 0),
+         ('INDEX_SIZE_ERR', 1),
+         ('DOMSTRING_SIZE_ERR', 2),
+         ('HIERARCHY_REQUEST_ERR', 3),
+         ('WRONG_DOCUMENT_ERR', 4),
+         ('INVALID_CHARACTER_ERR ', 5),
+         ('NO_DATA_ALLOWED_ERR', 6),
+         ('NO_MODIFICATION_ALLOWED_ERR', 7),
+         ('NOT_FOUND_ERR', 8),
+         ('NOT_SUPPORTED_ERR', 9),
+         ('INUSE_ATTRIBUTE_ERR', 10),
+         ('INVALID_STATE_ERR', 11),
+         ('SYNTAX_ERR', 12),
+         ('INVALID_MODIFICATION_ERR', 13),
+         ('NAMESPACE_ERR', 14),
+         ('INVALID_ACCESS_ERR', 15),
+         ('DOMException', 0),
+         ('IndexSizeErr', 0),
+         ('DomstringSizeErr', 0),
+         ('HierarchyRequestErr', 0),
+         ('WrongDocumentErr', 0),
+         ('InvalidCharacterErr', 0),
+         ('NoDataAllowedErr', 0),
+         ('NoModificationAllowedErr', 0),
+         ('NotFoundErr', 0),
+         ('NotSupportedErr', 0),
+         ('InuseAttributeErr', 0),
+         ('InvalidStateErr', 0),
+         ('SyntaxErr', 0),
+         ('InvalidModificationErr', 0),
+         ('NamespaceErr', 0),
+         ('InvalidAccessErr', 0),
+         ('getDOMImplementation', 0),
+         ('registerDOMImplementation', 0),
+]
+
+def hook(mod):
+    if string.find(mod.__file__, '_xmlplus') > -1:
+        mod.UNSPECIFIED_EVENT_TYPE_ERR = 0
+        mod.FT_EXCEPTION_BASE = 1000
+        mod.XML_PARSE_ERR = 1001
+        mod.BAD_BOUNDARYPOINTS_ERR = 1
+        mod.INVALID_NODE_TYPE_ERR = 2
+        mod.EventException = None
+        mod.RangeException = None
+        mod.FtException = None
+        if hasattr(mod, 'DomstringSizeErr'):
+            del mod.DomstringSizeErr
+        mod.DOMStringSizeErr = None
+        mod.UnspecifiedEventTypeErr = None
+        mod.XmlParseErr = None
+        mod.BadBoundaryPointsErr = None
+        mod.InvalidNodeTypeErr = None
+        mod.DOMImplementation = None
+        mod.implementation = None
+        mod.XML_NAMESPACE = None
+        mod.XMLNS_NAMESPACE = None
+        mod.XHTML_NAMESPACE = None
+        mod.DOMExceptionStrings = None
+        mod.EventExceptionStrings = None
+        mod.FtExceptionStrings = None
+        mod.RangeExceptionStrings = None
+    return mod
Binary file srcanamdw/codescanner/pyinstaller/hooks/hook-xml.dom.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-xml.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,35 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+hiddenimports = ['xml.sax.xmlreader','xml.sax.expatreader']
+
+def hook(mod):
+    import os, tempfile, sys, string, marshal
+    fnm = tempfile.mktemp()
+    if string.find(sys.executable, ' ') > -1:
+        exe = '"%s"' % sys.executable
+    else:
+        exe = sys.executable
+    os.system('%s -c "import xml;print xml.__file__" >"%s"' % (exe, fnm))
+    txt = open(fnm, 'r').read()[:-1]
+    os.remove(fnm)
+    if string.find(txt, '_xmlplus') > -1:
+        if txt[:-3] == ".py":
+            txt = txt + 'c'
+        co = marshal.loads(open(txt, 'rb').read()[8:])
+        mod.__init__('xml', txt, co)
+    return mod
Binary file srcanamdw/codescanner/pyinstaller/hooks/hook-xml.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-xml.sax.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,29 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+attrs = [('InputSource', 0),
+         ('ContentHandler', 0),
+         ('ErrorHandler', 0),
+         ('SAXException', 0),
+         ('SAXNotRecognizedException', 0),
+         ('SAXParseException', 0),
+         ('SAXNotSupportedException', 0),
+         ('SAXReaderNotAvailable', 0),
+         ('parse', 0),
+         ('parseString', 0),
+         ('make_parser', 0),
+    ]
Binary file srcanamdw/codescanner/pyinstaller/hooks/hook-xml.sax.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/hooks/hook-xml.sax.saxexts.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,30 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+#xml.sax.saxexts
+hiddenimports = ["xml.sax.drivers2.drv_pyexpat",
+                 "xml.sax.drivers.drv_xmltok",
+                 'xml.sax.drivers2.drv_xmlproc',
+                 "xml.sax.drivers.drv_xmltoolkit",
+                 "xml.sax.drivers.drv_xmllib",
+                 "xml.sax.drivers.drv_xmldc",
+                 'xml.sax.drivers.drv_pyexpat',
+                 'xml.sax.drivers.drv_xmlproc_val',
+                 'xml.sax.drivers.drv_htmllib',
+                 'xml.sax.drivers.drv_sgmlop',
+                 "xml.sax.drivers.drv_sgmllib",
+            ]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/icon.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,156 @@
+#! /usr/bin/env python
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+# This code is courtesy of Thomas Heller, who
+# has kindly donated it to this project.
+RT_ICON = 3
+RT_GROUP_ICON = 14
+LOAD_LIBRARY_AS_DATAFILE = 2
+
+import struct
+
+class Structure:
+    def __init__ (self):
+        size = self._sizeInBytes = struct.calcsize (self._format_)
+        self._fields_ = list (struct.unpack (self._format_, '\000' * size))
+        indexes = self._indexes_ = {}
+        for i in range (len (self._names_)):
+            indexes[self._names_[i]] = i
+    def dump (self):
+        print "I: DUMP of", self
+        for name in self._names_:
+            if name[0] != '_':
+                print "I: %20s = %s" % (name, getattr (self, name))
+        print
+    def __getattr__ (self, name):
+        if name in self._names_:
+            index = self._indexes_[name]
+            return self._fields_[index]
+        try:
+            return self.__dict__[name]
+        except KeyError:
+            raise AttributeError, name
+    def __setattr__ (self, name, value):
+        if name in self._names_:
+            index = self._indexes_[name]
+            self._fields_[index] = value
+        else:
+            self.__dict__[name] = value
+    def tostring (self):
+        return apply (struct.pack, [self._format_,] + self._fields_)
+    def fromfile (self, file):
+        data = file.read (self._sizeInBytes)
+        self._fields_ = list (struct.unpack (self._format_, data))
+
+class ICONDIRHEADER (Structure):
+    _names_ = "idReserved", "idType", "idCount"
+    _format_ = "hhh"
+
+class ICONDIRENTRY (Structure):
+    _names_ = "bWidth", "bHeight", "bColorCount", "bReserved", "wPlanes", "wBitCount", "dwBytesInRes", "dwImageOffset"
+    _format_ = "bbbbhhii"
+
+class GRPICONDIR (Structure):
+    _names_ = "idReserved", "idType", "idCount"
+    _format_ = "hhh"
+
+class GRPICONDIRENTRY (Structure):
+    _names_ = "bWidth", "bHeight", "bColorCount", "bReserved", "wPlanes", "wBitCount", "dwBytesInRes", "nID"
+    _format_ = "bbbbhhih"
+
+class IconFile:
+    def __init__ (self, path):
+        self.path = path
+        file = open (path, "rb")
+        self.entries = []
+        self.images = []
+        header = self.header = ICONDIRHEADER()
+        header.fromfile (file)
+        for i in range (header.idCount):
+            entry = ICONDIRENTRY()
+            entry.fromfile (file)
+            self.entries.append (entry)
+        for e in self.entries:
+            file.seek (e.dwImageOffset, 0)
+            self.images.append (file.read (e.dwBytesInRes))
+
+    def grp_icon_dir (self):
+        return self.header.tostring()
+
+    def grp_icondir_entries (self):
+        data = ""
+        i = 1
+        for entry in self.entries:
+            e = GRPICONDIRENTRY()
+            for n in e._names_[:-1]:
+                setattr(e, n, getattr (entry, n))
+            e.nID = i
+            i = i + 1
+            data = data + e.tostring()
+        return data
+
+
+def CopyIcons_FromIco (dstpath, srcpath):
+    f = IconFile (srcpath)
+    print "I: Updating icons from", srcpath, "to", dstpath
+    import win32api #, win32con
+    hdst = win32api.BeginUpdateResource (dstpath, 0)
+    data = f.grp_icon_dir()
+    data = data + f.grp_icondir_entries()
+    win32api.UpdateResource (hdst, RT_GROUP_ICON, 1, data)
+    print "I: Writing RT_GROUP_ICON resource with %d bytes" % len (data)
+    i = 1
+    for data in f.images:
+        win32api.UpdateResource (hdst, RT_ICON, i, data)
+        print "I: Writing RT_ICON resource with %d bytes" % len (data)
+        i = i + 1
+    win32api.EndUpdateResource (hdst, 0)
+
+def CopyIcons (dstpath, srcpath):
+    import os.path, string
+    index = None
+    try:
+        srcpath, index = map (string.strip, string.split (srcpath, ','))
+        index = int (index)
+    except:
+        pass
+    print "I: PATH, INDEX", srcpath, index
+    srcext = os.path.splitext (srcpath)[1]
+    if string.lower (srcext) == '.ico':
+        return CopyIcons_FromIco (dstpath, srcpath)
+    if index is not None:
+        print "I: Updating icons from", srcpath, ", %d to" % index, dstpath
+    else:
+        print "I: Updating icons from", srcpath, "to", dstpath
+    import win32api #, win32con
+    hdst = win32api.BeginUpdateResource (dstpath, 0)
+    hsrc = win32api.LoadLibraryEx (srcpath, 0, LOAD_LIBRARY_AS_DATAFILE)
+    if index is None:
+        grpname = win32api.EnumResourceNames (hsrc, RT_GROUP_ICON)[0]
+    elif index >= 0:
+        grpname = win32api.EnumResourceNames (hsrc, RT_GROUP_ICON)[index]
+    else:
+        grpname = -index
+    data = win32api.LoadResource (hsrc, RT_GROUP_ICON, grpname)
+    win32api.UpdateResource (hdst, RT_GROUP_ICON, grpname, data)
+    for iconname in win32api.EnumResourceNames (hsrc, RT_ICON):
+        data = win32api.LoadResource (hsrc, RT_ICON, iconname)
+        win32api.UpdateResource (hdst, RT_ICON, iconname, data)
+    win32api.FreeLibrary (hsrc)
+    win32api.EndUpdateResource (hdst, 0)
+
Binary file srcanamdw/codescanner/pyinstaller/icon.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/iu.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,603 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# In addition to the permissions in the GNU General Public License, the
+# authors give you unlimited permission to link or embed the compiled
+# version of this file into combinations with other programs, and to
+# distribute those combinations without any restriction coming from the
+# use of this file. (The General Public License restrictions do apply in
+# other respects; for example, they cover modification of the file, and
+# distribution when not linked into a combine executable.)
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+# **NOTE** This module is used during bootstrap. Import *ONLY* builtin modules.
+import sys
+import imp
+import marshal
+
+try:
+    py_version = sys.version_info
+except AttributeError:
+    py_version = (1,5)
+
+#=======================Owners==========================#
+# An Owner does imports from a particular piece of turf
+# That is, there's an Owner for each thing on sys.path
+# There are owners for directories and .pyz files.
+# There could be owners for zip files, or even URLs.
+# A shadowpath (a dictionary mapping the names in
+# sys.path to their owners) is used so that sys.path
+# (or a package's __path__) is still a bunch of strings,
+
+STRINGTYPE = type('')
+
+class Owner:
+    def __init__(self, path):
+        self.path = path
+    def __str__(self):
+        return self.path
+    def getmod(self, nm):
+        return None
+class DirOwner(Owner):
+    def __init__(self, path):
+        if path == '':
+            path = _os_getcwd()
+        if not pathisdir(path):
+            raise ValueError, "%s is not a directory" % path
+        Owner.__init__(self, path)
+    def getmod(self, nm, getsuffixes=imp.get_suffixes, loadco=marshal.loads, newmod=imp.new_module):
+        pth =  _os_path_join(self.path, nm)
+        possibles = [(pth, 0, None)]
+        if pathisdir(pth):
+            possibles.insert(0, (_os_path_join(pth, '__init__'), 1, pth))
+        py = pyc = None
+        for pth, ispkg, pkgpth in possibles:
+            for ext, mode, typ in getsuffixes():
+                attempt = pth+ext
+                try:
+                    st = _os_stat(attempt)
+                except:
+                    pass
+                else:
+                    if typ == imp.C_EXTENSION:
+                        fp = open(attempt, 'rb')
+                        mod = imp.load_module(nm, fp, attempt, (ext, mode, typ))
+                        mod.__file__ = attempt
+                        return mod
+                    elif typ == imp.PY_SOURCE:
+                        py = (attempt, st)
+                    else:
+                        pyc = (attempt, st)
+            if py or pyc:
+                break
+        if py is None and pyc is None:
+            return None
+        while 1:
+            if pyc is None or py and pyc[1][8] < py[1][8]:
+                try:
+                    co = compile(open(py[0], 'r').read()+'\n', py[0], 'exec')
+                    break
+                except SyntaxError, e:
+                    print "Invalid syntax in %s" % py[0]
+                    print e.args
+                    raise
+            elif pyc:
+                stuff = open(pyc[0], 'rb').read()
+                try:
+                    co = loadco(stuff[8:])
+                    break
+                except (ValueError, EOFError):
+                    pyc = None
+            else:
+                return None
+        mod = newmod(nm)
+        mod.__file__ = co.co_filename
+        if ispkg:
+            mod.__path__ = [pkgpth]
+            subimporter = PathImportDirector(mod.__path__)
+            mod.__importsub__ = subimporter.getmod
+        mod.__co__ = co
+        return mod
+
+_globalownertypes = [
+    DirOwner,
+    Owner,
+]
+
+#===================Import Directors====================================#
+# ImportDirectors live on the metapath
+# There's one for builtins, one for frozen modules, and one for sys.path
+# Windows gets one for modules gotten from the Registry
+# Mac would have them for PY_RESOURCE modules etc.
+# A generalization of Owner - their concept of "turf" is broader
+
+class ImportDirector(Owner):
+    pass
+class BuiltinImportDirector(ImportDirector):
+    def __init__(self):
+        self.path = 'Builtins'
+    def getmod(self, nm, isbuiltin=imp.is_builtin):
+        if isbuiltin(nm):
+            mod = imp.load_module(nm, None, nm, ('','',imp.C_BUILTIN))
+            return mod
+        return None
+class FrozenImportDirector(ImportDirector):
+    def __init__(self):
+        self.path = 'FrozenModules'
+    def getmod(self, nm, isfrozen=imp.is_frozen):
+        if isfrozen(nm):
+            mod = imp.load_module(nm, None, nm, ('','',imp.PY_FROZEN))
+            if hasattr(mod, '__path__'):
+                mod.__importsub__ = lambda name, pname=nm, owner=self: owner.getmod(pname+'.'+name)
+            return mod
+        return None
+class RegistryImportDirector(ImportDirector):
+    # for Windows only
+    def __init__(self):
+        self.path = "WindowsRegistry"
+        self.map = {}
+        try:
+            import win32api
+##            import win32con
+        except ImportError:
+            pass
+        else:
+            HKEY_CURRENT_USER = -2147483647
+            HKEY_LOCAL_MACHINE = -2147483646
+            KEY_ALL_ACCESS = 983103
+            KEY_READ = 131097
+            subkey = r"Software\Python\PythonCore\%s\Modules" % sys.winver
+            for root in (HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE):
+                try:
+                    #hkey = win32api.RegOpenKeyEx(root, subkey, 0, KEY_ALL_ACCESS)
+                    hkey = win32api.RegOpenKeyEx(root, subkey, 0, KEY_READ)
+                except:
+                    pass
+                else:
+                    numsubkeys, numvalues, lastmodified = win32api.RegQueryInfoKey(hkey)
+                    for i in range(numsubkeys):
+                        subkeyname = win32api.RegEnumKey(hkey, i)
+                        #hskey = win32api.RegOpenKeyEx(hkey, subkeyname, 0, KEY_ALL_ACCESS)
+                        hskey = win32api.RegOpenKeyEx(hkey, subkeyname, 0, KEY_READ)
+                        val = win32api.RegQueryValueEx(hskey, '')
+                        desc = getDescr(val[0])
+                        self.map[subkeyname] = (val[0], desc)
+                        hskey.Close()
+                    hkey.Close()
+                    break
+    def getmod(self, nm):
+        stuff = self.map.get(nm)
+        if stuff:
+            fnm, desc = stuff
+            fp = open(fnm, 'rb')
+            mod = imp.load_module(nm, fp, fnm, desc)
+            mod.__file__ = fnm
+            return mod
+        return None
+
+class PathImportDirector(ImportDirector):
+    def __init__(self, pathlist=None, importers=None, ownertypes=None):
+        if pathlist is None:
+            self.path = sys.path
+        else:
+            self.path = pathlist
+        if ownertypes == None:
+            self.ownertypes = _globalownertypes
+        else:
+            self.ownertypes = ownertypes
+        if importers:
+            self.shadowpath = importers
+        else:
+            self.shadowpath = {}
+        self.inMakeOwner = 0
+        self.building = {}
+    def getmod(self, nm):
+        mod = None
+        for thing in self.path:
+            if type(thing) is STRINGTYPE:
+                owner = self.shadowpath.get(thing, -1)
+                if owner == -1:
+                    owner = self.shadowpath[thing] = self.makeOwner(thing)
+                if owner:
+                    mod = owner.getmod(nm)
+            else:
+                mod = thing.getmod(nm)
+            if mod:
+                break
+        return mod
+    def makeOwner(self, path):
+        if self.building.get(path):
+            return None
+        self.building[path] = 1
+        owner = None
+        for klass in self.ownertypes:
+            try:
+                # this may cause an import, which may cause recursion
+                # hence the protection
+                owner = klass(path)
+            except:
+                pass
+            else:
+                break
+        del self.building[path]
+        return owner
+
+def getDescr(fnm):
+    ext = getpathext(fnm)
+    for (suffix, mode, typ) in imp.get_suffixes():
+        if suffix == ext:
+            return (suffix, mode, typ)
+
+#=================ImportManager============================#
+# The one-and-only ImportManager
+# ie, the builtin import
+
+UNTRIED = -1
+
+class ImportManager:
+    # really the equivalent of builtin import
+    def __init__(self):
+        self.metapath = [
+            BuiltinImportDirector(),
+            FrozenImportDirector(),
+            RegistryImportDirector(),
+            PathImportDirector()
+        ]
+        self.threaded = 0
+        self.rlock = None
+        self.locker = None
+        self.setThreaded()
+    def setThreaded(self):
+        thread = sys.modules.get('thread', None)
+        if thread and not self.threaded:
+##            print "iu setting threaded"
+            self.threaded = 1
+            self.rlock = thread.allocate_lock()
+            self._get_ident = thread.get_ident
+    def install(self):
+        import __builtin__
+        __builtin__.__import__ = self.importHook
+        __builtin__.reload = self.reloadHook
+    def importHook(self, name, globals=None, locals=None, fromlist=None):
+        # first see if we could be importing a relative name
+        #print "importHook(%s, %s, locals, %s)" % (name, globals['__name__'], fromlist)
+        _sys_modules_get = sys.modules.get
+        contexts = [None]
+        if globals:
+            importernm = globals.get('__name__', '')
+            if importernm:
+                if hasattr(_sys_modules_get(importernm), '__path__'):
+                    # If you use the "from __init__ import" syntax, the package
+                    # name will have a __init__ in it. We want to strip it.
+                    if importernm[-len(".__init__"):] == ".__init__":
+                        importernm = importernm[:-len(".__init__")]
+                    contexts.insert(0,importernm)
+                else:
+                    pkgnm = packagename(importernm)
+                    if pkgnm:
+                        contexts.insert(0,pkgnm)
+        # so contexts is [pkgnm, None] or just [None]
+        # now break the name being imported up so we get:
+        # a.b.c -> [a, b, c]
+        nmparts = namesplit(name)
+        _self_doimport = self.doimport
+        threaded = self.threaded
+        for context in contexts:
+            ctx = context
+            for i in range(len(nmparts)):
+                nm = nmparts[i]
+                #print " importHook trying %s in %s" % (nm, ctx)
+                if ctx:
+                    fqname = ctx + '.' + nm
+                else:
+                    fqname = nm
+                if threaded:
+                    self._acquire()
+                mod = _sys_modules_get(fqname, UNTRIED)
+                if mod is UNTRIED:
+                    try:
+                        mod = _self_doimport(nm, ctx, fqname)
+                    except:
+                        if threaded:
+                            self._release()
+                        raise
+                if threaded:
+                    self._release()
+                if mod:
+                    ctx = fqname
+                else:
+                    break
+            else:
+                # no break, point i beyond end
+                i = i + 1
+            if i:
+                break
+
+        if i<len(nmparts):
+            if ctx and hasattr(sys.modules[ctx], nmparts[i]):
+                #print "importHook done with %s %s %s (case 1)" % (name, globals['__name__'], fromlist)
+                return sys.modules[nmparts[0]]
+            del sys.modules[fqname]
+            raise ImportError, "No module named %s" % fqname
+        if fromlist is None:
+            #print "importHook done with %s %s %s (case 2)" % (name, globals['__name__'], fromlist)
+            if context:
+                return sys.modules[context+'.'+nmparts[0]]
+            return sys.modules[nmparts[0]]
+        bottommod = sys.modules[ctx]
+        if hasattr(bottommod, '__path__'):
+            fromlist = list(fromlist)
+            i = 0
+            while i < len(fromlist):
+                nm = fromlist[i]
+                if nm == '*':
+                    fromlist[i:i+1] = list(getattr(bottommod, '__all__', []))
+                    if i >= len(fromlist):
+                        break
+                    nm = fromlist[i]
+                i = i + 1
+                if not hasattr(bottommod, nm):
+                    if threaded:
+                        self._acquire()
+                    try:
+                        mod = self.doimport(nm, ctx, ctx+'.'+nm)
+                    except:
+                        pass
+                    if threaded:
+                        self._release()
+        #print "importHook done with %s %s %s (case 3)" % (name, globals['__name__'], fromlist)
+        return bottommod
+    def doimport(self, nm, parentnm, fqname, reload=0):
+        # Not that nm is NEVER a dotted name at this point
+        #print "doimport(%s, %s, %s)" % (nm, parentnm, fqname)
+        if parentnm:
+            parent = sys.modules[parentnm]
+            if hasattr(parent, '__path__'):
+                importfunc = getattr(parent, '__importsub__', None)
+                if not importfunc:
+                    subimporter = PathImportDirector(parent.__path__)
+                    importfunc = parent.__importsub__ = subimporter.getmod
+                mod = importfunc(nm)
+                if mod and not reload:
+                    setattr(parent, nm, mod)
+            else:
+                #print "..parent not a package"
+                return None
+        else:
+            # now we're dealing with an absolute import
+            for director in self.metapath:
+                mod = director.getmod(nm)
+                if mod:
+                    break
+        if mod:
+            mod.__name__ = fqname
+            if reload:
+                sys.modules[fqname].__dict__.update(mod.__dict__)
+            else:
+                sys.modules[fqname] = mod
+            if hasattr(mod, '__co__'):
+                co = mod.__co__
+                del mod.__co__
+                try:
+                    if reload:
+                        exec co in sys.modules[fqname].__dict__
+                    else:
+                        exec co in mod.__dict__
+                except:
+                    # In Python 2.4 and above, sys.modules is left clean
+                    # after a broken import. We need to do the same to
+                    # achieve perfect compatibility (see ticket #32).
+                    if py_version >= (2,4,0):
+                        # FIXME: how can we recover from a broken reload()?
+                        # Should we save the mod dict and restore it in case
+                        # of failure?
+                        if not reload:
+                            del sys.modules[fqname]
+                    raise
+            if fqname == 'thread' and not self.threaded:
+##                print "thread detected!"
+                self.setThreaded()
+        else:
+            sys.modules[fqname] = None
+        #print "..found %s" % mod
+        return mod
+    def reloadHook(self, mod):
+        fqnm = mod.__name__
+        nm = namesplit(fqnm)[-1]
+        parentnm = packagename(fqnm)
+        newmod = self.doimport(nm, parentnm, fqnm, reload=1)
+        #mod.__dict__.update(newmod.__dict__)
+        return newmod
+    def _acquire(self):
+        if self.rlock.locked():
+            if self.locker == self._get_ident():
+                self.lockcount = self.lockcount + 1
+##                print "_acquire incrementing lockcount to", self.lockcount
+                return
+        self.rlock.acquire()
+        self.locker = self._get_ident()
+        self.lockcount = 0
+##        print "_acquire first time!"
+    def _release(self):
+        if self.lockcount:
+            self.lockcount = self.lockcount - 1
+##            print "_release decrementing lockcount to", self.lockcount
+        else:
+            self.locker = None
+            self.rlock.release()
+##            print "_release releasing lock!"
+
+#=========some helper functions=============================#
+
+def packagename(s):
+    for i in range(len(s)-1, -1, -1):
+        if s[i] == '.':
+            break
+    else:
+        return ''
+    return s[:i]
+
+def namesplit(s):
+    rslt = []
+    i = j = 0
+    for j in range(len(s)):
+        if s[j] == '.':
+            rslt.append(s[i:j])
+            i = j+1
+    if i < len(s):
+        rslt.append(s[i:])
+    return rslt
+
+def getpathext(fnm):
+    for i in range(len(fnm)-1, -1, -1):
+        if fnm[i] == '.':
+            return fnm[i:]
+    return ''
+
+def pathisdir(pathname):
+    "Local replacement for os.path.isdir()."
+    try:
+        s = _os_stat(pathname)
+    except OSError:
+        return None
+    return (s[0] & 0170000) == 0040000
+
+_os_stat = _os_path_join = _os_getcwd = _os_path_dirname = None
+def _os_bootstrap():
+    "Set up 'os' module replacement functions for use during import bootstrap."
+
+    names = sys.builtin_module_names
+
+    join = dirname = None
+    mindirlen = 0
+    if 'posix' in names:
+        sep = '/'
+        mindirlen = 1
+        from posix import stat, getcwd
+    elif 'nt' in names:
+        sep = '\\'
+        mindirlen = 3
+        from nt import stat, getcwd
+    elif 'dos' in names:
+        sep = '\\'
+        mindirlen = 3
+        from dos import stat, getcwd
+    elif 'os2' in names:
+        sep = '\\'
+        from os2 import stat, getcwd
+    elif 'mac' in names:
+        from mac import stat, getcwd
+        def join(a, b):
+            if a == '':
+                return b
+            path = s
+            if ':' not in a:
+                a = ':' + a
+            if a[-1:] != ':':
+                a = a + ':'
+            return a + b
+    else:
+        raise ImportError, 'no os specific module found'
+
+    if join is None:
+        def join(a, b, sep=sep):
+            if a == '':
+                return b
+            lastchar = a[-1:]
+            if lastchar == '/' or lastchar == sep:
+                return a + b
+            return a + sep + b
+
+    if dirname is None:
+        def dirname(a, sep=sep, mindirlen=mindirlen):
+            for i in range(len(a)-1, -1, -1):
+                c = a[i]
+                if c == '/' or c == sep:
+                    if i < mindirlen:
+                        return a[:i+1]
+                    return a[:i]
+            return ''
+
+    global _os_stat
+    _os_stat = stat
+
+    global _os_path_join
+    _os_path_join = join
+
+    global _os_path_dirname
+    _os_path_dirname = dirname
+
+    global _os_getcwd
+    _os_getcwd = getcwd
+
+_string_replace = _string_join = _string_split = None
+def _string_bootstrap():
+    """
+    Set up 'string' module replacement functions for use during import bootstrap.
+
+    During bootstrap, we can use only builtin modules since import does not work
+    yet. For Python 2.0+, we can use string methods so this is not a problem.
+    For Python 1.5, we would need the string module, so we need replacements.
+    """
+    s = type('')
+
+    global _string_replace, _string_join, _string_split
+
+    if hasattr(s, "join"):
+        _string_join = s.join
+    else:
+        def join(sep, words):
+            res = ''
+            for w in words:
+                    res = res + (sep + w)
+            return res[len(sep):]
+        _string_join = join
+
+    if hasattr(s, "split"):
+        _string_split = s.split
+    else:
+        def split(s, sep, maxsplit=0):
+            res = []
+            nsep = len(sep)
+            if nsep == 0:
+                    return [s]
+            ns = len(s)
+            if maxsplit <= 0: maxsplit = ns
+            i = j = 0
+            count = 0
+            while j+nsep <= ns:
+                    if s[j:j+nsep] == sep:
+                            count = count + 1
+                            res.append(s[i:j])
+                            i = j = j + nsep
+                            if count >= maxsplit: break
+                    else:
+                            j = j + 1
+            res.append(s[i:])
+            return res
+        _string_split = split
+
+    if hasattr(s, "replace"):
+        _string_replace = s.replace
+    else:
+        def replace(str, old, new):
+            return _string_join(new, _string_split(str, old))
+        _string_replace = replace
+
+
+
+_os_bootstrap()
+_string_bootstrap()
Binary file srcanamdw/codescanner/pyinstaller/iu.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/mf.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,645 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+import sys, string, os, imp, marshal
+
+#=======================Owners==========================#
+# An Owner does imports from a particular piece of turf
+# That is, there's an Owner for each thing on sys.path
+# There are owners for directories and .pyz files.
+# There could be owners for zip files, or even URLs.
+# Note that they replace the string in sys.path,
+# but str(sys.path[n]) should yield the original string.
+
+STRINGTYPE = type('')
+
+class Owner:
+    def __init__(self, path):
+        self.path = path
+    def __str__(self):
+        return self.path
+    def getmod(self, nm):
+        return None
+
+class DirOwner(Owner):
+    def __init__(self, path):
+        if path == '':
+            path = os.getcwd()
+        if not os.path.isdir(path):
+            raise ValueError, "%s is not a directory" % path
+        Owner.__init__(self, path)
+    def getmod(self, nm, getsuffixes=imp.get_suffixes, loadco=marshal.loads):
+        pth =  os.path.join(self.path, nm)
+        possibles = [(pth, 0, None)]
+        if os.path.isdir(pth):
+            possibles.insert(0, (os.path.join(pth, '__init__'), 1, pth))
+        py = pyc = None
+        for pth, ispkg, pkgpth in possibles:
+            for ext, mode, typ in getsuffixes():
+                attempt = pth+ext
+                try:
+                    st = os.stat(attempt)
+                except:
+                    pass
+                else:
+                    if typ == imp.C_EXTENSION:
+                        return ExtensionModule(nm, attempt)
+                    elif typ == imp.PY_SOURCE:
+                        py = (attempt, st)
+                    else:
+                        pyc = (attempt, st)
+            if py or pyc:
+                break
+        if py is None and pyc is None:
+            return None
+        while 1:
+            if pyc is None or py and pyc[1][8] < py[1][8]:
+                try:
+                    co = compile(open(py[0], 'r').read()+'\n', py[0], 'exec')
+                    if __debug__:
+                        pth = py[0] + 'c'
+                    else:
+                        pth = py[0] + 'o'
+                    break
+                except SyntaxError, e:
+                    print "Syntax error in", py[0]
+                    print e.args
+                    raise
+            elif pyc:
+                stuff = open(pyc[0], 'rb').read()
+                try:
+                    co = loadco(stuff[8:])
+                    pth = pyc[0]
+                    break
+                except (ValueError, EOFError):
+                    print "W: bad .pyc found (%s)" % pyc[0]
+                    pyc = None
+            else:
+                return None
+        if not os.path.isabs(pth):
+            pth = os.path.abspath(pth)
+        if ispkg:
+            mod = PkgModule(nm, pth, co)
+        else:
+            mod = PyModule(nm, pth, co)
+        return mod
+
+class PYZOwner(Owner):
+    def __init__(self, path):
+        import archive
+        self.pyz = archive.ZlibArchive(path)
+        Owner.__init__(self, path)
+    def getmod(self, nm):
+        rslt = self.pyz.extract(nm)
+        if rslt:
+            ispkg, co = rslt
+        if ispkg:
+            return PkgInPYZModule(nm, co, self)
+        return PyModule(nm, self.path, co)
+
+_globalownertypes = [
+    DirOwner,
+    PYZOwner,
+    Owner,
+]
+
+#===================Import Directors====================================#
+# ImportDirectors live on the metapath
+# There's one for builtins, one for frozen modules, and one for sys.path
+# Windows gets one for modules gotten from the Registry
+# There should be one for Frozen modules
+# Mac would have them for PY_RESOURCE modules etc.
+# A generalization of Owner - their concept of "turf" is broader
+
+class ImportDirector(Owner):
+    pass
+class BuiltinImportDirector(ImportDirector):
+    def __init__(self):
+        self.path = 'Builtins'
+    def getmod(self, nm, isbuiltin=imp.is_builtin):
+        if isbuiltin(nm):
+            return BuiltinModule(nm)
+        return None
+class FrozenImportDirector(ImportDirector):
+    def __init__(self):
+        self.path = 'FrozenModules'
+    def getmod(self, nm, isfrozen=imp.is_frozen):
+        if isfrozen(nm):
+            return FrozenModule(nm)
+        return None
+class RegistryImportDirector(ImportDirector):
+    # for Windows only
+    def __init__(self):
+        self.path = "WindowsRegistry"
+        self.map = {}
+        try:
+            import win32api
+            import win32con
+        except ImportError:
+            pass
+        else:
+            subkey = r"Software\Python\PythonCore\%s\Modules" % sys.winver
+            for root in (win32con.HKEY_CURRENT_USER, win32con.HKEY_LOCAL_MACHINE):
+                try:
+                    #hkey = win32api.RegOpenKeyEx(root, subkey, 0, win32con.KEY_ALL_ACCESS)
+                    hkey = win32api.RegOpenKeyEx(root, subkey, 0, win32con.KEY_READ)
+                except:
+                    pass
+                else:
+                    numsubkeys, numvalues, lastmodified = win32api.RegQueryInfoKey(hkey)
+                    for i in range(numsubkeys):
+                        subkeyname = win32api.RegEnumKey(hkey, i)
+                        #hskey = win32api.RegOpenKeyEx(hkey, subkeyname, 0, win32con.KEY_ALL_ACCESS)
+                        hskey = win32api.RegOpenKeyEx(hkey, subkeyname, 0, win32con.KEY_READ)
+                        val = win32api.RegQueryValueEx(hskey, '')
+                        desc = getDescr(val[0])
+                        #print " RegistryImportDirector got %s %s" % (val[0], desc)  #XXX
+                        self.map[subkeyname] = (val[0], desc)
+                        hskey.Close()
+                    hkey.Close()
+                    break
+    def getmod(self, nm):
+        stuff = self.map.get(nm)
+        if stuff:
+            fnm, (suffix, mode, typ) = stuff
+            if typ == imp.C_EXTENSION:
+                return ExtensionModule(nm, fnm)
+            elif typ == imp.PY_SOURCE:
+                try:
+                    co = compile(open(fnm, 'r').read()+'\n', fnm, 'exec')
+                except SyntaxError, e:
+                    print "Invalid syntax in %s" % py[0]
+                    print e.args
+                    raise
+            else:
+                stuff = open(fnm, 'rb').read()
+                co = loadco(stuff[8:])
+            return PyModule(nm, fnm, co)
+        return None
+class PathImportDirector(ImportDirector):
+    def __init__(self, pathlist=None, importers=None, ownertypes=None):
+        if pathlist is None:
+            self.path = sys.path
+        else:
+            self.path = pathlist
+        if ownertypes == None:
+            self.ownertypes = _globalownertypes
+        else:
+            self.ownertypes = ownertypes
+        if importers:
+            self.shadowpath = importers
+        else:
+            self.shadowpath = {}
+        self.inMakeOwner = 0
+        self.building = {}
+    def getmod(self, nm):
+        mod = None
+        for thing in self.path:
+            if type(thing) is STRINGTYPE:
+                owner = self.shadowpath.get(thing, -1)
+                if owner == -1:
+                    owner = self.shadowpath[thing] = self.makeOwner(thing)
+                if owner:
+                    mod = owner.getmod(nm)
+            else:
+                mod = thing.getmod(nm)
+            if mod:
+                break
+        return mod
+    def makeOwner(self, path):
+        if self.building.get(path):
+            return None
+        self.building[path] = 1
+        owner = None
+        for klass in self.ownertypes:
+            try:
+                # this may cause an import, which may cause recursion
+                # hence the protection
+                owner = klass(path)
+            except:
+                pass
+            else:
+                break
+        del self.building[path]
+        return owner
+
+
+def getDescr(fnm):
+    ext = os.path.splitext(fnm)[1]
+    for (suffix, mode, typ) in imp.get_suffixes():
+        if suffix == ext:
+            return (suffix, mode, typ)
+
+#=================Import Tracker============================#
+# This one doesn't really import, just analyzes
+# If it *were* importing, it would be the one-and-only ImportManager
+# ie, the builtin import
+UNTRIED = -1
+
+imptyps = ['top-level', 'conditional', 'delayed', 'delayed, conditional']
+import hooks
+
+class ImportTracker:
+    # really the equivalent of builtin import
+    def __init__(self, xpath=None, hookspath=None, excludes=None):
+        self.path = []
+        self.warnings = {}
+        if xpath:
+            self.path = xpath
+        self.path.extend(sys.path)
+        self.modules = {}
+        self.metapath = [
+            BuiltinImportDirector(),
+            FrozenImportDirector(),
+            RegistryImportDirector(),
+            PathImportDirector(self.path)
+        ]
+        if hookspath:
+            hooks.__path__.extend(hookspath)
+        self.excludes = excludes
+        if excludes is None:
+            self.excludes = []
+    def analyze_r(self, nm, importernm=None):
+        importer = importernm
+        if importer is None:
+            importer = '__main__'
+        seen = {}
+        nms = self.analyze_one(nm, importernm)
+        nms = map(None, nms, [importer]*len(nms))
+        i = 0
+        while i < len(nms):
+            nm, importer = nms[i]
+            if seen.get(nm,0):
+                del nms[i]
+                mod = self.modules[nm]
+                if mod:
+                    mod.xref(importer)
+            else:
+                i = i + 1
+                seen[nm] = 1
+                j = i
+                mod = self.modules[nm]
+                if mod:
+                    mod.xref(importer)
+                    for name, isdelayed, isconditional in mod.imports:
+                        imptyp = isdelayed * 2 + isconditional
+                        newnms = self.analyze_one(name, nm, imptyp)
+                        newnms = map(None, newnms, [nm]*len(newnms))
+                        nms[j:j] = newnms
+                        j = j + len(newnms)
+        return map(lambda a: a[0], nms)
+    def analyze_one(self, nm, importernm=None, imptyp=0):
+        # first see if we could be importing a relative name
+        contexts = [None]
+        _all = None
+        if importernm:
+            if self.ispackage(importernm):
+                contexts.insert(0,importernm)
+            else:
+                pkgnm = string.join(string.split(importernm, '.')[:-1], '.')
+                if pkgnm:
+                    contexts.insert(0,pkgnm)
+        # so contexts is [pkgnm, None] or just [None]
+        # now break the name being imported up so we get:
+        # a.b.c -> [a, b, c]
+        nmparts = string.split(nm, '.')
+        if nmparts[-1] == '*':
+            del nmparts[-1]
+            _all = []
+        nms = []
+        for context in contexts:
+            ctx = context
+            for i in range(len(nmparts)):
+                nm = nmparts[i]
+                if ctx:
+                    fqname = ctx + '.' + nm
+                else:
+                    fqname = nm
+                mod = self.modules.get(fqname, UNTRIED)
+                if mod is UNTRIED:
+                    mod = self.doimport(nm, ctx, fqname)
+                if mod:
+                    nms.append(mod.__name__)
+                    ctx = fqname
+                else:
+                    break
+            else:
+                # no break, point i beyond end
+                i = i + 1
+            if i:
+                break
+        # now nms is the list of modules that went into sys.modules
+        # just as result of the structure of the name being imported
+        # however, each mod has been scanned and that list is in mod.imports
+        if i<len(nmparts):
+            if ctx:
+                if hasattr(self.modules[ctx], nmparts[i]):
+                    return nms
+                if not self.ispackage(ctx):
+                    return nms
+            self.warnings["W: no module named %s (%s import by %s)" % (fqname, imptyps[imptyp], importernm or "__main__")] = 1
+            if self.modules.has_key(fqname):
+                del self.modules[fqname]
+            return nms
+        if _all is None:
+            return nms
+        bottommod = self.modules[ctx]
+        if bottommod.ispackage():
+            for nm in bottommod._all:
+                if not hasattr(bottommod, nm):
+                    mod = self.doimport(nm, ctx, ctx+'.'+nm)
+                    if mod:
+                        nms.append(mod.__name__)
+                    else:
+                        bottommod.warnings.append("W: name %s not found" % nm)
+        return nms
+
+    def analyze_script(self, fnm):
+        try:
+            co = compile(open(fnm, 'r').read()+'\n', fnm, 'exec')
+        except SyntaxError, e:
+            print "Invalid syntax in %s" % fnm
+            print e.args
+            raise
+        mod = PyScript(fnm, co)
+        self.modules['__main__'] = mod
+        return self.analyze_r('__main__')
+
+
+    def ispackage(self, nm):
+        return self.modules[nm].ispackage()
+
+    def doimport(self, nm, parentnm, fqname):
+        # Not that nm is NEVER a dotted name at this point
+        if fqname in self.excludes:
+            return None
+        if parentnm:
+            parent = self.modules[parentnm]
+            if parent.ispackage():
+                mod = parent.doimport(nm)
+                if mod:
+                    setattr(parent, nm, mod)
+            else:
+                return None
+        else:
+            # now we're dealing with an absolute import
+            for director in self.metapath:
+                mod = director.getmod(nm)
+                if mod:
+                    break
+        if mod:
+            mod.__name__ = fqname
+            self.modules[fqname] = mod
+            # now look for hooks
+            # this (and scan_code) are instead of doing "exec co in mod.__dict__"
+            try:
+                hookmodnm = 'hook-'+fqname
+                hooks = __import__('hooks', globals(), locals(), [hookmodnm])
+                hook = getattr(hooks, hookmodnm)
+                #print `hook`
+            except (ImportError, AttributeError):
+                pass
+            else:
+                # rearranged so that hook() has a chance to mess with hiddenimports & attrs
+                if hasattr(hook, 'hook'):
+                    mod = hook.hook(mod)
+                if hasattr(hook, 'hiddenimports'):
+                    for impnm in hook.hiddenimports:
+                        mod.imports.append((impnm, 0, 0))
+                if hasattr(hook, 'attrs'):
+                    for attr, val in hook.attrs:
+                        setattr(mod, attr, val)
+
+                if fqname != mod.__name__:
+                    print "W: %s is changing it's name to %s" % (fqname, mod.__name__)
+                    self.modules[mod.__name__] = mod
+        else:
+            self.modules[fqname] = None
+        return mod
+    def getwarnings(self):
+        warnings = self.warnings.keys()
+        for nm,mod in self.modules.items():
+            if mod:
+                for w in mod.warnings:
+                    warnings.append(w+' - %s (%s)' % (mod.__name__, mod.__file__))
+        return warnings
+    def getxref(self):
+        mods = self.modules.items() # (nm, mod)
+        mods.sort()
+        rslt = []
+        for nm, mod in mods:
+            if mod:
+                importers = mod._xref.keys()
+                importers.sort()
+                rslt.append((nm, importers))
+        return rslt
+
+#====================Modules============================#
+# All we're doing here is tracking, not importing
+# If we were importing, these would be hooked to the real module objects
+
+class Module:
+    _ispkg = 0
+    typ = 'UNKNOWN'
+    def __init__(self, nm):
+        self.__name__ = nm
+        self._all = []
+        self.imports = []
+        self.warnings = []
+        self._xref = {}
+    def ispackage(self):
+        return self._ispkg
+    def doimport(self, nm):
+        pass
+    def xref(self, nm):
+        self._xref[nm] = 1
+
+class BuiltinModule(Module):
+    typ = 'BUILTIN'
+    def __init__(self, nm):
+        Module.__init__(self, nm)
+
+class ExtensionModule(Module):
+    typ = 'EXTENSION'
+    def __init__(self, nm, pth):
+        Module.__init__(self, nm)
+        self.__file__ = pth
+
+class PyModule(Module):
+    typ = 'PYMODULE'
+    def __init__(self, nm, pth, co):
+        Module.__init__(self, nm)
+        self.co = co
+        self.__file__ = pth
+        if os.path.splitext(self.__file__)[1] == '.py':
+            if __debug__:
+                self.__file__ = self.__file__ + 'c'
+            else:
+                self.__file__ = self.__file__ + 'o'
+        self.scancode()
+    def scancode(self):
+        self.imports, self.warnings, allnms = scan_code(self.co)
+        if allnms:
+            self._all = allnms
+
+class PyScript(PyModule):
+    typ = 'PYSOURCE'
+    def __init__(self, pth, co):
+        Module.__init__(self, '__main__')
+        self.co = co
+        self.__file__ = pth
+        self.scancode()
+
+class PkgModule(PyModule):
+    typ = 'PYMODULE'
+    def __init__(self, nm, pth, co):
+        PyModule.__init__(self, nm, pth, co)
+        self._ispkg = 1
+        pth = os.path.dirname(pth)
+        self.__path__ = [ pth ]
+        self.subimporter = PathImportDirector(self.__path__)
+    def doimport(self, nm):
+        mod = self.subimporter.getmod(nm)
+        if mod:
+            mod.__name__ = self.__name__ + '.' + mod.__name__
+        return mod
+
+class PkgInPYZModule(PyModule):
+    def __init__(self, nm, co, pyzowner):
+        PyModule.__init__(self, nm, co.co_filename, co)
+        self._ispkg = 1
+        self.__path__ = [ str(pyzowner) ]
+        self.owner = pyzowner
+    def doimport(self, nm):
+        mod = self.owner.getmod(self.__name__ + '.' + nm)
+        return mod
+
+#======================== Utility ================================#
+# Scan the code object for imports, __all__ and wierd stuff
+
+import dis
+IMPORT_NAME = dis.opname.index('IMPORT_NAME')
+IMPORT_FROM = dis.opname.index('IMPORT_FROM')
+try:
+    IMPORT_STAR = dis.opname.index('IMPORT_STAR')
+except:
+    IMPORT_STAR = 999
+STORE_NAME = dis.opname.index('STORE_NAME')
+STORE_FAST = dis.opname.index('STORE_FAST')
+STORE_GLOBAL = dis.opname.index('STORE_GLOBAL')
+LOAD_GLOBAL = dis.opname.index('LOAD_GLOBAL')
+EXEC_STMT = dis.opname.index('EXEC_STMT')
+try:
+    SET_LINENO = dis.opname.index('SET_LINENO')
+except ValueError:
+    SET_LINENO = 999
+BUILD_LIST = dis.opname.index('BUILD_LIST')
+LOAD_CONST = dis.opname.index('LOAD_CONST')
+JUMP_IF_FALSE = dis.opname.index('JUMP_IF_FALSE')
+JUMP_IF_TRUE = dis.opname.index('JUMP_IF_TRUE')
+JUMP_FORWARD = dis.opname.index('JUMP_FORWARD')
+try:
+    STORE_DEREF = dis.opname.index('STORE_DEREF')
+except ValueError:
+    STORE_DEREF = 999
+COND_OPS = [JUMP_IF_TRUE, JUMP_IF_FALSE]
+STORE_OPS = [STORE_NAME, STORE_FAST, STORE_GLOBAL, STORE_DEREF]
+#IMPORT_STAR -> IMPORT_NAME mod ; IMPORT_STAR
+#JUMP_IF_FALSE / JUMP_IF_TRUE / JUMP_FORWARD
+
+def pass1(code):
+    instrs = []
+    i = 0
+    n = len(code)
+    curline = 0
+    incondition = 0
+    out = 0
+    while i < n:
+        if i >= out:
+            incondition = 0
+        c = code[i]
+        i = i+1
+        op = ord(c)
+        if op >= dis.HAVE_ARGUMENT:
+            oparg = ord(code[i]) + ord(code[i+1])*256
+            i = i+2
+        else:
+            oparg = None
+        if not incondition and op in COND_OPS:
+            incondition = 1
+            out = i + oparg
+        elif incondition and op == JUMP_FORWARD:
+            out = max(out, i + oparg)
+        if op == SET_LINENO:
+            curline = oparg
+        else:
+            instrs.append((op, oparg, incondition, curline))
+    return instrs
+
+def scan_code(co, m=None, w=None, nested=0):
+    instrs = pass1(co.co_code)
+    if m is None:
+        m = []
+    if w is None:
+        w = []
+    all = None
+    lastname = None
+    for i in range(len(instrs)):
+        op, oparg, conditional, curline = instrs[i]
+        if op == IMPORT_NAME:
+            name = lastname = co.co_names[oparg]
+            m.append((name, nested, conditional))
+        elif op == IMPORT_FROM:
+            name = co.co_names[oparg]
+            m.append((lastname+'.'+name, nested, conditional))
+            assert lastname is not None
+        elif op == IMPORT_STAR:
+            m.append((lastname+'.*', nested, conditional))
+        elif op == STORE_NAME:
+            if co.co_names[oparg] == "__all__":
+                j = i - 1
+                pop, poparg, pcondtl, pline = instrs[j]
+                if pop != BUILD_LIST:
+                    w.append("W: __all__ is built strangely at line %s" % pline)
+                else:
+                    all = []
+                    while j > 0:
+                        j = j - 1
+                        pop, poparg, pcondtl, pline = instrs[j]
+                        if pop == LOAD_CONST:
+                            all.append(co.co_consts[poparg])
+                        else:
+                            break
+        elif op in STORE_OPS:
+            pass
+        elif op == LOAD_GLOBAL:
+            name = co.co_names[oparg]
+            cndtl = ['', 'conditional'][conditional]
+            lvl = ['top-level', 'delayed'][nested]
+            if name == "__import__":
+                w.append("W: %s %s __import__ hack detected at line %s"  % (lvl, cndtl, curline))
+            elif name == "eval":
+                w.append("W: %s %s eval hack detected at line %s"  % (lvl, cndtl, curline))
+        elif op == EXEC_STMT:
+            cndtl = ['', 'conditional'][conditional]
+            lvl = ['top-level', 'delayed'][nested]
+            w.append("W: %s %s exec statement detected at line %s"  % (lvl, cndtl, curline))
+        else:
+            lastname = None
+    for c in co.co_consts:
+        if isinstance(c, type(co)):
+            scan_code(c, m, w, 1)
+    return m, w, all
Binary file srcanamdw/codescanner/pyinstaller/mf.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/optik/__init__.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,35 @@
+"""optik
+
+A powerful, extensible, and easy-to-use command-line parser for Python.
+
+By Greg Ward <gward@python.net>
+
+See http://optik.sourceforge.net/
+"""
+
+# Copyright (c) 2001-2004 Gregory P. Ward.  All rights reserved.
+# See the README.txt distributed with Optik for licensing terms.
+
+__revision__ = "$Id: __init__.py,v 1.1 2009/02/05 23:03:30 stechong Exp $"
+
+__version__ = "1.5"
+
+
+# Re-import these for convenience
+from optik.option import Option
+from optik.option_parser import *
+from optik.help import *
+from optik.errors import *
+
+from optik import option, option_parser, help, errors
+__all__ = (option.__all__ +
+           option_parser.__all__ +
+           help.__all__ +
+           errors.__all__)
+
+
+# Some day, there might be many Option classes.  As of Optik 1.3, the
+# preferred way to instantiate Options is indirectly, via make_option(),
+# which will become a factory function when there are many Option
+# classes.
+make_option = Option
Binary file srcanamdw/codescanner/pyinstaller/optik/__init__.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/optik/errors.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,78 @@
+"""optik.errors
+
+Exception classes used by Optik.
+"""
+
+# Copyright (c) 2001-2004 Gregory P. Ward.  All rights reserved.
+# See the README.txt distributed with Optik for licensing terms.
+
+import string
+try:
+    from gettext import gettext
+except ImportError:
+    def gettext(message):
+        return message
+_ = gettext
+
+__revision__ = "$Id: errors.py,v 1.1 2009/02/05 23:03:30 stechong Exp $"
+
+__all__ = ['OptikError', 'OptionError', 'OptionConflictError',
+           'OptionValueError', 'BadOptionError']
+
+
+class OptikError (Exception):
+    def __init__(self, msg):
+        self.msg = msg
+
+    def __str__(self):
+        return self.msg
+
+
+class OptionError (OptikError):
+    """
+    Raised if an Option instance is created with invalid or
+    inconsistent arguments.
+    """
+
+    def __init__(self, msg, option):
+        self.msg = msg
+        self.option_id = str(option)
+
+    def __str__(self):
+        if self.option_id:
+            return "option %s: %s" % (self.option_id, self.msg)
+        else:
+            return self.msg
+
+class OptionConflictError (OptionError):
+    """
+    Raised if conflicting options are added to an OptionParser.
+    """
+
+class OptionValueError (OptikError):
+    """
+    Raised if an invalid option value is encountered on the command
+    line.
+    """
+
+class BadOptionError (OptikError):
+    """
+    Raised if an invalid option is seen on the command line.
+    """
+    def __init__(self, opt_str):
+        self.opt_str = opt_str
+
+    def __str__(self):
+        return _("no such option: %s") % self.opt_str
+
+class AmbiguousOptionError (BadOptionError):
+    """
+    Raised if an ambiguous option is seen on the command line.
+    """
+    def __init__(self, opt_str, possibilities):
+        BadOptionError.__init__(self, opt_str)
+        self.possibilities = possibilities
+
+    def __str__(self):
+        return (_("ambiguous option: %s (%s?)")
+                % (self.opt_str, string.join(self.possibilities, ", ")))
Binary file srcanamdw/codescanner/pyinstaller/optik/errors.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/optik/help.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,249 @@
+"""optik.help
+
+Provides HelpFormatter and subclasses -- used by OptionParser
+to generate formatted help text.
+"""
+
+# Copyright (c) 2001-2004 Gregory P. Ward.  All rights reserved.
+# See the README.txt distributed with Optik for licensing terms.
+
+import os
+import string
+import textwrap
+from optik.option import NO_DEFAULT
+from optik.errors import gettext
+_ = gettext
+
+__revision__ = "$Id: help.py,v 1.1 2009/02/05 23:03:30 stechong Exp $"
+
+__all__ = ['HelpFormatter', 'IndentedHelpFormatter', 'TitledHelpFormatter']
+
+class HelpFormatter:
+
+    """
+    Abstract base class for formatting option help.  OptionParser
+    instances should use one of the HelpFormatter subclasses for
+    formatting help; by default IndentedHelpFormatter is used.
+
+    Instance attributes:
+      parser : OptionParser
+        the controlling OptionParser instance
+      indent_increment : int
+        the number of columns to indent per nesting level
+      max_help_position : int
+        the maximum starting column for option help text
+      help_position : int
+        the calculated starting column for option help text;
+        initially the same as the maximum
+      width : int
+        total number of columns for output (pass None to constructor for
+        this value to be taken from the $COLUMNS environment variable)
+      level : int
+        current indentation level
+      current_indent : int
+        current indentation level (in columns)
+      help_width : int
+        number of columns available for option help text (calculated)
+      default_tag : str
+        text to replace with each option's default value, "%default"
+        by default.  Set to false value to disable default value expansion.
+      option_strings : { Option : str }
+        maps Option instances to the snippet of help text explaining
+        the syntax of that option, e.g. "-h, --help" or
+        "-fFILE, --file=FILE"
+      _short_opt_fmt : str
+        format string controlling how short options with values are
+        printed in help text.  Must be either "%s%s" ("-fFILE") or
+        "%s %s" ("-f FILE"), because those are the two syntaxes that
+        Optik supports.
+      _long_opt_fmt : str
+        similar but for long options; must be either "%s %s" ("--file FILE")
+        or "%s=%s" ("--file=FILE").
+    """
+
+    NO_DEFAULT_VALUE = "none"
+
+    def __init__(self,
+                 indent_increment,
+                 max_help_position,
+                 width,
+                 short_first):
+        self.parser = None
+        self.indent_increment = indent_increment
+        self.help_position = self.max_help_position = max_help_position
+        if width is None:
+            try:
+                width = int(os.environ['COLUMNS'])
+            except (KeyError, ValueError):
+                width = 80
+            width = width - 2
+        self.width = width
+        self.current_indent = 0
+        self.level = 0
+        self.help_width = None          # computed later
+        self.short_first = short_first
+        self.default_tag = "%default"
+        self.option_strings = {}
+        self._short_opt_fmt = "%s %s"
+        self._long_opt_fmt = "%s=%s"
+
+    def set_parser(self, parser):
+        self.parser = parser
+
+    def set_short_opt_delimiter(self, delim):
+        if delim not in ("", " "):
+            raise ValueError(
+                "invalid metavar delimiter for short options: %r" % delim)
+        self._short_opt_fmt = "%s" + delim + "%s"
+
+    def set_long_opt_delimiter(self, delim):
+        if delim not in ("=", " "):
+            raise ValueError(
+                "invalid metavar delimiter for long options: %r" % delim)
+        self._long_opt_fmt = "%s" + delim + "%s"
+
+    def indent(self):
+        self.current_indent = self.current_indent + self.indent_increment
+        self.level = self.level + 1
+
+    def dedent(self):
+        self.current_indent = self.current_indent - self.indent_increment
+        assert self.current_indent >= 0, "Indent decreased below 0."
+        self.level = self.level - 1
+
+    def format_usage(self, usage):
+        raise NotImplementedError, "subclasses must implement"
+
+    def format_heading(self, heading):
+        raise NotImplementedError, "subclasses must implement"
+
+    def format_description(self, description):
+        if not description:
+            return ""
+        desc_width = self.width - self.current_indent
+        indent = " "*self.current_indent
+        return textwrap.fill(description,
+                             desc_width,
+                             initial_indent=indent,
+                             subsequent_indent=indent) + "\n"
+
+    def expand_default(self, option):
+        if self.parser is None or not self.default_tag:
+            return option.help
+
+        default_value = self.parser.defaults.get(option.dest)
+        if default_value is NO_DEFAULT or default_value is None:
+            default_value = self.NO_DEFAULT_VALUE
+
+        return string.replace(option.help, self.default_tag, str(default_value))
+
+    def format_option(self, option):
+        # The help for each option consists of two parts:
+        #   * the opt strings and metavars
+        #     eg. ("-x", or "-fFILENAME, --file=FILENAME")
+        #   * the user-supplied help string
+        #     eg. ("turn on expert mode", "read data from FILENAME")
+        #
+        # If possible, we write both of these on the same line:
+        #   -x      turn on expert mode
+        #
+        # But if the opt string list is too long, we put the help
+        # string on a second line, indented to the same column it would
+        # start in if it fit on the first line.
+        #   -fFILENAME, --file=FILENAME
+        #           read data from FILENAME
+        result = []
+        opts = self.option_strings[option]
+        opt_width = self.help_position - self.current_indent - 2
+        if len(opts) > opt_width:
+            opts = "%*s%s\n" % (self.current_indent, "", opts)
+            indent_first = self.help_position
+        else:                       # start help on same line as opts
+            opts = "%*s%-*s  " % (self.current_indent, "", opt_width, opts)
+            indent_first = 0
+        result.append(opts)
+        if option.help:
+            help_text = self.expand_default(option)
+            help_lines = textwrap.wrap(help_text, self.help_width)
+            result.append("%*s%s\n" % (indent_first, "", help_lines[0]))
+            for line in help_lines[1:]:
+                result.append("%*s%s\n" % (self.help_position, "", line))
+        elif opts[-1] != "\n":
+            result.append("\n")
+        return string.join(result, "")
+
+    def store_option_strings(self, parser):
+        self.indent()
+        max_len = 0
+        for opt in parser.option_list:
+            strings = self.format_option_strings(opt)
+            self.option_strings[opt] = strings
+            max_len = max(max_len, len(strings) + self.current_indent)
+        self.indent()
+        for group in parser.option_groups:
+            for opt in group.option_list:
+                strings = self.format_option_strings(opt)
+                self.option_strings[opt] = strings
+                max_len = max(max_len, len(strings) + self.current_indent)
+        self.dedent()
+        self.dedent()
+        self.help_position = min(max_len + 2, self.max_help_position)
+        self.help_width = self.width - self.help_position
+
+    def format_option_strings(self, option):
+        """Return a comma-separated list of option strings & metavariables."""
+        if option.takes_value():
+            metavar = option.metavar or string.upper(option.dest)
+            short_opts = []
+            for sopt in option._short_opts:
+                short_opts.append(self._short_opt_fmt % (sopt, metavar))
+            long_opts = []
+            for lopt in option._long_opts:
+                long_opts.append(self._long_opt_fmt % (lopt, metavar))
+        else:
+            short_opts = option._short_opts
+            long_opts = option._long_opts
+
+        if self.short_first:
+            opts = short_opts + long_opts
+        else:
+            opts = long_opts + short_opts
+
+        return string.join(opts, ", ")
+
+class IndentedHelpFormatter (HelpFormatter):
+    """Format help with indented section bodies.
+    """
+
+    def __init__(self,
+                 indent_increment=2,
+                 max_help_position=24,
+                 width=None,
+                 short_first=1):
+        HelpFormatter.__init__(
+            self, indent_increment, max_help_position, width, short_first)
+
+    def format_usage(self, usage):
+        return _("usage: %s\n") % usage
+
+    def format_heading(self, heading):
+        return "%*s%s:\n" % (self.current_indent, "", heading)
+
+
+class TitledHelpFormatter (HelpFormatter):
+    """Format help with underlined section headers.
+    """
+
+    def __init__(self,
+                 indent_increment=0,
+                 max_help_position=24,
+                 width=None,
+                 short_first=0):
+        HelpFormatter.__init__ (
+            self, indent_increment, max_help_position, width, short_first)
+
+    def format_usage(self, usage):
+        return "%s  %s\n" % (self.format_heading(_("Usage")), usage)
+
+    def format_heading(self, heading):
+        return "%s\n%s\n" % (heading, "=-"[self.level] * len(heading))
Binary file srcanamdw/codescanner/pyinstaller/optik/help.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/optik/option.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,458 @@
+"""optik.option
+
+Defines the Option class and some standard value-checking functions.
+"""
+
+# Copyright (c) 2001-2004 Gregory P. Ward.  All rights reserved.
+# See the README.txt distributed with Optik for licensing terms.
+
+import sys
+import types, string
+from optik.errors import OptionError, OptionValueError, gettext
+_ = gettext
+
+__revision__ = "$Id: option.py,v 1.1 2009/02/05 23:03:30 stechong Exp $"
+
+__all__ = ['Option']
+
+# Do the right thing with boolean values for all known Python versions.
+try:
+    True, False
+except NameError:
+    (True, False) = (1, 0)
+
+# For Python 1.5, just ignore unicode (try it as str)
+try:
+    unicode
+except NameError:
+    unicode=str
+try:
+    types.UnicodeType
+except AttributeError:
+    types.UnicodeType = types.StringType
+
+_idmax = 2L * sys.maxint + 1
+
+def _repr(self):
+    return "<%s at 0x%x: %s>" % (self.__class__.__name__,
+                                 id(self) & _idmax,
+                                 self)
+
+def _parse_num(val, type):
+    if string.lower(val[:2]) == "0x":   # hexadecimal
+        radix = 16
+    elif string.lower(val[:2]) == "0b": # binary
+        radix = 2
+        val = val[2:] or "0"            # have to remove "0b" prefix
+    elif val[:1] == "0":                # octal
+        radix = 8
+    else:                               # decimal
+        radix = 10
+
+    try:
+        return type(val, radix)
+    except TypeError:
+        # In Python pre-2.0, int() and long() did not support the radix
+        # argument. We catch the type error (not to be confused with ValueError,
+        # which is a real parsing failure), and try again with string.atol.
+        return type(string.atol(val, radix))
+
+def _parse_int(val):
+    return _parse_num(val, int)
+
+def _parse_long(val):
+    return _parse_num(val, long)
+
+_builtin_cvt = { "int" : (_parse_int, _("integer")),
+                 "long" : (_parse_long, _("long integer")),
+                 "float" : (float, _("floating-point")),
+                 "complex" : (complex, _("complex")) }
+
+def check_builtin(option, opt, value):
+    (cvt, what) = _builtin_cvt[option.type]
+    try:
+        return cvt(value)
+    except ValueError:
+        raise OptionValueError(
+            _("option %s: invalid %s value: %s") % (opt, what, repr(value)))
+
+def check_choice(option, opt, value):
+    if value in option.choices:
+        return value
+    else:
+        choices = string.join(map(repr, option.choices), ", ")
+        raise OptionValueError(
+            _("option %s: invalid choice: %s (choose from %s)")
+            % (opt, repr(value), choices))
+
+# Not supplying a default is different from a default of None,
+# so we need an explicit "not supplied" value.
+NO_DEFAULT = ("NO", "DEFAULT")
+
+
+class Option:
+    """
+    Instance attributes:
+      _short_opts : [string]
+      _long_opts : [string]
+
+      action : string
+      type : string
+      dest : string
+      default : any
+      nargs : int
+      const : any
+      choices : [string]
+      callback : function
+      callback_args : (any*)
+      callback_kwargs : { string : any }
+      help : string
+      metavar : string
+    """
+
+    # The list of instance attributes that may be set through
+    # keyword args to the constructor.
+    ATTRS = ['action',
+             'type',
+             'dest',
+             'default',
+             'nargs',
+             'const',
+             'choices',
+             'callback',
+             'callback_args',
+             'callback_kwargs',
+             'help',
+             'metavar']
+
+    # The set of actions allowed by option parsers.  Explicitly listed
+    # here so the constructor can validate its arguments.
+    ACTIONS = ("store",
+               "store_const",
+               "store_true",
+               "store_false",
+               "append",
+               "append_const",
+               "count",
+               "callback",
+               "help",
+               "version")
+
+    # The set of actions that involve storing a value somewhere;
+    # also listed just for constructor argument validation.  (If
+    # the action is one of these, there must be a destination.)
+    STORE_ACTIONS = ("store",
+                     "store_const",
+                     "store_true",
+                     "store_false",
+                     "append",
+                     "append_const",
+                     "count")
+
+    # The set of actions for which it makes sense to supply a value
+    # type, ie. which may consume an argument from the command line.
+    TYPED_ACTIONS = ("store",
+                     "append",
+                     "callback")
+
+    # The set of actions which *require* a value type, ie. that
+    # always consume an argument from the command line.
+    ALWAYS_TYPED_ACTIONS = ("store",
+                            "append")
+
+    # The set of actions which take a 'const' attribute.
+    CONST_ACTIONS = ("store_const",
+                     "append_const")
+
+    # The set of known types for option parsers.  Again, listed here for
+    # constructor argument validation.
+    TYPES = ("string", "int", "long", "float", "complex", "choice")
+
+    # Dictionary of argument checking functions, which convert and
+    # validate option arguments according to the option type.
+    #
+    # Signature of checking functions is:
+    #   check(option : Option, opt : string, value : string) -> any
+    # where
+    #   option is the Option instance calling the checker
+    #   opt is the actual option seen on the command-line
+    #     (eg. "-a", "--file")
+    #   value is the option argument seen on the command-line
+    #
+    # The return value should be in the appropriate Python type
+    # for option.type -- eg. an integer if option.type == "int".
+    #
+    # If no checker is defined for a type, arguments will be
+    # unchecked and remain strings.
+    TYPE_CHECKER = { "int"    : check_builtin,
+                     "long"   : check_builtin,
+                     "float"  : check_builtin,
+                     "complex": check_builtin,
+                     "choice" : check_choice,
+                   }
+
+
+    # CHECK_METHODS is a list of unbound method objects; they are called
+    # by the constructor, in order, after all attributes are
+    # initialized.  The list is created and filled in later, after all
+    # the methods are actually defined.  (I just put it here because I
+    # like to define and document all class attributes in the same
+    # place.)  Subclasses that add another _check_*() method should
+    # define their own CHECK_METHODS list that adds their check method
+    # to those from this class.
+    CHECK_METHODS = None
+
+
+    # -- Constructor/initialization methods ----------------------------
+
+    def __init__(self, *opts, **attrs):
+        # Set _short_opts, _long_opts attrs from 'opts' tuple.
+        # Have to be set now, in case no option strings are supplied.
+        self._short_opts = []
+        self._long_opts = []
+        opts = self._check_opt_strings(opts)
+        self._set_opt_strings(opts)
+
+        # Set all other attrs (action, type, etc.) from 'attrs' dict
+        self._set_attrs(attrs)
+
+        # Check all the attributes we just set.  There are lots of
+        # complicated interdependencies, but luckily they can be farmed
+        # out to the _check_*() methods listed in CHECK_METHODS -- which
+        # could be handy for subclasses!  The one thing these all share
+        # is that they raise OptionError if they discover a problem.
+        for checker in self.CHECK_METHODS:
+            checker(self)
+
+    def _check_opt_strings(self, opts):
+        # Filter out None because early versions of Optik had exactly
+        # one short option and one long option, either of which
+        # could be None.
+        opts = filter(None, opts)
+        if not opts:
+            raise TypeError("at least one option string must be supplied")
+        return opts
+
+    def _set_opt_strings(self, opts):
+        for opt in opts:
+            if len(opt) < 2:
+                raise OptionError(
+                    "invalid option string %s: "
+                    "must be at least two characters long" % repr(opt), self)
+            elif len(opt) == 2:
+                if not (opt[0] == "-" and opt[1] != "-"):
+                    raise OptionError(
+                        "invalid short option string %s: "
+                        "must be of the form -x, (x any non-dash char)" % repr(opt),
+                        self)
+                self._short_opts.append(opt)
+            else:
+                if not (opt[0:2] == "--" and opt[2] != "-"):
+                    raise OptionError(
+                        "invalid long option string %s: "
+                        "must start with --, followed by non-dash" % repr(opt),
+                        self)
+                self._long_opts.append(opt)
+
+    def _set_attrs(self, attrs):
+        for attr in self.ATTRS:
+            if attrs.has_key(attr):
+                setattr(self, attr, attrs[attr])
+                del attrs[attr]
+            else:
+                if attr == 'default':
+                    setattr(self, attr, NO_DEFAULT)
+                else:
+                    setattr(self, attr, None)
+        if attrs:
+            raise OptionError(
+                "invalid keyword arguments: %s" % string.join(attrs.keys(), ", "),
+                self)
+
+
+    # -- Constructor validation methods --------------------------------
+
+    def _check_action(self):
+        if self.action is None:
+            self.action = "store"
+        elif self.action not in self.ACTIONS:
+            raise OptionError("invalid action: %s" % repr(self.action), self)
+
+    def _check_type(self):
+        if self.type is None:
+            if self.action in self.ALWAYS_TYPED_ACTIONS:
+                if self.choices is not None:
+                    # The "choices" attribute implies "choice" type.
+                    self.type = "choice"
+                else:
+                    # No type given?  "string" is the most sensible default.
+                    self.type = "string"
+        else:
+            # Allow type objects as an alternative to their names.
+            if hasattr(self.type, "__name__"):
+                self.type = self.type.__name__
+            if self.type == "str":
+                self.type = "string"
+
+            if self.type not in self.TYPES:
+                raise OptionError("invalid option type: %s" % repr(self.type), self)
+            if self.action not in self.TYPED_ACTIONS:
+                raise OptionError(
+                    "must not supply a type for action %s" % repr(self.action), self)
+
+    def _check_choice(self):
+        if self.type == "choice":
+            if self.choices is None:
+                raise OptionError(
+                    "must supply a list of choices for type 'choice'", self)
+            elif type(self.choices) not in (types.TupleType, types.ListType):
+                raise OptionError(
+                    "choices must be a list of strings ('%s' supplied)"
+                    % string.split(str(type(self.choices)), "'")[1], self)
+        elif self.choices is not None:
+            raise OptionError(
+                "must not supply choices for type %s" % repr(self.type), self)
+
+    def _check_dest(self):
+        # No destination given, and we need one for this action.  The
+        # self.type check is for callbacks that take a value.
+        takes_value = (self.action in self.STORE_ACTIONS or
+                       self.type is not None)
+        if self.dest is None and takes_value:
+
+            # Glean a destination from the first long option string,
+            # or from the first short option string if no long options.
+            if self._long_opts:
+                # eg. "--foo-bar" -> "foo_bar"
+                self.dest = string.replace(self._long_opts[0][2:], '-', '_')
+            else:
+                self.dest = self._short_opts[0][1]
+
+    def _check_const(self):
+        if self.action not in self.CONST_ACTIONS and self.const is not None:
+            raise OptionError(
+                "'const' must not be supplied for action %s" % repr(self.action),
+                self)
+
+    def _check_nargs(self):
+        if self.action in self.TYPED_ACTIONS:
+            if self.nargs is None:
+                self.nargs = 1
+        elif self.nargs is not None:
+            raise OptionError(
+                "'nargs' must not be supplied for action %s" % repr(self.action),
+                self)
+
+    def _check_callback(self):
+        if self.action == "callback":
+            if not callable(self.callback):
+                raise OptionError(
+                    "callback not callable: %s" % repr(self.callback), self)
+            if (self.callback_args is not None and
+                type(self.callback_args) is not types.TupleType):
+                raise OptionError(
+                    "callback_args, if supplied, must be a tuple: not %s"
+                    % repr(self.callback_args), self)
+            if (self.callback_kwargs is not None and
+                type(self.callback_kwargs) is not types.DictType):
+                raise OptionError(
+                    "callback_kwargs, if supplied, must be a dict: not %s"
+                    % repr(self.callback_kwargs), self)
+        else:
+            if self.callback is not None:
+                raise OptionError(
+                    "callback supplied (%s) for non-callback option"
+                    % repr(self.callback), self)
+            if self.callback_args is not None:
+                raise OptionError(
+                    "callback_args supplied for non-callback option", self)
+            if self.callback_kwargs is not None:
+                raise OptionError(
+                    "callback_kwargs supplied for non-callback option", self)
+
+
+    CHECK_METHODS = [_check_action,
+                     _check_type,
+                     _check_choice,
+                     _check_dest,
+                     _check_const,
+                     _check_nargs,
+                     _check_callback]
+
+
+    # -- Miscellaneous methods -----------------------------------------
+
+    def __str__(self):
+        return string.join(self._short_opts + self._long_opts, "/")
+
+    __repr__ = _repr
+
+    def takes_value(self):
+        return self.type is not None
+
+    def get_opt_string(self):
+        if self._long_opts:
+            return self._long_opts[0]
+        else:
+            return self._short_opts[0]
+
+
+    # -- Processing methods --------------------------------------------
+
+    def check_value(self, opt, value):
+        checker = self.TYPE_CHECKER.get(self.type)
+        if checker is None:
+            return value
+        else:
+            return checker(self, opt, value)
+
+    def convert_value(self, opt, value):
+        if value is not None:
+            if self.nargs == 1:
+                return self.check_value(opt, value)
+            else:
+                return tuple(map(lambda v,self=self,opt=opt: self.check_value(opt, v), value))
+
+    def process(self, opt, value, values, parser):
+
+        # First, convert the value(s) to the right type.  Howl if any
+        # value(s) are bogus.
+        value = self.convert_value(opt, value)
+
+        # And then take whatever action is expected of us.
+        # This is a separate method to make life easier for
+        # subclasses to add new actions.
+        return self.take_action(
+            self.action, self.dest, opt, value, values, parser)
+
+    def take_action(self, action, dest, opt, value, values, parser):
+        if action == "store":
+            setattr(values, dest, value)
+        elif action == "store_const":
+            setattr(values, dest, self.const)
+        elif action == "store_true":
+            setattr(values, dest, True)
+        elif action == "store_false":
+            setattr(values, dest, False)
+        elif action == "append":
+            values.ensure_value(dest, []).append(value)
+        elif action == "append_const":
+            values.ensure_value(dest, []).append(self.const)
+        elif action == "count":
+            setattr(values, dest, values.ensure_value(dest, 0) + 1)
+        elif action == "callback":
+            args = self.callback_args or ()
+            kwargs = self.callback_kwargs or {}
+            apply(self.callback, (self, opt, value, parser)+args, kwargs)
+        elif action == "help":
+            parser.print_help()
+            parser.exit()
+        elif action == "version":
+            parser.print_version()
+            parser.exit()
+        else:
+            raise RuntimeError, "unknown action %s" % repr(self.action)
+
+        return 1
+
+# class Option
Binary file srcanamdw/codescanner/pyinstaller/optik/option.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/optik/option_parser.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,849 @@
+"""optik.option_parser
+
+Provides the OptionParser and Values classes.
+"""
+
+# Copyright (c) 2001-2004 Gregory P. Ward.  All rights reserved.
+# See the README.txt distributed with Optik for licensing terms.
+
+import sys, os
+import types, string
+from optik.option import Option, NO_DEFAULT, _repr
+from optik.help import IndentedHelpFormatter
+from optik import errors
+from optik.errors import gettext
+_ = gettext
+
+__revision__ = "$Id: option_parser.py,v 1.1 2009/02/05 23:03:30 stechong Exp $"
+
+__all__ = ['SUPPRESS_HELP', 'SUPPRESS_USAGE',
+           'Values', 'OptionContainer', 'OptionGroup', 'OptionParser']
+
+
+SUPPRESS_HELP = "SUPPRESS"+"HELP"
+SUPPRESS_USAGE = "SUPPRESS"+"USAGE"
+
+# For compatibility with Python 2.2
+try:
+    True, False
+except NameError:
+    (True, False) = (1, 0)
+def isbasestring(x):
+    return isinstance(x, types.StringType) or isinstance(x, types.UnicodeType)
+if not hasattr(string, "startswith"):
+    def startswith(s, prefix):
+        return s[:len(prefix)] == prefix
+    string.startswith = startswith
+
+class Values:
+
+    def __init__(self, defaults=None):
+        if defaults:
+            for (attr, val) in defaults.items():
+                setattr(self, attr, val)
+
+    def __str__(self):
+        return str(self.__dict__)
+
+    __repr__ = _repr
+
+    def __cmp__(self, other):
+        if isinstance(other, Values):
+            return cmp(self.__dict__, other.__dict__)
+        elif isinstance(other, types.DictType):
+            return cmp(self.__dict__, other)
+        else:
+            return -1
+
+    def _update_careful(self, dict):
+        """
+        Update the option values from an arbitrary dictionary, but only
+        use keys from dict that already have a corresponding attribute
+        in self.  Any keys in dict without a corresponding attribute
+        are silently ignored.
+        """
+        for attr in dir(self):
+            if dict.has_key(attr):
+                dval = dict[attr]
+                if dval is not None:
+                    setattr(self, attr, dval)
+
+    def _update_loose(self, dict):
+        """
+        Update the option values from an arbitrary dictionary,
+        using all keys from the dictionary regardless of whether
+        they have a corresponding attribute in self or not.
+        """
+        self.__dict__.update(dict)
+
+    def _update(self, dict, mode):
+        if mode == "careful":
+            self._update_careful(dict)
+        elif mode == "loose":
+            self._update_loose(dict)
+        else:
+            raise ValueError, "invalid update mode: %s" % repr(mode)
+
+    def read_module(self, modname, mode="careful"):
+        __import__(modname)
+        mod = sys.modules[modname]
+        self._update(vars(mod), mode)
+
+    def read_file(self, filename, mode="careful"):
+        vars = {}
+        execfile(filename, vars)
+        self._update(vars, mode)
+
+    def ensure_value(self, attr, value):
+        if not hasattr(self, attr) or getattr(self, attr) is None:
+            setattr(self, attr, value)
+        return getattr(self, attr)
+
+
+class OptionContainer:
+
+    """
+    Abstract base class.
+
+    Class attributes:
+      standard_option_list : [Option]
+        list of standard options that will be accepted by all instances
+        of this parser class (intended to be overridden by subclasses).
+
+    Instance attributes:
+      option_list : [Option]
+        the list of Option objects contained by this OptionContainer
+      _short_opt : { string : Option }
+        dictionary mapping short option strings, eg. "-f" or "-X",
+        to the Option instances that implement them.  If an Option
+        has multiple short option strings, it will appears in this
+        dictionary multiple times. [1]
+      _long_opt : { string : Option }
+        dictionary mapping long option strings, eg. "--file" or
+        "--exclude", to the Option instances that implement them.
+        Again, a given Option can occur multiple times in this
+        dictionary. [1]
+      defaults : { string : any }
+        dictionary mapping option destination names to default
+        values for each destination [1]
+
+    [1] These mappings are common to (shared by) all components of the
+        controlling OptionParser, where they are initially created.
+
+    """
+
+    def __init__(self, option_class, conflict_handler, description):
+        # Initialize the option list and related data structures.
+        # This method must be provided by subclasses, and it must
+        # initialize at least the following instance attributes:
+        # option_list, _short_opt, _long_opt, defaults.
+        self._create_option_list()
+
+        self.option_class = option_class
+        self.set_conflict_handler(conflict_handler)
+        self.set_description(description)
+
+    def _create_option_mappings(self):
+        # For use by OptionParser constructor -- create the master
+        # option mappings used by this OptionParser and all
+        # OptionGroups that it owns.
+        self._short_opt = {}            # single letter -> Option instance
+        self._long_opt = {}             # long option -> Option instance
+        self.defaults = {}              # maps option dest -> default value
+
+
+    def _share_option_mappings(self, parser):
+        # For use by OptionGroup constructor -- use shared option
+        # mappings from the OptionParser that owns this OptionGroup.
+        self._short_opt = parser._short_opt
+        self._long_opt = parser._long_opt
+        self.defaults = parser.defaults
+
+    def set_conflict_handler(self, handler):
+        if handler not in ("error", "resolve"):
+            raise ValueError, "invalid conflict_resolution value %s" % repr(handler)
+        self.conflict_handler = handler
+
+    def set_description(self, description):
+        self.description = description
+
+    def get_description(self):
+        return self.description
+
+
+    # -- Option-adding methods -----------------------------------------
+
+    def _check_conflict(self, option):
+        conflict_opts = []
+        for opt in option._short_opts:
+            if self._short_opt.has_key(opt):
+                conflict_opts.append((opt, self._short_opt[opt]))
+        for opt in option._long_opts:
+            if self._long_opt.has_key(opt):
+                conflict_opts.append((opt, self._long_opt[opt]))
+
+        if conflict_opts:
+            handler = self.conflict_handler
+            if handler == "error":
+                opts = []
+                for co in conflict_opts:
+                    opts.append(co[0])
+                raise errors.OptionConflictError(
+                    "conflicting option string(s): %s"
+                    % string.join(opts, ", "),
+                    option)
+            elif handler == "resolve":
+                for (opt, c_option) in conflict_opts:
+                    if string.startswith(opt, "--"):
+                        c_option._long_opts.remove(opt)
+                        del self._long_opt[opt]
+                    else:
+                        c_option._short_opts.remove(opt)
+                        del self._short_opt[opt]
+                    if not (c_option._short_opts or c_option._long_opts):
+                        c_option.container.option_list.remove(c_option)
+
+    def add_option(self, *args, **kwargs):
+        """add_option(Option)
+           add_option(opt_str, ..., kwarg=val, ...)
+        """
+        if type(args[0]) is types.StringType:
+            option = apply(self.option_class, args, kwargs)
+        elif len(args) == 1 and not kwargs:
+            option = args[0]
+            if not isinstance(option, Option):
+                raise TypeError, "not an Option instance: %s" % repr(option)
+        else:
+            raise TypeError, "invalid arguments"
+
+        self._check_conflict(option)
+
+        self.option_list.append(option)
+        option.container = self
+        for opt in option._short_opts:
+            self._short_opt[opt] = option
+        for opt in option._long_opts:
+            self._long_opt[opt] = option
+
+        if option.dest is not None:     # option has a dest, we need a default
+            if option.default is not NO_DEFAULT:
+                self.defaults[option.dest] = option.default
+            elif not self.defaults.has_key(option.dest):
+                self.defaults[option.dest] = None
+
+        return option
+
+    def add_options(self, option_list):
+        for option in option_list:
+            self.add_option(option)
+
+    # -- Option query/removal methods ----------------------------------
+
+    def get_option(self, opt_str):
+        return (self._short_opt.get(opt_str) or
+                self._long_opt.get(opt_str))
+
+    def has_option(self, opt_str):
+        return (self._short_opt.has_key(opt_str) or
+                self._long_opt.has_key(opt_str))
+
+    def remove_option(self, opt_str):
+        option = self._short_opt.get(opt_str)
+        if option is None:
+            option = self._long_opt.get(opt_str)
+        if option is None:
+            raise ValueError("no such option %s" % repr(opt_str))
+
+        for opt in option._short_opts:
+            del self._short_opt[opt]
+        for opt in option._long_opts:
+            del self._long_opt[opt]
+        option.container.option_list.remove(option)
+
+
+    # -- Help-formatting methods ---------------------------------------
+
+    def format_option_help(self, formatter):
+        if not self.option_list:
+            return ""
+        result = []
+        for option in self.option_list:
+            if not option.help is SUPPRESS_HELP:
+                result.append(formatter.format_option(option))
+        return string.join(result, "")
+
+    def format_description(self, formatter):
+        return formatter.format_description(self.get_description())
+
+    def format_help(self, formatter):
+        result = []
+        if self.description:
+            result.append(self.format_description(formatter))
+        if self.option_list:
+            result.append(self.format_option_help(formatter))
+        return string.join(result, "\n")
+
+
+class OptionGroup (OptionContainer):
+
+    def __init__(self, parser, title, description=None):
+        self.parser = parser
+        OptionContainer.__init__(
+            self, parser.option_class, parser.conflict_handler, description)
+        self.title = title
+
+    def _create_option_list(self):
+        self.option_list = []
+        self._share_option_mappings(self.parser)
+
+    def set_title(self, title):
+        self.title = title
+
+    # -- Help-formatting methods ---------------------------------------
+
+    def format_help(self, formatter):
+        result = formatter.format_heading(self.title)
+        formatter.indent()
+        result = result + OptionContainer.format_help(self, formatter)
+        formatter.dedent()
+        return result
+
+
+class OptionParser (OptionContainer):
+
+    """
+    Class attributes:
+      standard_option_list : [Option]
+        list of standard options that will be accepted by all instances
+        of this parser class (intended to be overridden by subclasses).
+
+    Instance attributes:
+      usage : string
+        a usage string for your program.  Before it is displayed
+        to the user, "%prog" will be expanded to the name of
+        your program (self.prog or os.path.basename(sys.argv[0])).
+      prog : string
+        the name of the current program (to override
+        os.path.basename(sys.argv[0])).
+
+      option_groups : [OptionGroup]
+        list of option groups in this parser (option groups are
+        irrelevant for parsing the command-line, but very useful
+        for generating help)
+
+      allow_interspersed_args : bool = true
+        if true, positional arguments may be interspersed with options.
+        Assuming -a and -b each take a single argument, the command-line
+          -ablah foo bar -bboo baz
+        will be interpreted the same as
+          -ablah -bboo -- foo bar baz
+        If this flag were false, that command line would be interpreted as
+          -ablah -- foo bar -bboo baz
+        -- ie. we stop processing options as soon as we see the first
+        non-option argument.  (This is the tradition followed by
+        Python's getopt module, Perl's Getopt::Std, and other argument-
+        parsing libraries, but it is generally annoying to users.)
+
+      process_default_values : bool = true
+        if true, option default values are processed similarly to option
+        values from the command line: that is, they are passed to the
+        type-checking function for the option's type (as long as the
+        default value is a string).  (This really only matters if you
+        have defined custom types; see SF bug #955889.)  Set it to false
+        to restore the behaviour of Optik 1.4.1 and earlier.
+
+      rargs : [string]
+        the argument list currently being parsed.  Only set when
+        parse_args() is active, and continually trimmed down as
+        we consume arguments.  Mainly there for the benefit of
+        callback options.
+      largs : [string]
+        the list of leftover arguments that we have skipped while
+        parsing options.  If allow_interspersed_args is false, this
+        list is always empty.
+      values : Values
+        the set of option values currently being accumulated.  Only
+        set when parse_args() is active.  Also mainly for callbacks.
+
+    Because of the 'rargs', 'largs', and 'values' attributes,
+    OptionParser is not thread-safe.  If, for some perverse reason, you
+    need to parse command-line arguments simultaneously in different
+    threads, use different OptionParser instances.
+
+    """
+
+    standard_option_list = []
+
+    def __init__(self,
+                 usage=None,
+                 option_list=None,
+                 option_class=Option,
+                 version=None,
+                 conflict_handler="error",
+                 description=None,
+                 formatter=None,
+                 add_help_option=True,
+                 prog=None):
+        OptionContainer.__init__(
+            self, option_class, conflict_handler, description)
+        self.set_usage(usage)
+        self.prog = prog
+        self.version = version
+        self.allow_interspersed_args = True
+        self.process_default_values = True
+        if formatter is None:
+            formatter = IndentedHelpFormatter()
+        self.formatter = formatter
+        self.formatter.set_parser(self)
+
+        # Populate the option list; initial sources are the
+        # standard_option_list class attribute, the 'option_list'
+        # argument, and (if applicable) the _add_version_option() and
+        # _add_help_option() methods.
+        self._populate_option_list(option_list,
+                                   add_help=add_help_option)
+
+        self._init_parsing_state()
+
+    # -- Private methods -----------------------------------------------
+    # (used by our or OptionContainer's constructor)
+
+    def _create_option_list(self):
+        self.option_list = []
+        self.option_groups = []
+        self._create_option_mappings()
+
+    def _add_help_option(self):
+        self.add_option("-h", "--help",
+                        action="help",
+                        help=_("show this help message and exit"))
+
+    def _add_version_option(self):
+        self.add_option("--version",
+                        action="version",
+                        help=_("show program's version number and exit"))
+
+    def _populate_option_list(self, option_list, add_help=True):
+        if self.standard_option_list:
+            self.add_options(self.standard_option_list)
+        if option_list:
+            self.add_options(option_list)
+        if self.version:
+            self._add_version_option()
+        if add_help:
+            self._add_help_option()
+
+    def _init_parsing_state(self):
+        # These are set in parse_args() for the convenience of callbacks.
+        self.rargs = None
+        self.largs = None
+        self.values = None
+
+
+    # -- Simple modifier methods ---------------------------------------
+
+    def set_usage(self, usage):
+        if usage is None:
+            self.usage = _("%prog [options]")
+        elif usage is SUPPRESS_USAGE:
+            self.usage = None
+        # For backwards compatibility with Optik 1.3 and earlier.
+        elif string.startswith(usage, "usage:" + " "):
+            self.usage = usage[7:]
+        else:
+            self.usage = usage
+
+    def enable_interspersed_args(self):
+        self.allow_interspersed_args = True
+
+    def disable_interspersed_args(self):
+        self.allow_interspersed_args = False
+
+    def set_process_default_values(self, process):
+        self.process_default_values = process
+
+    def set_default(self, dest, value):
+        self.defaults[dest] = value
+
+    def set_defaults(self, **kwargs):
+        self.defaults.update(kwargs)
+
+    def _get_all_options(self):
+        options = self.option_list[:]
+        for group in self.option_groups:
+            options.extend(group.option_list)
+        return options
+
+    def get_default_values(self):
+        if not self.process_default_values:
+            # Old, pre-Optik 1.5 behaviour.
+            return Values(self.defaults)
+
+        defaults = self.defaults.copy()
+        for option in self._get_all_options():
+            default = defaults.get(option.dest)
+            if isbasestring(default):
+                opt_str = option.get_opt_string()
+                defaults[option.dest] = option.check_value(opt_str, default)
+
+        return Values(defaults)
+
+
+    # -- OptionGroup methods -------------------------------------------
+
+    def add_option_group(self, *args, **kwargs):
+        # XXX lots of overlap with OptionContainer.add_option()
+        if type(args[0]) is types.StringType:
+            group = apply(OptionGroup, (self,) + args, kwargs)
+        elif len(args) == 1 and not kwargs:
+            group = args[0]
+            if not isinstance(group, OptionGroup):
+                raise TypeError, "not an OptionGroup instance: %s" % repr(group)
+            if group.parser is not self:
+                raise ValueError, "invalid OptionGroup (wrong parser)"
+        else:
+            raise TypeError, "invalid arguments"
+
+        self.option_groups.append(group)
+        return group
+
+    def get_option_group(self, opt_str):
+        option = (self._short_opt.get(opt_str) or
+                  self._long_opt.get(opt_str))
+        if option and option.container is not self:
+            return option.container
+        return None
+
+
+    # -- Option-parsing methods ----------------------------------------
+
+    def _get_args(self, args):
+        if args is None:
+            return sys.argv[1:]
+        else:
+            return args[:]              # don't modify caller's list
+
+    def parse_args(self, args=None, values=None):
+        """
+        parse_args(args : [string] = sys.argv[1:],
+                   values : Values = None)
+        -> (values : Values, args : [string])
+
+        Parse the command-line options found in 'args' (default:
+        sys.argv[1:]).  Any errors result in a call to 'error()', which
+        by default prints the usage message to stderr and calls
+        sys.exit() with an error message.  On success returns a pair
+        (values, args) where 'values' is an Values instance (with all
+        your option values) and 'args' is the list of arguments left
+        over after parsing options.
+        """
+        rargs = self._get_args(args)
+        if values is None:
+            values = self.get_default_values()
+
+        # Store the halves of the argument list as attributes for the
+        # convenience of callbacks:
+        #   rargs
+        #     the rest of the command-line (the "r" stands for
+        #     "remaining" or "right-hand")
+        #   largs
+        #     the leftover arguments -- ie. what's left after removing
+        #     options and their arguments (the "l" stands for "leftover"
+        #     or "left-hand")
+        self.rargs = rargs
+        self.largs = largs = []
+        self.values = values
+
+        try:
+            stop = self._process_args(largs, rargs, values)
+        except (errors.BadOptionError, errors.OptionValueError), err:
+            self.error(str(err))
+
+        args = largs + rargs
+        return self.check_values(values, args)
+
+    def check_values(self, values, args):
+        """
+        check_values(values : Values, args : [string])
+        -> (values : Values, args : [string])
+
+        Check that the supplied option values and leftover arguments are
+        valid.  Returns the option values and leftover arguments
+        (possibly adjusted, possibly completely new -- whatever you
+        like).  Default implementation just returns the passed-in
+        values; subclasses may override as desired.
+        """
+        return (values, args)
+
+    def _process_args(self, largs, rargs, values):
+        """_process_args(largs : [string],
+                         rargs : [string],
+                         values : Values)
+
+        Process command-line arguments and populate 'values', consuming
+        options and arguments from 'rargs'.  If 'allow_interspersed_args' is
+        false, stop at the first non-option argument.  If true, accumulate any
+        interspersed non-option arguments in 'largs'.
+        """
+        while rargs:
+            arg = rargs[0]
+            # We handle bare "--" explicitly, and bare "-" is handled by the
+            # standard arg handler since the short arg case ensures that the
+            # len of the opt string is greater than 1.
+            if arg == "--":
+                del rargs[0]
+                return
+            elif arg[0:2] == "--":
+                # process a single long option (possibly with value(s))
+                self._process_long_opt(rargs, values)
+            elif arg[:1] == "-" and len(arg) > 1:
+                # process a cluster of short options (possibly with
+                # value(s) for the last one only)
+                self._process_short_opts(rargs, values)
+            elif self.allow_interspersed_args:
+                largs.append(arg)
+                del rargs[0]
+            else:
+                return                  # stop now, leave this arg in rargs
+
+        # Say this is the original argument list:
+        # [arg0, arg1, ..., arg(i-1), arg(i), arg(i+1), ..., arg(N-1)]
+        #                            ^
+        # (we are about to process arg(i)).
+        #
+        # Then rargs is [arg(i), ..., arg(N-1)] and largs is a *subset* of
+        # [arg0, ..., arg(i-1)] (any options and their arguments will have
+        # been removed from largs).
+        #
+        # The while loop will usually consume 1 or more arguments per pass.
+        # If it consumes 1 (eg. arg is an option that takes no arguments),
+        # then after _process_arg() is done the situation is:
+        #
+        #   largs = subset of [arg0, ..., arg(i)]
+        #   rargs = [arg(i+1), ..., arg(N-1)]
+        #
+        # If allow_interspersed_args is false, largs will always be
+        # *empty* -- still a subset of [arg0, ..., arg(i-1)], but
+        # not a very interesting subset!
+
+    def _match_long_opt(self, opt):
+        """_match_long_opt(opt : string) -> string
+
+        Determine which long option string 'opt' matches, ie. which one
+        it is an unambiguous abbrevation for.  Raises BadOptionError if
+        'opt' doesn't unambiguously match any long option string.
+        """
+        return _match_abbrev(opt, self._long_opt)
+
+    def _process_long_opt(self, rargs, values):
+        arg = rargs.pop(0)
+
+        # Value explicitly attached to arg?  Pretend it's the next
+        # argument.
+        if "=" in arg:
+            (opt, next_arg) = string.split(arg, "=", 1)
+            rargs.insert(0, next_arg)
+            had_explicit_value = True
+        else:
+            opt = arg
+            had_explicit_value = False
+
+        opt = self._match_long_opt(opt)
+        option = self._long_opt[opt]
+        if option.takes_value():
+            nargs = option.nargs
+            if len(rargs) < nargs:
+                if nargs == 1:
+                    self.error(_("%s option requires an argument") % opt)
+                else:
+                    self.error(_("%s option requires %d arguments")
+                               % (opt, nargs))
+            elif nargs == 1:
+                value = rargs.pop(0)
+            else:
+                value = tuple(rargs[0:nargs])
+                del rargs[0:nargs]
+
+        elif had_explicit_value:
+            self.error(_("%s option does not take a value") % opt)
+
+        else:
+            value = None
+
+        option.process(opt, value, values, self)
+
+    def _process_short_opts(self, rargs, values):
+        arg = rargs.pop(0)
+        stop = False
+        i = 1
+        for ch in arg[1:]:
+            opt = "-" + ch
+            option = self._short_opt.get(opt)
+            i = i+1                      # we have consumed a character
+
+            if not option:
+                raise errors.BadOptionError(opt)
+                #self.error(_("no such option: %s") % opt)
+            if option.takes_value():
+                # Any characters left in arg?  Pretend they're the
+                # next arg, and stop consuming characters of arg.
+                if i < len(arg):
+                    rargs.insert(0, arg[i:])
+                    stop = True
+
+                nargs = option.nargs
+                if len(rargs) < nargs:
+                    if nargs == 1:
+                        self.error(_("%s option requires an argument") % opt)
+                    else:
+                        self.error(_("%s option requires %d arguments")
+                                   % (opt, nargs))
+                elif nargs == 1:
+                    value = rargs.pop(0)
+                else:
+                    value = tuple(rargs[0:nargs])
+                    del rargs[0:nargs]
+
+            else:                       # option doesn't take a value
+                value = None
+
+            option.process(opt, value, values, self)
+
+            if stop:
+                break
+
+
+    # -- Feedback methods ----------------------------------------------
+
+    def get_prog_name(self):
+        if self.prog is None:
+            return os.path.basename(sys.argv[0])
+        else:
+            return self.prog
+
+    def expand_prog_name(self, s):
+        return string.replace(s, "%prog", self.get_prog_name())
+
+    def get_description(self):
+        return self.expand_prog_name(self.description)
+
+    def exit(self, status=0, msg=None):
+        if msg:
+            sys.stderr.write(msg)
+        sys.exit(status)
+
+    def error(self, msg):
+        """error(msg : string)
+
+        Print a usage message incorporating 'msg' to stderr and exit.
+        If you override this in a subclass, it should not return -- it
+        should either exit or raise an exception.
+        """
+        self.print_usage(sys.stderr)
+        self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg))
+
+    def get_usage(self):
+        if self.usage:
+            return self.formatter.format_usage(
+                self.expand_prog_name(self.usage))
+        else:
+            return ""
+
+    def print_usage(self, file=None):
+        """print_usage(file : file = stdout)
+
+        Print the usage message for the current program (self.usage) to
+        'file' (default stdout).  Any occurence of the string "%prog" in
+        self.usage is replaced with the name of the current program
+        (basename of sys.argv[0]).  Does nothing if self.usage is empty
+        or not defined.
+        """
+        if self.usage:
+            if file is None:
+                file = sys.stdout
+            file.write(self.get_usage() + "\n")
+
+    def get_version(self):
+        if self.version:
+            return self.expand_prog_name(self.version)
+        else:
+            return ""
+
+    def print_version(self, file=None):
+        """print_version(file : file = stdout)
+
+        Print the version message for this program (self.version) to
+        'file' (default stdout).  As with print_usage(), any occurence
+        of "%prog" in self.version is replaced by the current program's
+        name.  Does nothing if self.version is empty or undefined.
+        """
+        if self.version:
+            if file is None:
+                file = sys.stdout
+            file.write(self.get_version() + "\n")
+
+    def format_option_help(self, formatter=None):
+        if formatter is None:
+            formatter = self.formatter
+        formatter.store_option_strings(self)
+        result = []
+        result.append(formatter.format_heading(_("options")))
+        formatter.indent()
+        if self.option_list:
+            result.append(OptionContainer.format_option_help(self, formatter))
+            result.append("\n")
+        for group in self.option_groups:
+            result.append(group.format_help(formatter))
+            result.append("\n")
+        formatter.dedent()
+        # Drop the last "\n", or the header if no options or option groups:
+        return string.join(result[:-1], "")
+
+    def format_help(self, formatter=None):
+        if formatter is None:
+            formatter = self.formatter
+        result = []
+        if self.usage:
+            result.append(self.get_usage() + "\n")
+        if self.description:
+            result.append(self.format_description(formatter) + "\n")
+        result.append(self.format_option_help(formatter))
+        return string.join(result, "")
+
+    def print_help(self, file=None):
+        """print_help(file : file = stdout)
+
+        Print an extended help message, listing all options and any
+        help text provided with them, to 'file' (default stdout).
+        """
+        if file is None:
+            file = sys.stdout
+        file.write(self.format_help())
+
+# class OptionParser
+
+
+def _match_abbrev(s, wordmap):
+    """_match_abbrev(s : string, wordmap : {string : Option}) -> string
+
+    Return the string key in 'wordmap' for which 's' is an unambiguous
+    abbreviation.  If 's' is found to be ambiguous or doesn't match any of
+    'words', raise BadOptionError.
+    """
+    # Is there an exact match?
+    if wordmap.has_key(s):
+        return s
+    else:
+        # Isolate all words with s as a prefix.
+        possibilities = []
+        for word in wordmap.keys():
+            if string.startswith(word, s):
+                possibilities.append(word)
+        # No exact match, so there had better be just one possibility.
+        if len(possibilities) == 1:
+            return possibilities[0]
+        elif not possibilities:
+            raise errors.BadOptionError(s)
+        else:
+            # More than one possible completion: ambiguous prefix.
+            raise errors.AmbiguousOptionError(s, possibilities)
Binary file srcanamdw/codescanner/pyinstaller/optik/option_parser.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/optik/textwrap.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,374 @@
+"""Text wrapping and filling.
+"""
+
+# Copyright (C) 1999-2001 Gregory P. Ward.
+# Copyright (C) 2002, 2003 Python Software Foundation.
+# Written by Greg Ward <gward@python.net>
+
+__revision__ = "$Id: textwrap.py,v 1.1 2009/02/05 23:03:30 stechong Exp $"
+
+import string, re
+import types
+
+# Do the right thing with boolean values for all known Python versions
+# (so this module can be copied to projects that don't depend on Python
+# 2.3, e.g. Optik and Docutils).
+try:
+    True, False
+except NameError:
+    (True, False) = (1, 0)
+
+# For Python 1.5, just ignore unicode (try it as str)
+try:
+    unicode
+except NameError:
+    unicode=str
+
+__all__ = ['TextWrapper', 'wrap', 'fill']
+
+# Hardcode the recognized whitespace characters to the US-ASCII
+# whitespace characters.  The main reason for doing this is that in
+# ISO-8859-1, 0xa0 is non-breaking whitespace, so in certain locales
+# that character winds up in string.whitespace.  Respecting
+# string.whitespace in those cases would 1) make textwrap treat 0xa0 the
+# same as any other whitespace char, which is clearly wrong (it's a
+# *non-breaking* space), 2) possibly cause problems with Unicode,
+# since 0xa0 is not in range(128).
+_whitespace = '\t\n\x0b\x0c\r '
+
+class TextWrapper:
+    """
+    Object for wrapping/filling text.  The public interface consists of
+    the wrap() and fill() methods; the other methods are just there for
+    subclasses to override in order to tweak the default behaviour.
+    If you want to completely replace the main wrapping algorithm,
+    you'll probably have to override _wrap_chunks().
+
+    Several instance attributes control various aspects of wrapping:
+      width (default: 70)
+        the maximum width of wrapped lines (unless break_long_words
+        is false)
+      initial_indent (default: "")
+        string that will be prepended to the first line of wrapped
+        output.  Counts towards the line's width.
+      subsequent_indent (default: "")
+        string that will be prepended to all lines save the first
+        of wrapped output; also counts towards each line's width.
+      expand_tabs (default: true)
+        Expand tabs in input text to spaces before further processing.
+        Each tab will become 1 .. 8 spaces, depending on its position in
+        its line.  If false, each tab is treated as a single character.
+      replace_whitespace (default: true)
+        Replace all whitespace characters in the input text by spaces
+        after tab expansion.  Note that if expand_tabs is false and
+        replace_whitespace is true, every tab will be converted to a
+        single space!
+      fix_sentence_endings (default: false)
+        Ensure that sentence-ending punctuation is always followed
+        by two spaces.  Off by default because the algorithm is
+        (unavoidably) imperfect.
+      break_long_words (default: true)
+        Break words longer than 'width'.  If false, those words will not
+        be broken, and some lines might be longer than 'width'.
+    """
+
+    whitespace_trans = string.maketrans(_whitespace, ' ' * len(_whitespace))
+
+    unicode_whitespace_trans = {}
+    uspace = ord(unicode(' '))
+    for x in map(ord, _whitespace):
+        unicode_whitespace_trans[x] = uspace
+
+    # This funky little regex is just the trick for splitting
+    # text up into word-wrappable chunks.  E.g.
+    #   "Hello there -- you goof-ball, use the -b option!"
+    # splits into
+    #   Hello/ /there/ /--/ /you/ /goof-/ball,/ /use/ /the/ /-b/ /option!
+    # (after stripping out empty strings).
+    try:
+        wordsep_re = re.compile(r'(\s+|'                  # any whitespace
+                                r'[^\s\w]*\w{2,}-(?=\w{2,})|' # hyphenated words
+                                r'(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))')   # em-dash
+    except:
+        # Under python 1.5, the above regular expression does not compile because
+        # of positive look-behind assertions (?<=). This stripped down version
+        # does but it causes some regressions in the testsuite. Better than
+        # nothing...
+        wordsep_re = re.compile(r'(\s+|'                  # any whitespace
+                                r'[^\s\w]*\w{2,}-(?=\w{2,})|' # hyphenated words
+                                r')')   # em-dash
+
+    # XXX this is not locale- or charset-aware -- string.lowercase
+    # is US-ASCII only (and therefore English-only)
+    sentence_end_re = re.compile(r'[%s]'              # lowercase letter
+                                 r'[\.\!\?]'          # sentence-ending punct.
+                                 r'[\"\']?'           # optional end-of-quote
+                                 % string.lowercase)
+
+
+    def __init__(self,
+                 width=70,
+                 initial_indent="",
+                 subsequent_indent="",
+                 expand_tabs=True,
+                 replace_whitespace=True,
+                 fix_sentence_endings=False,
+                 break_long_words=True):
+        self.width = width
+        self.initial_indent = initial_indent
+        self.subsequent_indent = subsequent_indent
+        self.expand_tabs = expand_tabs
+        self.replace_whitespace = replace_whitespace
+        self.fix_sentence_endings = fix_sentence_endings
+        self.break_long_words = break_long_words
+
+
+    # -- Private methods -----------------------------------------------
+    # (possibly useful for subclasses to override)
+
+    def _munge_whitespace(self, text):
+        """_munge_whitespace(text : string) -> string
+
+        Munge whitespace in text: expand tabs and convert all other
+        whitespace characters to spaces.  Eg. " foo\tbar\n\nbaz"
+        becomes " foo    bar  baz".
+        """
+        if self.expand_tabs:
+            text = string.expandtabs(text)
+        if self.replace_whitespace:
+            if isinstance(text, types.StringType):
+                text = string.translate(text, self.whitespace_trans)
+            elif isinstance(text, types.UnicodeType):
+                # This has to be Python 2.0+ (no unicode before), so
+                # use directly string methods (the string module does not
+                # support translate() with dictionary for unicode).
+                text = text.translate(self.unicode_whitespace_trans)
+        return text
+
+
+    def _split(self, text):
+        """_split(text : string) -> [string]
+
+        Split the text to wrap into indivisible chunks.  Chunks are
+        not quite the same as words; see wrap_chunks() for full
+        details.  As an example, the text
+          Look, goof-ball -- use the -b option!
+        breaks into the following chunks:
+          'Look,', ' ', 'goof-', 'ball', ' ', '--', ' ',
+          'use', ' ', 'the', ' ', '-b', ' ', 'option!'
+        """
+        chunks = self.wordsep_re.split(text)
+        chunks = filter(None, chunks)
+        return chunks
+
+    def _fix_sentence_endings(self, chunks):
+        """_fix_sentence_endings(chunks : [string])
+
+        Correct for sentence endings buried in 'chunks'.  Eg. when the
+        original text contains "... foo.\nBar ...", munge_whitespace()
+        and split() will convert that to [..., "foo.", " ", "Bar", ...]
+        which has one too few spaces; this method simply changes the one
+        space to two.
+        """
+        i = 0
+        pat = self.sentence_end_re
+        while i < len(chunks)-1:
+            if chunks[i+1] == " " and pat.search(chunks[i]):
+                chunks[i+1] = "  "
+                i = i+2
+            else:
+                i = i+1
+
+    def _handle_long_word(self, chunks, cur_line, cur_len, width):
+        """_handle_long_word(chunks : [string],
+                             cur_line : [string],
+                             cur_len : int, width : int)
+
+        Handle a chunk of text (most likely a word, not whitespace) that
+        is too long to fit in any line.
+        """
+        space_left = max(width - cur_len, 1)
+
+        # If we're allowed to break long words, then do so: put as much
+        # of the next chunk onto the current line as will fit.
+        if self.break_long_words:
+            cur_line.append(chunks[0][0:space_left])
+            chunks[0] = chunks[0][space_left:]
+
+        # Otherwise, we have to preserve the long word intact.  Only add
+        # it to the current line if there's nothing already there --
+        # that minimizes how much we violate the width constraint.
+        elif not cur_line:
+            cur_line.append(chunks.pop(0))
+
+        # If we're not allowed to break long words, and there's already
+        # text on the current line, do nothing.  Next time through the
+        # main loop of _wrap_chunks(), we'll wind up here again, but
+        # cur_len will be zero, so the next line will be entirely
+        # devoted to the long word that we can't handle right now.
+
+    def _wrap_chunks(self, chunks):
+        """_wrap_chunks(chunks : [string]) -> [string]
+
+        Wrap a sequence of text chunks and return a list of lines of
+        length 'self.width' or less.  (If 'break_long_words' is false,
+        some lines may be longer than this.)  Chunks correspond roughly
+        to words and the whitespace between them: each chunk is
+        indivisible (modulo 'break_long_words'), but a line break can
+        come between any two chunks.  Chunks should not have internal
+        whitespace; ie. a chunk is either all whitespace or a "word".
+        Whitespace chunks will be removed from the beginning and end of
+        lines, but apart from that whitespace is preserved.
+        """
+        lines = []
+        if self.width <= 0:
+            raise ValueError("invalid width %r (must be > 0)" % self.width)
+
+        while chunks:
+
+            # Start the list of chunks that will make up the current line.
+            # cur_len is just the length of all the chunks in cur_line.
+            cur_line = []
+            cur_len = 0
+
+            # Figure out which static string will prefix this line.
+            if lines:
+                indent = self.subsequent_indent
+            else:
+                indent = self.initial_indent
+
+            # Maximum width for this line.
+            width = self.width - len(indent)
+
+            # First chunk on line is whitespace -- drop it, unless this
+            # is the very beginning of the text (ie. no lines started yet).
+            if string.strip(chunks[0]) == '' and lines:
+                del chunks[0]
+
+            while chunks:
+                l = len(chunks[0])
+
+                # Can at least squeeze this chunk onto the current line.
+                if cur_len + l <= width:
+                    cur_line.append(chunks.pop(0))
+                    cur_len = cur_len + l
+
+                # Nope, this line is full.
+                else:
+                    break
+
+            # The current line is full, and the next chunk is too big to
+            # fit on *any* line (not just this one).
+            if chunks and len(chunks[0]) > width:
+                self._handle_long_word(chunks, cur_line, cur_len, width)
+
+            # If the last chunk on this line is all whitespace, drop it.
+            if cur_line and string.strip(cur_line[-1]) == '':
+                del cur_line[-1]
+
+            # Convert current line back to a string and store it in list
+            # of all lines (return value).
+            if cur_line:
+                lines.append(indent + string.join(cur_line, ''))
+
+        return lines
+
+
+    # -- Public interface ----------------------------------------------
+
+    def wrap(self, text):
+        """wrap(text : string) -> [string]
+
+        Reformat the single paragraph in 'text' so it fits in lines of
+        no more than 'self.width' columns, and return a list of wrapped
+        lines.  Tabs in 'text' are expanded with string.expandtabs(),
+        and all other whitespace characters (including newline) are
+        converted to space.
+        """
+        text = self._munge_whitespace(text)
+        indent = self.initial_indent
+        chunks = self._split(text)
+        if self.fix_sentence_endings:
+            self._fix_sentence_endings(chunks)
+        return self._wrap_chunks(chunks)
+
+    def fill(self, text):
+        """fill(text : string) -> string
+
+        Reformat the single paragraph in 'text' to fit in lines of no
+        more than 'self.width' columns, and return a new string
+        containing the entire wrapped paragraph.
+        """
+        return string.join(self.wrap(text), "\n")
+
+
+# -- Convenience interface ---------------------------------------------
+
+def wrap(text, width=70, **kwargs):
+    """Wrap a single paragraph of text, returning a list of wrapped lines.
+
+    Reformat the single paragraph in 'text' so it fits in lines of no
+    more than 'width' columns, and return a list of wrapped lines.  By
+    default, tabs in 'text' are expanded with string.expandtabs(), and
+    all other whitespace characters (including newline) are converted to
+    space.  See TextWrapper class for available keyword args to customize
+    wrapping behaviour.
+    """
+    kwargs["width"] = width
+    w = apply(TextWrapper, (), kwargs)
+    return w.wrap(text)
+
+def fill(text, width=70, **kwargs):
+    """Fill a single paragraph of text, returning a new string.
+
+    Reformat the single paragraph in 'text' to fit in lines of no more
+    than 'width' columns, and return a new string containing the entire
+    wrapped paragraph.  As with wrap(), tabs are expanded and other
+    whitespace characters converted to space.  See TextWrapper class for
+    available keyword args to customize wrapping behaviour.
+    """
+    kwargs["width"] = width
+    w = apply(TextWrapper, (), kwargs)
+    return w.fill(text)
+
+
+# -- Loosely related functionality -------------------------------------
+
+def dedent(text):
+    """dedent(text : string) -> string
+
+    Remove any whitespace than can be uniformly removed from the left
+    of every line in `text`.
+
+    This can be used e.g. to make triple-quoted strings line up with
+    the left edge of screen/whatever, while still presenting it in the
+    source code in indented form.
+
+    For example:
+
+        def test():
+            # end first line with \ to avoid the empty line!
+            s = '''\
+            hello
+              world
+            '''
+            print repr(s)          # prints '    hello\n      world\n    '
+            print repr(dedent(s))  # prints 'hello\n  world\n'
+    """
+    lines = string.split(string.expandtabs(text), '\n')
+    margin = None
+    for line in lines:
+        content = string.lstrip(line)
+        if not content:
+            continue
+        indent = len(line) - len(content)
+        if margin is None:
+            margin = indent
+        else:
+            margin = min(margin, indent)
+
+    if margin is not None and margin > 0:
+        for i in range(len(lines)):
+            lines[i] = lines[i][margin:]
+
+    return string.join(lines, "\n")
Binary file srcanamdw/codescanner/pyinstaller/optik/textwrap.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/optparse.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,9 @@
+"""
+optparse -- forward-compatibility wrapper for use with Python 2.2.x and
+earlier.  If you import from 'optparse' rather than 'optik', your code
+will work on base Python 2.3 (and later), or on earlier Pythons with
+Optik 1.4.1 or later installed.
+"""
+
+from optik import __version__, __all__
+from optik import *
Binary file srcanamdw/codescanner/pyinstaller/optparse.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/rthooks.dat	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,6 @@
+{
+    'pythoncom':  ['support/rthooks/versioneddll.py'],
+    'pywintypes': ['support/rthooks/versioneddll.py'],
+    'win32com':   ['support/rthooks/win32comgenpy.py'],
+    'OpenGL':     ['support/rthooks/opengl.py'],
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/Sconscript	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,48 @@
+# Sconscript file to build the bootloader
+# Copyright (C) 2005, Giovanni Bajo
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+Import("env")
+
+env.Append(CPPPATH = [ "zlib", "common" ])
+
+if env["PYINST_FLAVOUR"] == "debug":
+    # launch.c prints some debug messages to the console if this macro is defined
+    env.Append(CPPDEFINES = ["LAUNCH_DEBUG"])
+
+if Platform().name == "win32":
+    # We use a prebuilt binary version of zlib [http://www.winimage.com/zLibDll/].
+    # It was compiled with the WINAPI convention.
+    env.Append(CPPDEFINES = [ "ZLIB_WINAPI" ])
+
+    if env["PYINST_MODE"] == "cons":
+        resfile = env.RES("windows/run.rc")
+    else:
+        resfile = env.RES("windows/runw.rc")
+
+zlib = env.Library("zlib",
+                    ["zlib/inflate.c",
+                     "zlib/crc32.c",
+                     "zlib/adler32.c",
+                     "zlib/zutil.c",
+                     "zlib/inffast.c",
+                     "zlib/inftrees.c"])
+run = env.Program("run",
+                 ["common/launch.c", "windows/winmain.c", zlib, resfile])
+dll = env.SharedLibrary("inprocsrvr",
+                        ["common/launch.c", "windows/dllmain.c", zlib])
+
+Return("run", "dll")
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/common/launch.c	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,1126 @@
+/*
+ * Launch a python module from an archive.   
+ * Copyright (C) 2005, Giovanni Bajo
+ * Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * authors give you unlimited permission to link or embed the compiled
+ * version of this file into combinations with other programs, and to
+ * distribute those combinations without any restriction coming from the
+ * use of this file. (The General Public License restrictions do apply in
+ * other respects; for example, they cover modification of the file, and
+ * distribution when not linked into a combine executable.)
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+ */
+#include <stdio.h>
+#ifdef WIN32
+ #include <windows.h>
+ #include <direct.h>
+ #include <process.h>
+ #include <io.h>
+#else
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <dirent.h>
+#endif
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include "launch.h"
+#ifndef NOZLIB
+#include "zlib.h"
+#endif
+#ifdef WIN32
+/*
+ * Python Entry point declarations (see macros in launch.h).
+ */
+DECLVAR(Py_NoSiteFlag);
+DECLVAR(Py_OptimizeFlag);
+DECLVAR(Py_VerboseFlag);
+DECLPROC(Py_Initialize);
+DECLPROC(Py_Finalize);
+DECLPROC(Py_CompileString);
+DECLPROC(PyImport_ExecCodeModule);
+DECLPROC(PyRun_SimpleString);
+DECLPROC(PySys_SetArgv);
+DECLPROC(Py_SetProgramName);
+DECLPROC(PyImport_ImportModule);
+DECLPROC(PyImport_AddModule);
+DECLPROC(PyObject_SetAttrString);
+DECLPROC(PyList_New);
+DECLPROC(PyList_Append);
+DECLPROC(Py_BuildValue);
+DECLPROC(PyFile_FromString);
+DECLPROC(PyString_FromStringAndSize);
+DECLPROC(PyObject_CallFunction);
+DECLPROC(PyModule_GetDict);
+DECLPROC(PyDict_GetItemString);
+DECLPROC(PyErr_Clear);
+DECLPROC(PyErr_Occurred);
+DECLPROC(PyErr_Print);
+DECLPROC(PyObject_CallObject);
+DECLPROC(PyObject_CallMethod);
+DECLPROC(PySys_AddWarnOption);
+DECLPROC(PyEval_InitThreads);
+DECLPROC(PyEval_AcquireThread);
+DECLPROC(PyEval_ReleaseThread);
+DECLPROC(PyEval_AcquireLock);
+DECLPROC(PyEval_ReleaseLock);
+DECLPROC(PyThreadState_Swap);
+DECLPROC(PyThreadState_New);
+DECLPROC(PyThreadState_Clear);
+DECLPROC(PyThreadState_Delete);
+DECLPROC(PyInterpreterState_New);
+DECLPROC(Py_NewInterpreter);
+DECLPROC(Py_EndInterpreter);
+DECLPROC(PyInt_AsLong);
+DECLPROC(PySys_SetObject);
+#endif
+
+#ifdef WIN32
+#define PATHSEP ";"
+#define SEP "/"
+#else
+#define PATHSEP ":"
+#define SEP "/"
+#endif
+
+/* File Local Variables (all start with f_) */
+static char f_archivename[_MAX_PATH+1];
+static char f_homepath[_MAX_PATH+1];
+static char f_temppath[_MAX_PATH+1] = { '\0' };
+#ifdef WIN32
+static char f_temppathraw[MAX_PATH+1];
+static char f_homepathraw[_MAX_PATH+1];
+#endif
+static char *f_workpath = NULL;
+static FILE *f_fp;
+static int f_pkgstart;
+static TOC *f_tocbuff = NULL;
+static TOC *f_tocend = NULL;
+static COOKIE f_cookie;
+
+unsigned char *extract(TOC *ptoc);
+
+/*
+ * The functions in this file defined in reverse order so that forward 
+ * declarations are not necessary.
+ */
+
+int testTempPath(char *buff)
+{
+	char base[16];
+	int n;
+
+	n = strlen(buff);
+	if ( buff[n-1] == '/' || buff[n-1] == '\\' )
+		sprintf(base, "_MEI%d", getpid());
+	else
+		sprintf(base, "%s_MEI%d", SEP, getpid());
+	strcat(buff, base);
+#ifdef WIN32
+	if (mkdir(buff) == 0) {
+#else
+	if (mkdir(buff, 0700) == 0) {
+#endif
+		strcat(buff, SEP);
+		return 1;
+	}
+	return 0;
+}
+
+void getTempPath(char *buff)
+{
+#ifdef WIN32
+	GetTempPath(MAX_PATH, buff);
+	testTempPath(buff);
+#else
+	static const char *envname[] = {
+		"TMPDIR", "TEMP", "TMP", 0
+	};
+	static const char *dirname[] = {
+		"/tmp", "/var/tmp", "/usr/tmp", 0
+	};
+	int i;
+	char *p;
+	for ( i=0; envname[i]; i++ ) {
+		p = getenv(envname[i]);
+		if (p) {
+			strcpy(buff, p);
+			if (testTempPath(buff))
+				return;
+		}
+	}
+	for ( i=0; dirname[i]; i++ ) {
+		strcpy(buff, dirname[i]);
+		if (testTempPath(buff))
+			return;
+	}
+	buff[0] = '\0';
+#endif
+}
+/*
+ * Set up paths required by rest of this module
+ * Sets f_archivename, f_homepath
+ */
+int setPaths(char const * archivePath, char const * archiveName)
+{
+#ifdef WIN32
+	char *p;
+#endif
+	/* Get the archive Path */
+	strcpy(f_archivename, archivePath);
+	strcat(f_archivename, archiveName);
+
+	/* Set homepath to where the archive is */
+	strcpy(f_homepath, archivePath);
+#ifdef WIN32
+	strcpy(f_homepathraw, archivePath);
+	for ( p = f_homepath; *p; p++ )
+		if (*p == '\\')
+			*p = '/';
+#endif
+
+	return 0;
+}
+
+
+/* 
+ * Open the archive
+ * Sets f_archiveFile, f_pkgstart, f_tocbuff and f_cookie.
+ */
+int openArchive()
+{
+	int filelen;
+
+	/* Physically open the file */
+	f_fp = fopen(f_archivename, "rb");
+	if (f_fp == NULL) {
+		VS("Cannot open archive: ");
+		VS(f_archivename);
+		VS("\n");
+		return -1;
+	}
+
+	/* Seek to the Cookie at the end of the file. */
+	fseek(f_fp, 0, SEEK_END);
+	filelen = ftell(f_fp);
+	if (fseek(f_fp, -(int)sizeof(COOKIE), SEEK_END)) 
+	{
+		VS(f_archivename);
+		VS(" appears to be an invalid archive\n");
+		return -1;
+	}
+
+	/* Read the Cookie, and check its MAGIC bytes */
+	fread(&f_cookie, sizeof(COOKIE), 1, f_fp);
+	if (strncmp(f_cookie.magic, MAGIC, strlen(MAGIC))) 
+	{
+		VS(f_archivename);
+		VS(" has bad magic!\n");
+		return -1;
+	}
+
+	/* From the cookie, calculate the archive start */
+	f_pkgstart = filelen - ntohl(f_cookie.len);
+
+	/* Read in in the table of contents */
+	fseek(f_fp, f_pkgstart + ntohl(f_cookie.TOC), SEEK_SET);
+	f_tocbuff = (TOC *) malloc(ntohl(f_cookie.TOClen));
+	if (f_tocbuff == NULL) 
+	{
+		FATALERROR("Could not allocate buffer for TOC.");
+		return -1;
+	}
+	fread(f_tocbuff, ntohl(f_cookie.TOClen), 1, f_fp);
+	f_tocend = (TOC *) (((char *)f_tocbuff) + ntohl(f_cookie.TOClen));
+
+	/* Check input file is still ok (should be). */
+	if (ferror(f_fp))
+	{
+		FATALERROR("Error on file");
+		return -1;
+	}
+	return 0;
+}
+#ifdef WIN32
+int mapNames(HMODULE dll)
+{
+    /* Get all of the entry points that we are interested in */
+	GETVAR(dll, Py_NoSiteFlag);
+	GETVAR(dll, Py_OptimizeFlag);
+	GETVAR(dll, Py_VerboseFlag);
+	GETPROC(dll, Py_Initialize);
+	GETPROC(dll, Py_Finalize);
+	GETPROC(dll, Py_CompileString);
+	GETPROC(dll, PyImport_ExecCodeModule);
+	GETPROC(dll, PyRun_SimpleString);
+	GETPROC(dll, PySys_SetArgv);
+	GETPROC(dll, Py_SetProgramName);
+	GETPROC(dll, PyImport_ImportModule);
+	GETPROC(dll, PyImport_AddModule);
+	GETPROC(dll, PyObject_SetAttrString);
+	GETPROC(dll, PyList_New);
+	GETPROC(dll, PyList_Append);
+	GETPROC(dll, Py_BuildValue);
+	GETPROC(dll, PyFile_FromString);
+	GETPROC(dll, PyString_FromStringAndSize);
+	GETPROC(dll, PyObject_CallFunction);
+	GETPROC(dll, PyModule_GetDict);
+	GETPROC(dll, PyDict_GetItemString);
+	GETPROC(dll, PyErr_Clear);
+	GETPROC(dll, PyErr_Occurred);
+	GETPROC(dll, PyErr_Print);
+	GETPROC(dll, PyObject_CallObject);
+	GETPROC(dll, PyObject_CallMethod);
+	if (ntohl(f_cookie.pyvers) >= 21) {
+		GETPROC(dll, PySys_AddWarnOption);
+	}
+	GETPROC(dll, PyEval_InitThreads);
+	GETPROC(dll, PyEval_AcquireThread);
+	GETPROC(dll, PyEval_ReleaseThread);
+	GETPROC(dll, PyEval_AcquireLock);
+	GETPROC(dll, PyEval_ReleaseLock);
+	GETPROC(dll, PyThreadState_Swap);
+	GETPROC(dll, PyThreadState_New);
+	GETPROC(dll, PyThreadState_Clear);
+	GETPROC(dll, PyThreadState_Delete);
+	GETPROC(dll, PyInterpreterState_New);
+	GETPROC(dll, Py_NewInterpreter);
+	GETPROC(dll, Py_EndInterpreter);
+	GETPROC(dll, PyErr_Print);
+	GETPROC(dll, PyInt_AsLong);
+	GETPROC(dll, PySys_SetObject);
+	return 0;
+}
+#endif
+/*
+ * Load the Python DLL, and get all of the necessary entry points
+ * Windows only (dynamic load)
+ */
+int loadPython()
+{
+#ifdef WIN32
+	HINSTANCE dll;
+	char dllpath[_MAX_PATH + 1];
+
+	/* Determine the path */
+	sprintf(dllpath, "%spython%02d.dll", f_homepathraw, ntohl(f_cookie.pyvers));
+
+	/* Load the DLL */
+	dll = LoadLibraryEx(dllpath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);  
+	if (dll) {
+		VS(dllpath);
+		VS("\n");
+	}
+	else {
+		sprintf(dllpath, "%spython%02d.dll", f_temppathraw, ntohl(f_cookie.pyvers));
+		dll = LoadLibraryEx(dllpath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH );
+		if (dll) {
+			VS(dllpath); 
+			VS("\n");
+		}
+	}
+	if (dll == 0) {
+		FATALERROR("Error loading Python DLL: ");
+		FATALERROR(dllpath);
+		FATALERROR("\n");
+		return -1;
+	}
+
+	mapNames(dll);
+#endif
+
+	return 0;
+}
+#ifdef WIN32
+/*
+ * use this from a dll instead of loadPython()
+ * it will attach to an existing pythonXX.dll,
+ * or load one if needed.
+ */
+int attachPython(int *loadedNew)
+{
+	HMODULE dll;
+	char nm[_MAX_PATH + 1];
+
+	/* Get python's name */
+	sprintf(nm, "python%02d.dll", ntohl(f_cookie.pyvers));
+
+	/* See if it's loaded */
+	dll = GetModuleHandle(nm);  
+	if (dll == 0) {
+		*loadedNew = 1;
+		return loadPython();
+	}
+	mapNames(dll);
+	*loadedNew = 0;
+	return 0;
+}
+#endif
+
+/*
+ * Return pointer to next toc entry.
+ */
+TOC *incrementTocPtr(TOC* ptoc)
+{
+	TOC *result = (TOC*)((char *)ptoc + ntohl(ptoc->structlen));
+	if (result < f_tocbuff) {
+		FATALERROR("Cannot read Table of Contents.\n");
+		return f_tocend;
+	}
+	return result;
+}
+/*
+ * external API for iterating TOCs
+ */
+TOC *getFirstTocEntry(void)
+{
+	return f_tocbuff;
+}
+TOC *getNextTocEntry(TOC *entry)
+{
+	TOC *rslt = (TOC*)((char *)entry + ntohl(entry->structlen));
+	if (rslt >= f_tocend)
+		return NULL;
+	return rslt;
+}
+/*
+ * A toc entry of type 'o' holds runtime options
+ * toc->name is the arg
+ * this is so you can freeze in command line args to Python
+ */
+int setRuntimeOptions(void)
+{
+	int unbuffered = 0;
+	TOC *ptoc = f_tocbuff;
+	while (ptoc < f_tocend) {
+		if (ptoc->typcd == 'o') {
+			VS(ptoc->name);
+			VS("\n");
+			switch (ptoc->name[0]) {
+			case 'v':
+#if defined  WIN32 
+				*Py_VerboseFlag = 1;
+#else
+				Py_VerboseFlag = 1;
+#endif
+			break;
+			case 'u':
+				unbuffered = 1;
+			break;
+#ifdef HAVE_WARNINGS
+			case 'W':
+				if (ntohl(f_cookie.pyvers) >= 21) {
+					PySys_AddWarnOption(&ptoc->name[2]);
+				}
+			break;
+#endif
+			case 's':
+#if defined  WIN32 
+				*Py_NoSiteFlag = 0;
+#else
+				Py_NoSiteFlag = 0;
+#endif
+			break;
+			case 'O':
+#if defined  WIN32 
+				*Py_OptimizeFlag = 1;
+#else
+				Py_OptimizeFlag = 1;
+#endif
+			break;
+			}
+		}
+		ptoc = incrementTocPtr(ptoc);
+	}
+	if (unbuffered) {
+#ifdef WIN32
+		_setmode(fileno(stdin), O_BINARY);
+		_setmode(fileno(stdout), O_BINARY);
+#else
+		fflush(stdout);
+		fflush(stderr);
+#ifdef HAVE_SETVBUF
+		setvbuf(stdin, (char *)NULL, _IONBF, 0);
+		setvbuf(stdout, (char *)NULL, _IONBF, 0);
+		setvbuf(stderr, (char *)NULL, _IONBF, 0);
+#else
+		setbuf(stdin, (char *)NULL);
+		setbuf(stdout, (char *)NULL);
+		setbuf(stderr, (char *)NULL);
+#endif
+#endif
+	}
+	return 0;
+}
+/*
+ * Start python - return 0 on success
+ */
+int startPython(int argc, char *argv[])
+{
+    /* Set PYTHONPATH so dynamic libs will load */
+	static char pypath[2*_MAX_PATH + 14];
+	int pathlen = 1;
+	int i;
+	char cmd[_MAX_PATH+1+80];
+	char tmp[_MAX_PATH+1];
+	PyObject *py_argv;
+	PyObject *val;
+	PyObject *sys;
+
+	VS("Manipulating evironment\n");
+	if (f_workpath && (strcmp(f_workpath, f_homepath) != 0)) {
+		strcpy(pypath, "PYTHONPATH=");
+		strcat(pypath, f_workpath);
+		pypath[strlen(pypath)-1] = '\0';
+		strcat(pypath, PATHSEP);
+		strcat(pypath, f_homepath);
+		pathlen = 2;
+	}
+	else {
+		/* never extracted anything, or extracted to homepath - homepath will do */
+		strcpy(pypath, "PYTHONPATH=");
+		strcat(pypath, f_homepath);
+	}
+	/* don't chop off SEP if root directory */
+#ifdef WIN32
+	if (strlen(pypath) > 14)
+#else
+	if (strlen(pypath) > 12)
+#endif
+		pypath[strlen(pypath)-1] = '\0';
+
+	putenv(pypath);
+	VS(pypath); 
+	VS("\n");
+	/* Clear out PYTHONHOME to avoid clashing with any installation */
+#ifdef WIN32
+	putenv("PYTHONHOME=");
+#endif
+
+	/* Start python. */
+	/* VS("Loading python\n"); */
+#if defined  WIN32 
+	*Py_NoSiteFlag = 1;	/* maybe changed to 0 by setRuntimeOptions() */
+#else
+	Py_NoSiteFlag = 1;
+#endif
+	setRuntimeOptions();
+#ifdef WIN32
+	Py_SetProgramName(f_archivename); /*XXX*/
+#endif
+	Py_Initialize();
+
+	/* Set sys.path */
+	/* VS("Manipulating Python's sys.path\n"); */
+	strcpy(tmp, f_homepath);
+	tmp[strlen(tmp)-1] = '\0';
+	PyRun_SimpleString("import sys\n");
+	PyRun_SimpleString("while sys.path:\n del sys.path[0]\n");
+	sprintf(cmd, "sys.path.append('%s')", tmp);
+	PyRun_SimpleString (cmd);
+	if (pathlen == 2) {
+		strcpy(tmp, f_workpath);
+		tmp[strlen(tmp)-1] = '\0';
+		sprintf(cmd, "sys.path.insert(0, '%s')", tmp);
+		PyRun_SimpleString(cmd);
+	}
+
+	/* Set argv[0] to be the archiveName */
+	py_argv = PyList_New(0);
+	val = Py_BuildValue("s", f_archivename);
+	PyList_Append(py_argv, val);
+	for (i = 1; i < argc; ++i) {
+		val = Py_BuildValue ("s", argv[i]);
+		PyList_Append (py_argv, val);
+	}
+	sys = PyImport_ImportModule("sys");
+	/* VS("Setting sys.argv\n"); */
+	PyObject_SetAttrString(sys, "argv", py_argv);
+
+	/* Check for a python error */
+	if (PyErr_Occurred())
+	{
+		FATALERROR("Error detected starting Python VM.");
+		return -1;
+	}
+
+	return 0;
+}
+
+/*
+ * Import modules embedded in the archive - return 0 on success
+ */
+int importModules()
+{
+	PyObject *marshal;
+	PyObject *marshaldict;
+	PyObject *loadfunc;
+	PyObject *pyfile;
+	TOC *ptoc;
+	PyObject *co;
+	PyObject *mod;
+	PyObject *res;
+	char buf[32];
+
+	VS("importing modules from CArchive\n"); 
+
+	/* Get the Python function marshall.load
+		* Here we collect some reference to PyObject that we don't dereference
+		* Doesn't matter because the objects won't be going away anyway.
+		*/
+	marshal = PyImport_ImportModule("marshal");
+	marshaldict = PyModule_GetDict(marshal);
+	loadfunc = PyDict_GetItemString(marshaldict, "loads");
+
+	/* Iterate through toc looking for module entries (type 'm')
+		* this is normally just bootstrap stuff (archive and iu)
+		*/
+	ptoc = f_tocbuff;
+	while (ptoc < f_tocend) {
+		if (ptoc->typcd == 'm' || ptoc->typcd == 'M') 
+		{
+			unsigned char *modbuf = extract(ptoc);
+
+			/* .pyc/.pyo files have 8 bytes header. Skip it and get a Python
+			 * string directly pointing at the marshalled code.
+			 */
+			PyObject *mods = PyString_FromStringAndSize(modbuf + 8,
+				ntohl(ptoc->ulen) - 8);
+            
+			VS(ptoc->name);
+			VS("\n");
+			
+			co = PyObject_CallFunction(loadfunc, "O", mods);
+			mod = PyImport_ExecCodeModule(ptoc->name, co);
+
+			/* Check for errors in loading */
+			if (mod == NULL) {
+				FATALERROR("mod is NULL - ");
+				FATALERROR(ptoc->name);
+			}
+			if (PyErr_Occurred())
+			{
+				PyErr_Print();
+				PyErr_Clear();
+			}
+
+			Py_DECREF(mods);
+			free(modbuf);
+		}
+		ptoc = incrementTocPtr(ptoc); 
+	}
+
+	return 0;
+}
+
+
+/* Install a zlib from a toc entry
+ * Return non zero on failure
+ */
+int installZlib(TOC *ptoc)
+{
+	int rc;
+	int zlibpos = f_pkgstart + ntohl(ptoc->pos);
+	char *tmpl = "sys.path.append(r\"%s?%d\")\n";
+	char *cmd = (char *) malloc(strlen(tmpl) + strlen(f_archivename) + 32);
+	sprintf(cmd, tmpl, f_archivename, zlibpos);
+	//VS(cmd);
+	rc = PyRun_SimpleString(cmd);
+	if (rc != 0)
+	{
+		FATALERROR("Error in command.");
+		FATALERROR(cmd);
+		free(cmd);
+		return -1;
+	}
+
+	free(cmd);
+	return 0;
+}
+
+
+/*
+ * Install zlibs 
+ * Return non zero on failure
+ */
+int installZlibs()
+{
+	TOC * ptoc;
+	VS("Installing import hooks\n");
+
+	/* Iterate through toc looking for zlibs (type 'z') */
+	ptoc = f_tocbuff;
+	while (ptoc < f_tocend) {
+		if (ptoc->typcd == 'z') 
+		{
+			VS(ptoc->name);
+			VS("\n");
+			installZlib(ptoc);
+		}
+
+		ptoc = incrementTocPtr(ptoc); 
+	}
+	return 0;
+}
+
+#ifndef NOZLIB
+/* decompress data in buff, described by ptoc
+ * return in malloc'ed buffer (needs to be freed)
+ */
+unsigned char *decompress(unsigned char * buff, TOC *ptoc)
+{
+	const char *ver;
+	unsigned char *out;
+	z_stream zstream;
+	int rc;
+	char msg[400];
+
+	ver = (zlibVersion)();
+	out = (unsigned char *)malloc(ntohl(ptoc->ulen));
+	if (out == NULL) {
+		OTHERERROR("Error allocating decompression buffer\n");
+		return NULL;
+	}
+
+	zstream.zalloc = NULL;
+	zstream.zfree = NULL;
+	zstream.opaque = NULL;
+	zstream.next_in = buff;
+	zstream.avail_in = ntohl(ptoc->len);
+	zstream.next_out = out;
+	zstream.avail_out = ntohl(ptoc->ulen);
+	rc = inflateInit(&zstream);
+	if (rc >= 0) {
+		rc = (inflate)(&zstream, Z_FINISH);
+		if (rc >= 0) {
+			rc = (inflateEnd)(&zstream);
+		}
+		else {
+			sprintf(msg, "Error %d from inflate: %s\n", rc, zstream.msg);
+			OTHERERROR(msg);
+			return NULL;
+		}
+	}
+	else {
+		sprintf(msg, "Error %d from inflateInit: %s\n", rc, zstream.msg);
+		OTHERERROR(msg);
+		return NULL;
+	}	
+	return out;
+}
+#endif
+/* 
+ * extract an archive entry
+ * returns pointer to the data (must be freed)
+ */
+unsigned char *extract(TOC *ptoc)
+{
+	unsigned char *data;
+	unsigned char *tmp;
+	char msg[400];
+
+	sprintf( msg, " extracting %1.20s (%d, %c)\n", ptoc->name, ptoc->cflag, ptoc->typcd);
+	//VS(msg);
+	fseek(f_fp, f_pkgstart + ntohl(ptoc->pos), SEEK_SET);
+	data = (unsigned char *)malloc(ntohl(ptoc->len));
+	if (data == NULL) {
+		OTHERERROR("Could not allocate read buffer\n");
+		return NULL;
+	}
+	fread(data, ntohl(ptoc->len), 1, f_fp);
+	if (ptoc->cflag == '\1') {
+#ifndef NOZLIB
+		tmp = decompress(data, ptoc);
+		free(data);
+		data = tmp;
+		if (data == NULL) {
+			sprintf(msg, "Error decompressing %s\n", ptoc->name);
+			OTHERERROR(msg);
+			return NULL;
+		}
+#else
+		FATALERROR("No ZLIB support but archive uses compression\n");
+		return NULL;
+#endif
+	}
+	return data;
+}
+/*
+ * helper for extract2fs
+ * which may try multiple places
+ */
+FILE *openTarget(char *path, char*name)
+{
+	struct stat sbuf;
+	char fnm[_MAX_PATH+1];
+	strcpy(fnm, path);
+	strcat(fnm, name);
+	if (stat(fnm, &sbuf) == -1) {
+		VS(fnm);
+		VS("\n");
+		return fopen(fnm, "wb");
+	}
+	return NULL;
+}
+/*
+ * extract from the archive
+ * and copy to the filesystem 
+ * relative to the directory the archive's in
+ */
+int extract2fs(TOC *ptoc)
+{
+#ifdef WIN32
+	char *p;
+#endif
+	FILE *out;
+	unsigned char *data = extract(ptoc);
+
+	if (!f_workpath) {
+		getTempPath(f_temppath);
+#ifdef WIN32
+		strcpy(f_temppathraw, f_temppath);
+		for ( p=f_temppath; *p; p++ )
+			if (*p == '\\')
+				*p = '/';
+#endif
+		f_workpath = f_temppath;
+	}
+	out = openTarget(f_workpath, ptoc->name);
+
+	if (out == NULL)  {
+		FATALERROR(ptoc->name);
+		FATALERROR(" could not be extracted!\n");
+	}
+	else {
+		fwrite(data, ntohl(ptoc->ulen), 1, out);
+#ifndef WIN32
+		fchmod(fileno(out), S_IRUSR | S_IWUSR | S_IXUSR);
+#endif
+		fclose(out);
+	}
+	free(data);
+	return 0;
+}
+/*
+ * extract all binaries (type 'b') to the filesystem
+ */
+int extractBinaries(char **workpath)
+{
+	TOC * ptoc = f_tocbuff;
+	workpath[0] = '\0';
+	VS("Extracting binaries\n");
+	while (ptoc < f_tocend) {
+		if (ptoc->typcd == 'b') 
+		if (extract2fs(ptoc))
+		return -1;
+		ptoc = incrementTocPtr(ptoc); 
+	}
+	*workpath = f_workpath;
+	return 0;
+}
+/* 
+ * Run scripts
+ * Return non zero on failure
+ */
+int runScripts()
+{
+	unsigned char *data;
+	int rc = 0;
+	TOC * ptoc = f_tocbuff;
+	char msg[400];
+	VS("Running scripts\n");
+
+	/* Iterate through toc looking for scripts (type 's') */
+	while (ptoc < f_tocend) {
+		if (ptoc->typcd == 's') {
+			/* Get data out of the archive.  */
+			data = extract(ptoc);
+			/* Run it */
+			rc = PyRun_SimpleString(data);
+			/* log errors and abort */
+			if (rc != 0) {
+				sprintf(msg, " RC: %d from %s\n", rc, ptoc->name);
+				VS(msg);
+				return rc;
+			}
+			free(data);
+		}
+
+		ptoc = incrementTocPtr(ptoc); 
+	}
+	return 0;
+}
+
+/* 
+ * call a simple "int func(void)" entry point.  Assumes such a function
+ * exists in the main namespace.
+ * Return non zero on failure, with -2 if the specific error is
+ * that the function does not exist in the namespace.
+ */
+int callSimpleEntryPoint(char *name, int *presult)
+{
+	int rc = -1;
+	/* Objects with no ref. */
+	PyObject *mod, *dict;
+	/* Objects with refs to kill. */
+	PyObject *func = NULL, *pyresult = NULL;
+
+	mod = PyImport_AddModule("__main__"); /* NO ref added */
+	if (!mod) {
+		VS("No __main__\n");
+		goto done;
+	}
+	dict = PyModule_GetDict(mod); /* NO ref added */
+	if (!mod) {
+		VS("No __dict__\n");
+		goto done;
+	}
+	func = PyDict_GetItemString(dict, name);
+	if (func == NULL) { /* should explicitly check KeyError */
+		VS("CallSimpleEntryPoint can't find the function name\n");
+		rc = -2;
+		goto done;
+	}
+	pyresult = PyObject_CallFunction(func, "");
+	if (pyresult==NULL) goto done;
+	PyErr_Clear();
+	*presult = PyInt_AsLong(pyresult);
+	rc = PyErr_Occurred() ? -1 : 0;
+	VS( rc ? "Finished with failure\n" : "Finished OK\n");
+	// all done!
+done:
+	Py_XDECREF(func);
+	Py_XDECREF(pyresult);
+	/* can't leave Python error set, else it may
+	   cause failures in later async code */
+	if (rc)
+		/* But we will print them 'cos they may be useful */
+		PyErr_Print();
+	PyErr_Clear();
+	return rc;
+}
+
+/*
+ * Launch an archive with the given fully-qualified path name
+ * No command line, no extracting of binaries
+ * Designed for embedding situations.
+ */
+int launchembedded(char const * archivePath, char  const * archiveName)
+{
+	char pathnm[_MAX_PATH];
+
+	VS("START\n");
+	strcpy(pathnm, archivePath);
+	strcat(pathnm, archiveName);
+	/* Set up paths */
+	if (setPaths(archivePath, archiveName))
+		return -1;
+	VS("Got Paths\n");
+	/* Open the archive */
+	if (openArchive())
+		return -1;
+	VS("Opened Archive\n");
+	/* Load Python DLL */
+	if (loadPython())
+		return -1;
+
+	/* Start Python with silly command line */
+	if (startPython(1, (char**)&pathnm))
+		return -1;
+	VS("Started Python\n");
+
+	/* a signal to scripts */
+	PyRun_SimpleString("import sys;sys.frozen='dll'\n");
+	VS("set sys.frozen\n");
+	/* Import modules from archive - this is to bootstrap */
+	if (importModules())
+		return -1;
+	VS("Imported Modules\n");
+	/* Install zlibs - now import hooks are in place */
+	if (installZlibs())
+		return -1;
+	VS("Installed Zlibs\n");
+	/* Run scripts */
+	if (runScripts())
+		return -1;
+	VS("All scripts run\n");
+	if (PyErr_Occurred()) {
+		// PyErr_Print();
+		//PyErr_Clear();
+		VS("Some error occurred\n");
+	}
+	VS("OK.\n");
+
+	return 0;
+}
+
+/* for finer grained control */
+/*
+ * initialize (this always needs to be done)
+ */
+int init(char const * archivePath, char  const * archiveName, char const * workpath)
+{
+	char *p;
+
+	if (workpath) {
+		f_workpath = (char *)workpath;
+#ifdef WIN32
+		strcpy(f_temppathraw, f_workpath);
+		for ( p = f_temppathraw; *p; p++ )
+			if (*p == '/')
+				*p = '\\';
+#endif
+	}
+
+	/* Set up paths */
+	if (setPaths(archivePath, archiveName))
+		return -1;
+
+	/* Open the archive */
+	if (openArchive())
+		return -1;
+
+	return 0;
+}
+/* once init'ed, you might want to extractBinaries()
+ * If you do, what comes after is very platform specific.
+ * Once you've taken care of the platform specific details,
+ * or if there are no binaries to extract, you go on
+ * to doIt(), which is the important part
+ */
+int doIt(int argc, char *argv[]) 
+{
+	int rc = 0;
+	/* Load Python DLL */
+	if (loadPython())
+		return -1;
+
+	/* Start Python. */
+	if (startPython(argc, argv))
+		return -1;
+
+	/* Import modules from archive - bootstrap */
+	if (importModules())
+		return -1;
+
+	/* Install zlibs  - now all hooks in place */
+	if (installZlibs())
+		return -1;
+
+	/* Run scripts */
+	rc = runScripts();
+
+	VS("OK.\n");
+
+	return rc;
+}
+void clear(const char *dir);
+#ifdef WIN32
+void removeOne(char *fnm, int pos, struct _finddata_t finfo)
+{
+	if ( strcmp(finfo.name, ".")==0  || strcmp(finfo.name, "..") == 0 )
+		return;
+	fnm[pos] = '\0';
+	strcat(fnm, finfo.name);
+	if ( finfo.attrib & _A_SUBDIR )
+		clear(fnm);
+	else 
+		remove(fnm);
+}
+void clear(const char *dir) 
+{
+	char fnm[_MAX_PATH+1];
+	struct _finddata_t finfo;
+	long h;
+	int dirnmlen;
+	strcpy(fnm, dir);
+	dirnmlen = strlen(fnm);
+	if ( fnm[dirnmlen-1] != '/' && fnm[dirnmlen-1] != '\\' ) {
+		strcat(fnm, "\\");
+		dirnmlen++;
+	}
+	strcat(fnm, "*");
+	h = _findfirst(fnm, &finfo);
+	if (h != -1) {
+		removeOne(fnm, dirnmlen, finfo);
+		while ( _findnext(h, &finfo) == 0 ) 
+			removeOne(fnm, dirnmlen, finfo);
+		_findclose(h);
+	}
+	rmdir(dir);
+}
+#else
+void removeOne(char *pnm, int pos, const char *fnm)
+{
+	struct stat sbuf;
+	if ( strcmp(fnm, ".")==0  || strcmp(fnm, "..") == 0 )
+		return;
+	pnm[pos] = '\0';
+	strcat(pnm, fnm);
+	if ( stat(pnm, &sbuf) == 0 ) {
+		if ( S_ISDIR(sbuf.st_mode) )
+			clear(pnm);
+		else 
+			unlink(pnm);
+	}
+}
+void clear(const char *dir) 
+{
+	char fnm[_MAX_PATH+1];
+	DIR *ds;
+	struct dirent *finfo;
+	int dirnmlen;
+
+	strcpy(fnm, dir);
+	dirnmlen = strlen(fnm);
+	if ( fnm[dirnmlen-1] != '/' ) {
+		strcat(fnm, "/");
+		dirnmlen++;
+	}
+	ds = opendir(dir);
+	finfo = readdir(ds);
+	while (finfo) {
+		removeOne(fnm, dirnmlen, finfo->d_name);
+		finfo = readdir(ds);
+	}
+	closedir(ds);
+	rmdir(dir);
+}
+#endif
+
+/*
+ * If binaries were extracted, this should be called
+ * to remove them
+ */
+void cleanUp()
+{
+	if (f_temppath[0])
+		clear(f_temppath);
+}
+/*
+ * Helpers for embedders
+ */
+int getPyVersion(void)
+{
+	return ntohl(f_cookie.pyvers);
+}
+void finalizePython(void)
+{
+	Py_Finalize();
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/common/launch.h	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,341 @@
+/*
+ * Launch a python module from an archive.   
+ * Copyright (C) 2005, Giovanni Bajo
+ * Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * authors give you unlimited permission to link or embed the compiled
+ * version of this file into combinations with other programs, and to
+ * distribute those combinations without any restriction coming from the
+ * use of this file. (The General Public License restrictions do apply in
+ * other respects; for example, they cover modification of the file, and
+ * distribution when not linked into a combine executable.)
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+ */
+#ifndef LAUNCH_H
+#define LAUNCH_H
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#ifdef WIN32
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+#include <fcntl.h> 
+#ifdef WIN32
+#include <winsock.h> /* for ntohl */
+#else
+#include <netinet/in.h>
+#endif
+
+/* On Windows, we use dynamic loading so one binary 
+   can be used with (nearly) any Python version.
+   This is the cruft necessary to do Windows dynamic loading
+*/
+
+#ifdef WIN32
+/*
+ * These macros used to define variables to hold dynamically accessed entry 
+ * points. These are declared 'extern' in this header, and defined fully later.
+ */
+#define EXTDECLPROC(result, name, args)\
+    typedef result (__cdecl *__PROC__##name) args;\
+    extern __PROC__##name name;
+
+#define EXTDECLVAR(vartyp, name)\
+    typedef vartyp __VAR__##name;\
+    extern __VAR__##name *name;
+
+/* 
+ * These types and macros are included from the Python header file object.h
+ * They are needed to do very basic Python functionality.
+ */
+typedef _typeobject;
+typedef struct _object {
+    int ob_refcnt; 
+    struct _typeobject *ob_type;
+} PyObject;
+typedef void (*destructor)(PyObject *);
+typedef struct _typeobject {
+    int ob_refcnt; 
+    struct _typeobject *ob_type;
+    int ob_size; 
+    char *tp_name; /* For printing */
+    int tp_basicsize, tp_itemsize; /* For allocation */
+    destructor tp_dealloc;
+    /* ignore the rest.... */
+} PyTypeObject;
+struct _ts; /* forward */
+typedef struct _is {
+    struct _is *next;
+    struct _ts *tstate_head;
+    PyObject *modules;
+    PyObject *sysdict;
+    PyObject *builtins;
+    int checkinterval;
+} PyInterpreterState;
+typedef struct _ts {
+    struct _ts *next;
+    PyInterpreterState *interp;
+    void *frame; /* struct _frame *frame; */
+    int recursion_depth;
+    int ticker;
+    int tracing;
+    PyObject *sys_profilefunc;
+    PyObject *sys_tracefunc;
+    PyObject *curexc_type;
+    PyObject *curexc_value;
+    PyObject *curexc_traceback;
+    PyObject *exc_type;
+    PyObject *exc_value;
+    PyObject *exc_traceback;
+    PyObject *dict;
+    /* XXX signal handlers should also be here */
+} PyThreadState;
+
+
+/* These are the non reference debugging version of Py_INCREF and DECREF */
+#define _Py_Dealloc(op) (*(op)->ob_type->tp_dealloc)((PyObject *)(op))
+#define Py_INCREF(op) ((op)->ob_refcnt++)
+#define Py_DECREF(op) \
+    if (--(op)->ob_refcnt != 0) \
+        ; \
+    else \
+        _Py_Dealloc((PyObject *)(op))
+#define Py_XINCREF(op) if ((op) == NULL) ; else Py_INCREF(op)
+#define Py_XDECREF(op) if ((op) == NULL) ; else Py_DECREF(op)
+
+/* The actual declarations of var & function entry points used. */
+EXTDECLVAR(int, Py_NoSiteFlag);
+EXTDECLVAR(int, Py_OptimizeFlag);
+EXTDECLVAR(int, Py_VerboseFlag);
+EXTDECLPROC(int, Py_Initialize, (void));
+EXTDECLPROC(int, Py_Finalize, (void));
+EXTDECLPROC(PyObject *, Py_CompileString, (char *, char *, int));
+EXTDECLPROC(PyObject *, PyImport_ExecCodeModule, (char *, PyObject *));
+EXTDECLPROC(int, PyRun_SimpleString, (char *));
+EXTDECLPROC(int, PySys_SetArgv, (int, char **));
+EXTDECLPROC(void, Py_SetProgramName, (char *));
+EXTDECLPROC(PyObject *, PyImport_ImportModule, (char *));
+EXTDECLPROC(PyObject *, PyImport_AddModule, (char *));
+EXTDECLPROC(int, PyObject_SetAttrString, (PyObject *, char *, PyObject *));
+EXTDECLPROC(PyObject *, PyList_New, (int));
+EXTDECLPROC(int, PyList_Append, (PyObject *, PyObject *));
+EXTDECLPROC(PyObject *, Py_BuildValue, (char *, ...));
+EXTDECLPROC(PyObject *, PyFile_FromString, (char *, char *));
+EXTDECLPROC(PyObject *, PyString_FromStringAndSize, (const char *, int));
+EXTDECLPROC(PyObject *, PyObject_CallFunction, (PyObject *, char *, ...));
+EXTDECLPROC(PyObject *, PyModule_GetDict, (PyObject *));
+EXTDECLPROC(PyObject *, PyDict_GetItemString, (PyObject *, char *));
+EXTDECLPROC(void, PyErr_Clear, () );
+EXTDECLPROC(PyObject *, PyErr_Occurred, () );
+EXTDECLPROC(void, PyErr_Print, () );
+EXTDECLPROC(PyObject *, PyObject_CallObject, (PyObject *, PyObject*) );
+EXTDECLPROC(PyObject *, PyObject_CallMethod, (PyObject *, char *, char *, ...) );
+EXTDECLPROC(void, PySys_AddWarnOption, (char *)); 
+EXTDECLPROC(void, PyEval_InitThreads, () );
+EXTDECLPROC(void, PyEval_AcquireThread, (PyThreadState *) );
+EXTDECLPROC(void, PyEval_ReleaseThread, (PyThreadState *) );
+EXTDECLPROC(void, PyEval_AcquireLock, (void) );
+EXTDECLPROC(void, PyEval_ReleaseLock, (void) );
+EXTDECLPROC(PyThreadState *, PyThreadState_Swap, (PyThreadState *) );
+EXTDECLPROC(PyThreadState *, PyThreadState_New, (PyInterpreterState *) );
+EXTDECLPROC(void, PyThreadState_Clear, (PyThreadState *) );
+EXTDECLPROC(void, PyThreadState_Delete, (PyThreadState *) );
+EXTDECLPROC(PyInterpreterState *, PyInterpreterState_New, () );
+EXTDECLPROC(PyThreadState *, Py_NewInterpreter, () );
+EXTDECLPROC(void, Py_EndInterpreter, (PyThreadState *) );
+EXTDECLPROC(void, PyErr_Print, () );
+EXTDECLPROC(long, PyInt_AsLong, (PyObject *) );
+EXTDECLPROC(int, PySys_SetObject, (char *, PyObject *));
+
+/* Macros to declare and get Python entry points in the C file.
+ * Typedefs '__PROC__...' have been done above
+ */
+#define DECLPROC(name)\
+    __PROC__##name name = NULL;
+#define GETPROC(dll, name)\
+    name = (__PROC__##name)GetProcAddress (dll, #name);\
+    if (!name) {\
+        FATALERROR ("Cannot GetProcAddress for " #name);\
+        return -1;\
+    }
+#define DECLVAR(name)\
+    __VAR__##name *name = NULL;
+#define GETVAR(dll, name)\
+    name = (__VAR__##name *)GetProcAddress (dll, #name);\
+    if (!name) {\
+        FATALERROR ("Cannot GetProcAddress for " #name);\
+        return -1;\
+    }
+#else
+#include <Python.h>
+#endif /* WIN32 dynamic load cruft */
+
+/*
+ * #defines
+ */
+#define MAGIC "MEI\014\013\012\013\016"    
+
+#if !defined WIN32 && !defined _CONSOLE
+#define _CONSOLE
+#endif
+
+#ifdef _CONSOLE
+# define FATALERROR(x) printf(x)
+# define OTHERERROR(x) printf(x)
+#else
+# define FATALERROR(x) MessageBox(NULL, x, "Fatal Error!", MB_OK | MB_ICONEXCLAMATION)
+# define OTHERERROR(x) MessageBox(NULL, x, "Error!", MB_OK | MB_ICONWARNING)
+#endif
+
+#ifdef LAUNCH_DEBUG
+# ifdef _CONSOLE
+#  define VS(arg) printf(arg)
+# else
+#  define VS(arg) MessageBox(NULL, arg, "Tracing", MB_OK)
+# endif
+#else
+# define VS(arg) 
+#endif
+
+/* TOC entry for a CArchive */
+typedef struct _toc {
+    int structlen;    /*len of this one - including full len of name */
+    int pos;          /* pos rel to start of concatenation */
+    int len;          /* len of the data (compressed) */
+    int ulen;         /* len of data (uncompressed) */
+    char cflag;       /* is it compressed (really a byte) */
+    char typcd;       /* 'b' binary, 'z' zlib, 'm' module, 's' script (v3), 
+					     'x' data, 'o' runtime option  */
+    char name[1];    /* the name to save it as */
+	/* starting in v5, we stretch this out to a mult of 16 */
+} TOC;
+
+/* The CArchive Cookie, from end of the archive. */
+typedef struct _cookie {
+    char magic[8]; /* 'MEI\014\013\012\013\016' */
+    int  len;      /* len of entire package */
+    int  TOC;      /* pos (rel to start) of TableOfContents */
+    int  TOClen;   /* length of TableOfContents */
+    int  pyvers;   /* new in v4 */
+} COOKIE;
+
+/* _MAX_PATH for non-Windows */
+#ifndef _MAX_PATH
+#define _MAX_PATH 256
+#endif
+
+/**
+ * Load Python using code stored in the following archive.
+ * Intended for use by embedding applications.
+ *
+ * @param archivePath  The path to the archive directory, with trailing 
+ *                     backslash. This directory will also contain the binary 
+ *                     dependencies of the application. There can be no
+ *                     binaries inside the archive.
+ *
+ * @param archiveName  The file name of the archive, without a path.
+ *
+ * @return 0 on success, non-zero otherwise.
+ *
+ */
+int launchembedded(char const * archivePath, char  const * archiveName);
+
+/*****************************************************************
+ * The following 4 entries are for applications which may need to 
+ * use to 2 steps to execute
+ *****************************************************************/
+
+/**
+ * Initialize the paths and open the archive 
+ *
+ * @param archivePath  The path (with trailing backslash) to the archive.
+ *
+ * @param archiveName  The file name of the archive, without a path.
+ *
+ * @param workpath     The path (with trailing backslash) to where
+ *                     the binaries were extracted. If they have not
+ *                     benn extracted yet, this is NULL. If they have,
+ *                     this will either be archivePath, or a temp dir
+ *                     where the user has write permissions.
+ *
+ * @return 0 on success, non-zero otherwise.
+ */
+int init(char const * archivePath, char  const * archiveName, char const * workpath);
+
+/**
+ * Extract binaries in the archive
+ *
+ * @param workpath     (OUT) Where the binaries were extracted to. If
+ *                      none extracted, is NULL.
+ *
+ * @return 0 on success, non-zero otherwise.
+ */
+int extractBinaries(char **workpath);
+
+/**
+ * Load Python and execute all scripts in the archive
+ * 
+ * @param argc			Count of "commandline" args
+ * 
+ * @param argv			The "commandline".
+ *
+ * @return -1 for internal failures, or the rc of the last script.
+ */
+int doIt(int argc, char *argv[]);
+
+/*
+ * Call a simple "int func(void)" entry point.  Assumes such a function
+ * exists in the main namespace.
+ * Return non zero on failure, with -2 if the specific error is
+ * that the function does not exist in the namespace.
+ *
+ * @param name		Name of the function to execute.
+ * @param presult	Integer return value.
+ */
+int callSimpleEntryPoint(char *name, int *presult);
+
+/**
+ * Clean up extracted binaries
+ */
+void cleanUp(void);
+
+/**
+ * Helpers for embedders
+ */
+int getPyVersion(void);
+void finalizePython(void);
+
+/**
+ * The gory detail level
+ */
+int setPaths(char const * archivePath, char const * archiveName);
+int openArchive(void);
+int attachPython(int *loadedNew);
+int loadPython(void); /* note - attachPython will call this if not already loaded */
+void acquirePythonThread(void);
+void releasePythonThread(void);
+int startPython(int argc, char *argv[]);
+int importModules(void);
+int installZlibs(void);
+int runScripts(void);
+TOC *getFirstTocEntry(void);
+TOC *getNextTocEntry(TOC *entry);
+void clear(const char *dir);
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/linux/Make.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,201 @@
+#! /usr/bin/env python
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+""" Make.py
+
+    -h help
+    -n use separate archive / executable (nonELF)
+    -e use concatenated executable / archive (ELF)
+    -p prefix
+    -P execprefix
+"""
+import sys
+import os
+import getopt
+import string
+import marshal
+import bkfile
+import makemakefile
+import pprint
+
+try:
+	from distutils import sysconfig
+except:
+	print "ERROR: distutils with sysconfig required"
+	sys.exit(1)
+
+
+
+def main():
+    dirnm = os.path.dirname(sys.argv[0])
+    if dirnm not in ('', '.'):
+        os.chdir(dirnm)
+    # overridable context
+    prefix = None                       # settable with -p option
+    exec_prefix = None                  # settable with -P option
+    non_elf = 1                         # settable with -e option
+    if ( sys.platform[:5] == 'linux' or
+         sys.platform[:3] == 'win' or
+         sys.platform[:7] in ['freebsd','darwin'] or
+         sys.platform[:6] == 'cygwin' ):
+        non_elf = 0                         # settable with -n option
+
+    try:
+        opts, args = getopt.getopt(sys.argv[1:], 'hneo:p:P:')
+    except getopt.error, msg:
+        usage('getopt error: ' + str(msg))
+
+    # proces option arguments
+    for o, a in opts:
+        if o == '-h':
+            print __doc__
+            return
+        if o == '-p':
+            prefix = a
+        if o == '-P':
+            exec_prefix = a
+        if o == '-n':
+            non_elf = 1
+        if o == '-e':
+            non_elf = 0
+    # default prefix and exec_prefix
+    if not exec_prefix:
+        if prefix:
+            exec_prefix = prefix
+        else:
+            exec_prefix = sysconfig.EXEC_PREFIX
+    if not prefix:
+        prefix = sysconfig.PREFIX
+
+    # determine whether -p points to the Python source tree
+    ishome = os.path.exists(os.path.join(prefix, 'Python', 'ceval.c'))
+
+    cygwin = sys.platform == 'cygwin'
+    darwin = sys.platform[:7] == 'darwin'
+
+    if ishome:
+        print "(Using Python source directory)"
+        binlib = exec_prefix
+        incldir = os.path.join(prefix, 'Include')
+        config_h_dir = exec_prefix
+        makefile_in = os.path.join(exec_prefix, 'Modules', 'Makefile')
+    else:
+#	binlib = os.path.join (sysconfig.get_python_lib(True, True, exec_prefix), 'config')
+	binlib = sysconfig.get_config_vars('LIBDIR')[0]
+	# TODO: Is it possible to have more than one path returned? if so fix "includes" list
+	incldir_list =  sysconfig.get_config_vars('INCLUDEDIR')
+	includes = []
+	for dir in incldir_list:
+		if dir != None:
+			includes.append('-I' + dir)
+	config_h_dir =  os.path.join (sysconfig.get_python_inc(True,exec_prefix))
+        includes.append('-I' + config_h_dir)
+        makefile_in = sysconfig.get_makefile_filename()
+
+    # salt config.dat with the exe type
+    try:
+        config = eval(open('../../config.dat', 'r').read())
+    except IOError:
+        config = {}
+    config['useELFEXE'] = not non_elf
+    configf = open('../../config.dat', 'w')
+    pprint.pprint(config, configf)
+    configf.close()
+
+    targets = [None, None]
+    targets[0] = os.path.join('../../support/loader/', 'run')
+    targets[1] = os.path.join('../../support/loader/', 'run_d')
+
+    # include local 'common' dir
+    includes.append('-I../common')
+
+    have_warnings = 0
+    import exceptions
+    if not hasattr(exceptions, '__file__'):
+        freeze_exceptions = 0
+        files = ['main.c', '../common/launch.c']
+        if hasattr(exceptions, 'Warning'):
+            have_warnings = 1
+    else:
+        freeze_exceptions = 1
+        import exceptions
+        print "reading exceptions from", exceptions.__file__
+        inf = open(exceptions.__file__, 'rb')
+        inf.seek(8)
+        code = inf.read()
+        codelen = len(code)
+        outfp = bkfile.open('M_exceptions.c', 'w')
+        files = ['M_exceptions.c', 'main.c', '../common/launch.c']
+        outfp.write('unsigned char M_exceptions[] = {')
+        for i in range(0, len(code), 16):
+            outfp.write('\n\t')
+            for c in code[i:i+16]:
+                outfp.write('%d,' % ord(c))
+        outfp.write('\n};\n')
+        outfp.close()
+
+    includes.append('$(OPT)')
+    cflags = includes
+    cflags.append(sysconfig.get_config_vars('CFLAGS')[0]) #save sysconfig CFLAGS
+
+    if have_warnings:
+        cflags.append('-DHAVE_WARNINGS')
+    if freeze_exceptions:
+        cflags.append('-DFREEZE_EXCEPTIONS')
+        cflags.append('-DEXCEPTIONS_LEN=%d' % codelen)
+    if non_elf:
+        cflags.append('-DNONELF')
+
+    libs = [os.path.join(sysconfig.get_config_vars('LIBPL')[0], sysconfig.get_config_vars('LIBRARY')[0])]
+    if not os.path.isfile(libs[0]):
+        print "WARNING: could not find Python static library at:", libs[0]
+
+    somevars = {}
+    if os.path.exists(makefile_in):
+        makevars = sysconfig.parse_makefile(makefile_in)
+    else:
+        raise ValueError, "Makefile '%s' not found" % makefile_in
+    for key in makevars.keys():
+        somevars[key] = makevars[key]
+
+    somevars['CFLAGS'] = string.join(cflags) # override
+    files = ['$(OPT)', '$(LDFLAGS)', '$(LINKFORSHARED)', 'getpath.c'] + \
+            files + libs + \
+            ['$(MODLIBS)', '$(LIBS)', '$(SYSLIBS)', '-lz']  # XXX zlib not always -lz
+
+    outfp = bkfile.open('Makefile', 'w')
+    try:
+        makemakefile.writevars(outfp, somevars, string.join(targets))
+        makemakefile.writerules(outfp, files[:], '', '', targets[0])
+        makemakefile.writerules(outfp, files[:], '_d', '-D_DEBUG -DLAUNCH_DEBUG', targets[1])
+    finally:
+        outfp.close()
+
+    # Done!
+
+    print 'Now run "make" to build the targets:', string.join(targets)
+
+
+def usage(msg):
+    sys.stdout = sys.stderr
+    print "Error:", msg
+    print "Use ``%s -h'' for help" % sys.argv[0]
+    sys.exit(2)
+
+
+main()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/linux/bkfile.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,71 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+_orig_open = open
+
+class _BkFile:
+	def __init__(self, file, mode, bufsize):
+		import os
+		self.__filename = file
+		self.__backup = file + '~'
+		try:
+			os.unlink(self.__backup)
+		except os.error:
+			pass
+		try:
+			os.rename(file, self.__backup)
+		except os.error:
+			self.__backup = None
+		self.__file = _orig_open(file, mode, bufsize)
+		self.closed = self.__file.closed
+		self.fileno = self.__file.fileno
+		self.flush = self.__file.flush
+		self.isatty = self.__file.isatty
+		self.mode = self.__file.mode
+		self.name = self.__file.name
+		self.read = self.__file.read
+		self.readinto = self.__file.readinto
+		self.readline = self.__file.readline
+		self.readlines = self.__file.readlines
+		self.seek = self.__file.seek
+		self.softspace = self.__file.softspace
+		self.tell = self.__file.tell
+		self.truncate = self.__file.truncate
+		self.write = self.__file.write
+		self.writelines = self.__file.writelines
+
+	def close(self):
+		self.__file.close()
+		if self.__backup is None:
+			return
+		try:
+			from cmp import do_cmp
+		except:
+			from filecmp import cmp
+			do_cmp = cmp
+		# don't use cmp.cmp because of NFS bugs :-( and
+		# anyway, the stat mtime values differ so do_cmp will
+		# most likely be called anyway
+		if do_cmp(self.__backup, self.__filename):
+			import os
+			os.unlink(self.__filename)
+			os.rename(self.__backup, self.__filename)
+
+def open(file, mode = 'r', bufsize = -1):
+	if 'w' not in mode:
+		return _orig_open(file, mode, bufsize)
+	return _BkFile(file, mode, bufsize)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/linux/getpath.c	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,269 @@
+/***********************************************************
+Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
+The Netherlands.
+
+                        All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the names of Stichting Mathematisch
+Centrum or CWI or Corporation for National Research Initiatives or
+CNRI not be used in advertising or publicity pertaining to
+distribution of the software without specific, written prior
+permission.
+
+While CWI is the initial source for this software, a modified version
+is made available by the Corporation for National Research Initiatives
+(CNRI) at the Internet address ftp://ftp.python.org.
+
+STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
+CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+
+******************************************************************/
+
+/* A special version for minimal installs, where
+   the bootstrap path is the directory in which
+   the executable lives.
+   Gordon McMillan, McMillan Enterprises, Inc. */
+
+/* Return the initial module search path. */
+
+#include "Python.h"
+#include "osdefs.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <string.h>
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+
+#ifdef WITH_NEXT_FRAMEWORK
+#include <mach-o/dyld.h>
+#endif
+
+static char prefix[MAXPATHLEN+1];
+static char *exec_prefix;
+static char progpath[MAXPATHLEN+1];
+static char *module_search_path = NULL;
+
+static void
+reduce(char *dir)
+{
+	int i = strlen(dir);
+	while (i > 0 && dir[i] != SEP)
+		--i;
+	dir[i] = '\0';
+}
+
+
+#ifndef S_ISREG
+#define S_ISREG(x) (((x) & S_IFMT) == S_IFREG)
+#endif
+
+#ifndef S_ISDIR
+#define S_ISDIR(x) (((x) & S_IFMT) == S_IFDIR)
+#endif
+#if 0
+static int
+isfile(char *filename)		/* Is file, not directory */
+{
+	struct stat buf;
+	if (stat(filename, &buf) != 0)
+		return 0;
+	if (!S_ISREG(buf.st_mode))
+		return 0;
+	return 1;
+}
+#endif
+#if 0
+static int
+ismodule(char *filename)		/* Is module -- check for .pyc/.pyo too */
+{
+	if (isfile(filename))
+		return 1;
+
+	/* Check for the compiled version of prefix. */
+	if (strlen(filename) < MAXPATHLEN) {
+		strcat(filename, Py_OptimizeFlag ? "o" : "c");
+		if (isfile(filename))
+			return 1;
+	}
+	return 0;
+}
+#endif
+
+static int
+isxfile(char *filename)		/* Is executable file */
+{
+	struct stat buf;
+	if (stat(filename, &buf) != 0)
+		return 0;
+	if (!S_ISREG(buf.st_mode))
+		return 0;
+	if ((buf.st_mode & 0111) == 0)
+		return 0;
+	return 1;
+}
+
+#if 0
+static int
+isdir(char *filename)			/* Is directory */
+{
+	struct stat buf;
+	if (stat(filename, &buf) != 0)
+		return 0;
+	if (!S_ISDIR(buf.st_mode))
+		return 0;
+	return 1;
+}
+#endif
+
+static void
+joinpath(char *buffer, char *stuff)
+{
+	int n, k;
+	if (stuff[0] == SEP)
+		n = 0;
+	else {
+		n = strlen(buffer);
+		if (n > 0 && buffer[n-1] != SEP && n < MAXPATHLEN)
+			buffer[n++] = SEP;
+	}
+	k = strlen(stuff);
+	if (n + k > MAXPATHLEN)
+		k = MAXPATHLEN - n;
+	strncpy(buffer+n, stuff, k);
+	buffer[n+k] = '\0';
+}
+
+static void
+calculate_path(void)
+{
+	char *prog = Py_GetProgramName();	/* use Py_SetProgramName(argv[0]) before Py_Initialize() */
+	char argv0_path[MAXPATHLEN+1];
+	char *epath;
+	char *path = NULL;
+	char *ppath = NULL;
+        int  numchars;
+
+	if (strchr(prog, SEP))
+		strcpy(progpath, prog);
+	else {
+#if HAVE_READLINK
+            sprintf(argv0_path, "/proc/%d/exe", getpid());
+            numchars = readlink(argv0_path, progpath, MAXPATHLEN);
+            if (numchars > 0) 
+                progpath[numchars] = '\0';
+            else {
+#endif
+		epath = getenv("PATH");
+                if (epath) 
+                    path = malloc(strlen(epath)+3);
+		if (path) {
+                    strcpy(path, ".:");
+                    strcat(path, epath);
+		    ppath = path;
+	    	    while (1) {
+				char *delim = strchr(ppath, DELIM);
+
+				if (delim) {
+					int len = delim - ppath;
+					strncpy(progpath, ppath, len);
+					*(progpath + len) = '\0';
+				}
+				else
+					strcpy(progpath, ppath);
+
+				joinpath(progpath, prog);
+				if (isxfile(progpath))
+					break;
+
+				if (!delim) {
+					progpath[0] = '\0';
+					break;
+				}
+				ppath = delim + 1;
+		    }
+                    free(path);
+		}
+		else
+			progpath[0] = '\0';
+#if HAVE_READLINK
+            }
+#endif
+	}
+	/* at this point progpath includes the executable */
+	strcpy(argv0_path, progpath);
+	
+#if HAVE_READLINK
+	{
+		char tmpbuffer[MAXPATHLEN+1];
+		int linklen = readlink(progpath, tmpbuffer, MAXPATHLEN);
+		while (linklen != -1) {
+			/* It's not null terminated! */
+			tmpbuffer[linklen] = '\0';
+			if (tmpbuffer[0] == SEP)
+				strcpy(argv0_path, tmpbuffer);
+			else {
+				/* Interpret relative to progpath */
+				reduce(argv0_path);
+				joinpath(argv0_path, tmpbuffer);
+			}
+			linklen = readlink(argv0_path, tmpbuffer, MAXPATHLEN);
+		}
+                strcpy(progpath, argv0_path);
+	}
+#endif /* HAVE_READLINK */
+
+	reduce(argv0_path);
+	/* now argv0_path is the directory of the executable */
+
+	strcpy(prefix, argv0_path);
+	exec_prefix = prefix;
+	module_search_path = malloc(strlen(prefix)+1);
+	strcpy(module_search_path, prefix);
+
+}
+/* External interface */
+
+char *
+Py_GetPath(void)
+{
+	if (!module_search_path)
+		calculate_path();
+	return module_search_path;
+}
+
+char *
+Py_GetPrefix(void)
+{
+	if (!module_search_path)
+		calculate_path();
+	return prefix;
+}
+
+char *
+Py_GetExecPrefix(void)
+{
+	if (!module_search_path)
+		calculate_path();
+	return exec_prefix;
+}
+
+char *
+Py_GetProgramFullPath(void)
+{
+	if (!module_search_path)
+		calculate_path();
+	return progpath;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/linux/main.c	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,137 @@
+/*
+ * Bootloader for a packed executable.
+ * Copyright (C) 2005, Giovanni Bajo
+ * Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * authors give you unlimited permission to link or embed the compiled
+ * version of this file into combinations with other programs, and to
+ * distribute those combinations without any restriction coming from the
+ * use of this file. (The General Public License restrictions do apply in
+ * other respects; for example, they cover modification of the file, and
+ * distribution when not linked into a combine executable.)
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+ */
+#include "launch.h"
+
+#ifdef FREEZE_EXCEPTIONS
+extern unsigned char M_exceptions[];
+static struct _frozen _PyImport_FrozenModules[] = {
+    {"exceptions", M_exceptions, EXCEPTIONS_LEN},
+    {0, 0, 0}
+};
+#endif
+int main(int argc, char* argv[])
+{
+    char thisfile[_MAX_PATH];
+    char homepath[_MAX_PATH];
+    char magic_envvar[_MAX_PATH + 12];
+    char ldlib_envvar[_MAX_PATH * 4 + 12];
+    char archivefile[_MAX_PATH + 5];
+    char *oldldlib;
+    TOC *ptoc = NULL;
+    int rc = 0;
+    char *workpath = NULL;
+    /* atexit(cleanUp); */
+#ifdef FREEZE_EXCEPTIONS
+    PyImport_FrozenModules = _PyImport_FrozenModules;
+#endif
+    // fill in thisfile
+#ifdef __CYGWIN__
+    if (strncasecmp(&argv[0][strlen(argv[0])-4], ".exe", 4)) {
+        strcpy(thisfile, argv[0]);
+        strcat(thisfile, ".exe");
+        Py_SetProgramName(thisfile);
+    }
+    else 
+#endif
+        Py_SetProgramName(argv[0]);
+    strcpy(thisfile, Py_GetProgramFullPath());
+    VS(thisfile);
+    VS(" is thisfile\n");
+    
+    workpath = getenv( "_MEIPASS2" );
+    VS(workpath);
+    VS(" is _MEIPASS2 (workpath)\n");
+
+    // fill in here (directory of thisfile)
+    strcpy(homepath, Py_GetPrefix());
+    strcat(homepath, "/");
+    VS(homepath);
+    VS(" is homepath\n");
+
+    if (init(homepath, &thisfile[strlen(homepath)], workpath)) {
+        /* no pkg there, so try the nonelf configuration */
+        strcpy(archivefile, thisfile);
+        strcat(archivefile, ".pkg");
+        if (init(homepath, &archivefile[strlen(homepath)], workpath)) {
+            FATALERROR("Cannot open self ");
+            FATALERROR(thisfile);
+            FATALERROR(" or archive ");
+            FATALERROR(archivefile);
+            FATALERROR("\n");
+            return -1;
+        }
+    }
+
+    if (workpath) {
+        // we're the "child" process
+        VS("Already have a workpath - running!\n");
+        rc = doIt(argc, argv);
+        if (strcmp(workpath, homepath)!=0)
+            clear(workpath);
+    }
+    else {
+        if (extractBinaries(&workpath)) {
+            VS("Error extracting binaries\n");
+            return -1;
+        }
+        if (workpath == NULL) {
+            /* now look for the "force LD_LIBRARY" flag */
+            ptoc = getFirstTocEntry();
+            while (ptoc) {
+                if ((ptoc->typcd == 'o') && (ptoc->name[0] == 'f'))
+                    workpath = homepath;
+                    ptoc = getNextTocEntry(ptoc);
+                }
+        }
+        if (workpath) {
+            VS("Executing self as child with ");
+            // run the "child" process, then clean up
+            strcpy(magic_envvar, "_MEIPASS2=");
+            strcat(magic_envvar, workpath);
+            putenv(magic_envvar);
+            // now LD_LIBRARY_PATH
+            strcpy(ldlib_envvar, "LD_LIBRARY_PATH=");
+            strcat(ldlib_envvar, workpath);
+            ldlib_envvar[strlen(ldlib_envvar)-1] = '\0';
+            oldldlib = getenv("LD_LIBRARY_PATH");
+            if (oldldlib) {
+                strcat(ldlib_envvar, ":");
+                strcat(ldlib_envvar, oldldlib);
+            }
+            putenv(ldlib_envvar);
+            VS(ldlib_envvar);
+            VS("\n");
+            rc = execvp(thisfile, argv);
+            VS("Back to parent...\n");
+        }
+        else
+            // no "child" process necessary
+            rc = doIt(argc, argv);
+    }
+    return rc;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/linux/makemakefile.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,48 @@
+# Write the actual Makefile.
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+import os
+import string
+
+def writevars(outfp, makevars, target):
+    outfp.write("# Makefile generated by freeze.py script\n\n")
+
+    keys = makevars.keys()
+    keys.sort()
+    for key in keys:
+        outfp.write("%s=%s\n" % (key, makevars[key]))
+    outfp.write("\nall: %s\n\n" % target)
+    outfp.write("\nclean:\n\t-rm -f *.o %s\n" % target)
+
+def writerules(outfp, files, suffix, dflag, target):
+    deps = []
+    for i in range(len(files)):
+        file = files[i]
+        if file[-2:] == '.c':
+            base = os.path.basename(file)
+            dest = base[:-2] + suffix + '.o'
+            outfp.write("%s: %s\n" % (dest, file))
+            outfp.write("\t$(CC) %s $(CFLAGS) -c %s -o %s\n" % (dflag, file, dest))
+            files[i] = dest
+            deps.append(dest)
+
+    outfp.write("\n%s: %s\n" % (target, string.join(deps)))
+    outfp.write("\t$(CC) %s -o %s $(LDLAST)\n" %
+                (string.join(files), target))
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/windows/dllmain.c	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,289 @@
+/*
+ * Bootloader for a DLL COM server.
+ * Copyright (C) 2005, Giovanni Bajo
+ * Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * authors give you unlimited permission to link or embed the compiled
+ * version of this file into combinations with other programs, and to
+ * distribute those combinations without any restriction coming from the
+ * use of this file. (The General Public License restrictions do apply in
+ * other respects; for example, they cover modification of the file, and
+ * distribution when not linked into a combine executable.)
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+ */
+#include "launch.h"
+#include <windows.h>
+#include <olectl.h>
+
+typedef int (__stdcall *__PROC__DllCanUnloadNow) (void);
+__PROC__DllCanUnloadNow Pyc_DllCanUnloadNow = NULL;
+typedef HRESULT (__stdcall *__PROC__DllGetClassObject) (REFCLSID, REFIID, LPVOID *);
+__PROC__DllGetClassObject Pyc_DllGetClassObject = NULL;
+typedef int (__cdecl *__PROC__DllRegisterServerEx) (const char *);
+__PROC__DllRegisterServerEx Pyc_DllRegisterServerEx = NULL;
+typedef int (__cdecl *__PROC__DllUnregisterServerEx) (const char *);
+__PROC__DllUnregisterServerEx Pyc_DllUnregisterServerEx = NULL;
+typedef void (__cdecl *__PROC__PyCom_CoUninitialize) (void);
+__PROC__PyCom_CoUninitialize PyCom_CoUninitialize = NULL;
+
+HINSTANCE gPythoncom = 0;
+char here[_MAX_PATH + 1];
+int LoadPythonCom(void);
+void releasePythonCom(void);
+HINSTANCE gInstance;
+PyThreadState *thisthread = NULL;
+
+int launch(char const * archivePath, char  const * archiveName)
+{
+	PyObject *obHandle;
+	int loadedNew = 0;
+	char pathnm[_MAX_PATH];
+
+    VS("START");
+	strcpy(pathnm, archivePath);
+	strcat(pathnm, archiveName);
+    /* Set up paths */
+    if (setPaths(archivePath, archiveName))
+        return -1;
+	VS("Got Paths");
+    /* Open the archive */
+    if (openArchive())
+        return -1;
+	VS("Opened Archive");
+    /* Load Python DLL */
+    if (attachPython(&loadedNew))
+        return -1;
+
+	if (loadedNew) {
+		/* Start Python with silly command line */
+		PyEval_InitThreads();
+		if (startPython(1, (char**)&pathnm))
+			return -1;
+		VS("Started new Python");
+		thisthread = PyThreadState_Swap(NULL);
+		PyThreadState_Swap(thisthread);
+	}
+	else {
+		VS("Attached to existing Python");
+
+		/* start a mew interp */
+		thisthread = PyThreadState_Swap(NULL);
+		PyThreadState_Swap(thisthread);
+		if (thisthread == NULL) {
+			thisthread = Py_NewInterpreter();
+			VS("created thisthread");
+		}
+		else
+			VS("grabbed thisthread");
+		PyRun_SimpleString("import sys;sys.argv=[]");
+	}
+
+	/* a signal to scripts */
+	PyRun_SimpleString("import sys;sys.frozen='dll'\n");
+	VS("set sys.frozen");
+	/* Create a 'frozendllhandle' as a counterpart to
+	   sys.dllhandle (which is the Pythonxx.dll handle)
+	*/
+	obHandle = Py_BuildValue("i", gInstance);
+	PySys_SetObject("frozendllhandle", obHandle);
+	Py_XDECREF(obHandle);
+    /* Import modules from archive - this is to bootstrap */
+    if (importModules())
+        return -1;
+	VS("Imported Modules");
+    /* Install zlibs - now import hooks are in place */
+    if (installZlibs())
+        return -1;
+	VS("Installed Zlibs");
+    /* Run scripts */
+    if (runScripts())
+        return -1;
+	VS("All scripts run");
+    if (PyErr_Occurred()) {
+		// PyErr_Print();
+		//PyErr_Clear();
+		VS("Some error occurred");
+    }
+	VS("PGL released");
+	// Abandon our thread state.
+	PyEval_ReleaseThread(thisthread);
+    VS("OK.");
+    return 0;
+}
+void startUp()
+{
+	char thisfile[_MAX_PATH + 1];
+	char *p;
+	int len;
+
+	if (!GetModuleFileNameA(gInstance, thisfile, _MAX_PATH)) {
+		FATALERROR("System error - unable to load!");
+		return;
+	}
+	// fill in here (directory of thisfile)
+	//GetModuleFileName returns an absolute path
+	strcpy(here, thisfile);
+	for (p=here+strlen(here); *p != '\\' && p >= here+2; --p);
+	*++p = '\0';
+	len = p - here;
+	//VS(here);
+	//VS(&thisfile[len]);
+	launch(here, &thisfile[len]);
+	LoadPythonCom();
+	// Now Python is up and running (any scripts have run)
+}
+
+BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
+{
+	char msg[40];
+
+	if ( dwReason == DLL_PROCESS_ATTACH) {
+		sprintf(msg, "Attach from thread %x", GetCurrentThreadId()); 
+		VS(msg);
+		gInstance = hInstance;
+	}
+	else if ( dwReason == DLL_PROCESS_DETACH ) {
+		VS("Process Detach");
+		//if (gPythoncom)
+		//	releasePythonCom();
+		//finalizePython();
+	}
+
+	return TRUE; 
+}
+
+int LoadPythonCom()
+{
+	char dllpath[_MAX_PATH+1];
+	VS("Loading Pythoncom");
+	// see if pythoncom is already loaded
+	sprintf(dllpath, "pythoncom%02d.dll", getPyVersion());
+	gPythoncom = GetModuleHandle(dllpath);
+	if (gPythoncom == NULL) {
+		sprintf(dllpath, "%spythoncom%02d.dll", here, getPyVersion());
+		//VS(dllpath);
+		gPythoncom = LoadLibraryEx( dllpath, // points to name of executable module 
+					   NULL, // HANDLE hFile, // reserved, must be NULL 
+					   LOAD_WITH_ALTERED_SEARCH_PATH // DWORD dwFlags // entry-point execution flag 
+					  ); 
+	}
+	if (!gPythoncom) {
+		VS("Pythoncom failed to load");
+		return -1;
+	}
+	// debugging
+	GetModuleFileNameA(gPythoncom, dllpath, _MAX_PATH);
+	VS(dllpath);
+
+	Pyc_DllCanUnloadNow = (__PROC__DllCanUnloadNow)GetProcAddress(gPythoncom, "DllCanUnloadNow");
+	Pyc_DllGetClassObject = (__PROC__DllGetClassObject)GetProcAddress(gPythoncom, "DllGetClassObject");
+	// DllRegisterServerEx etc are mainly used for "scripts", so that regsvr32.exe can be run on
+	// a .py file, for example.  They aren't really relevant here.
+	Pyc_DllRegisterServerEx = (__PROC__DllRegisterServerEx)GetProcAddress(gPythoncom, "DllRegisterServerEx");
+	Pyc_DllUnregisterServerEx = (__PROC__DllUnregisterServerEx)GetProcAddress(gPythoncom, "DllUnregisterServerEx");
+	PyCom_CoUninitialize = (__PROC__PyCom_CoUninitialize)GetProcAddress(gPythoncom, "PyCom_CoUninitialize");
+	if (Pyc_DllGetClassObject == NULL) {
+		VS("Couldn't get DllGetClassObject from pythoncom!");
+		return -1;
+	}
+	if (PyCom_CoUninitialize == NULL) {
+		VS("Couldn't get PyCom_CoUninitialize from pythoncom!");
+		return -1;
+	}
+	return 0;
+}
+void releasePythonCom(void)
+{
+	if (gPythoncom) {
+		PyCom_CoUninitialize();
+		FreeLibrary(gPythoncom);
+		gPythoncom = 0;
+	}
+}
+//__declspec(dllexport) int __stdcall DllCanUnloadNow(void)
+//__declspec(dllexport)
+//STDAPI
+HRESULT __stdcall DllCanUnloadNow(void)
+{
+	char msg[80];
+	HRESULT rc;
+
+	sprintf(msg, "DllCanUnloadNow from thread %x", GetCurrentThreadId()); 
+	VS(msg);
+	if (gPythoncom == 0)
+		startUp();
+	rc = Pyc_DllCanUnloadNow();
+	sprintf(msg, "DllCanUnloadNow returns %x", rc); 
+	VS(msg);
+	//if (rc == S_OK)
+	//	PyCom_CoUninitialize();
+	return rc;
+}
+
+//__declspec(dllexport) int __stdcall DllGetClassObject(void *rclsid, void *riid, void *ppv)
+HRESULT __stdcall DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
+{
+	char msg[80];
+	HRESULT rc;
+	sprintf(msg, "DllGetClassObject from thread %x", GetCurrentThreadId()); 
+	VS(msg);
+	if (gPythoncom == 0)
+		startUp();
+	rc = Pyc_DllGetClassObject(rclsid, riid, ppv);
+	sprintf(msg, "DllGetClassObject set %x and returned %x", *ppv, rc);
+	VS(msg);
+	return rc;
+}
+
+__declspec(dllexport) int DllRegisterServerEx(LPCSTR fileName)
+{
+	char msg[40];
+	sprintf(msg, "DllRegisterServerEx from thread %x", GetCurrentThreadId()); 
+	VS(msg);
+	if (gPythoncom == 0)
+		startUp();
+	return Pyc_DllRegisterServerEx(fileName);
+}
+
+__declspec(dllexport) int DllUnregisterServerEx(LPCSTR fileName)
+{
+	if (gPythoncom == 0)
+		startUp();
+	return Pyc_DllUnregisterServerEx(fileName);
+}
+
+STDAPI DllRegisterServer()
+{
+	int rc, pyrc;
+	if (gPythoncom == 0)
+		startUp();
+	PyEval_AcquireThread(thisthread);
+	rc = callSimpleEntryPoint("DllRegisterServer", &pyrc);
+	PyEval_ReleaseThread(thisthread);
+	return rc==0 ? pyrc : SELFREG_E_CLASS;
+}
+
+STDAPI DllUnregisterServer()
+{
+	int rc, pyrc;
+	if (gPythoncom == 0)
+		startUp();
+	PyEval_AcquireThread(thisthread);
+	rc = callSimpleEntryPoint("DllUnregisterServer", &pyrc);
+	PyEval_ReleaseThread(thisthread);
+	return rc==0 ? pyrc : SELFREG_E_CLASS;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/windows/dllmain.def	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,6 @@
+EXPORTS
+	DllCanUnloadNow     @1 PRIVATE
+	DllGetClassObject   @2 PRIVATE
+	DllRegisterServer PRIVATE
+	DllUnregisterServer PRIVATE
+
Binary file srcanamdw/codescanner/pyinstaller/source/windows/icon1.ico has changed
Binary file srcanamdw/codescanner/pyinstaller/source/windows/iconw.ico has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/windows/manifest.xml	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
+                 manifestVersion="1.0">
+<assemblyIdentity
+    version="1.0.0.0"
+    processorArchitecture="X86"
+    name="Microsoft.Windows.PyInstaller"
+    type="win32"
+/>
+<description>YourApplication</description>
+<dependency>
+    <dependentAssembly>
+        <assemblyIdentity
+            type="win32"
+            name="Microsoft.Windows.Common-Controls"
+            version="6.0.0.0"
+            processorArchitecture="X86"
+            publicKeyToken="6595b64144ccf1df"
+            language="*"
+        />
+    </dependentAssembly>
+</dependency>
+</assembly>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/windows/resource.h	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,45 @@
+/*
+ * Resource file for bootloader.
+ * Copyright (C) 2005, Giovanni Bajo
+ * Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * authors give you unlimited permission to link or embed the compiled
+ * version of this file into combinations with other programs, and to
+ * distribute those combinations without any restriction coming from the
+ * use of this file. (The General Public License restrictions do apply in
+ * other respects; for example, they cover modification of the file, and
+ * distribution when not linked into a combine executable.)
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+ */
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by launchw.rc
+//
+#define IDI_ICON1                       101
+#define IDR_MANIFEST                    1
+#define RT_MANIFEST                     24
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        102
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1000
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/windows/run.rc	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,72 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_ICON1               ICON    DISCARDABLE     "icon1.ico"
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+#endif    // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/windows/runw.rc	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,73 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_ICON1               ICON    DISCARDABLE     "iconw.ico"
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+#endif    // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+// Manifest file (for native XP look & feel)
+IDR_MANIFEST RT_MANIFEST MOVEABLE PURE "manifest.xml"
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/windows/winmain.c	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,155 @@
+/*
+ * Bootloader for a packed executable.
+ * Copyright (C) 2005, Giovanni Bajo
+ * Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * authors give you unlimited permission to link or embed the compiled
+ * version of this file into combinations with other programs, and to
+ * distribute those combinations without any restriction coming from the
+ * use of this file. (The General Public License restrictions do apply in
+ * other respects; for example, they cover modification of the file, and
+ * distribution when not linked into a combine executable.)
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+ */
+#include "launch.h"
+#include <windows.h>
+#include <commctrl.h> // InitCommonControls
+#include <signal.h>
+
+int relaunch(char *thisfile, char *workpath)
+{
+	char envvar[_MAX_PATH + 12];
+	SECURITY_ATTRIBUTES sa;
+	STARTUPINFO si;
+	PROCESS_INFORMATION pi;
+	int rc = 0;
+
+	// the parent process should ignore all signals it can
+	signal(SIGABRT, SIG_IGN);
+	signal(SIGINT, SIG_IGN);
+	signal(SIGTERM, SIG_IGN);
+	signal(SIGBREAK, SIG_IGN);
+
+	VS("Setting up to run child\n");
+	sa.nLength = sizeof(sa);
+	sa.lpSecurityDescriptor = NULL;
+	sa.bInheritHandle = TRUE;
+	GetStartupInfo(&si);
+	si.lpReserved = NULL;
+	si.lpDesktop = NULL;
+	si.lpTitle = NULL;
+	si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
+	si.wShowWindow = SW_NORMAL;
+	si.hStdInput = (void*)_get_osfhandle(fileno(stdin));
+	si.hStdOutput = (void*)_get_osfhandle(fileno(stdout));
+	si.hStdError = (void*)_get_osfhandle(fileno(stderr));
+	/* tell pass 2 where we extracted to */
+	VS("Setting magic environment var\n");
+	strcpy(envvar, "_MEIPASS2=");
+	strcat(envvar, workpath);
+	_putenv(envvar);
+	VS("Creating child process\n");
+	if (CreateProcess( 
+			thisfile, // pointer to name of executable module 
+			GetCommandLine(),  // pointer to command line string 
+			&sa,  // pointer to process security attributes 
+			NULL,  // pointer to thread security attributes 
+			TRUE,  // handle inheritance flag 
+			0,  // creation flags 
+			NULL,  // pointer to new environment block 
+			NULL,  // pointer to current directory name 
+			&si,  // pointer to STARTUPINFO 
+			&pi  // pointer to PROCESS_INFORMATION 
+			)) {
+		VS("Waiting for child process to finish...\n");
+		WaitForSingleObject(pi.hProcess, INFINITE);
+		GetExitCodeProcess(pi.hProcess, (unsigned long *)&rc);
+	}
+	else {
+		FATALERROR("Error creating child process!\n");
+		rc = -1;
+	}
+	return rc;
+}
+
+
+#ifdef _CONSOLE
+int main(int argc, char* argv[])
+#else
+int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
+						LPSTR lpCmdLine, int nCmdShow )
+#endif
+{
+	char here[_MAX_PATH + 1];
+	char thisfile[_MAX_PATH + 1];
+	int rc = 0;
+	char *workpath = NULL;
+	char *p;
+	int len;
+#ifndef _CONSOLE
+	int argc = __argc;
+	char **argv = __argv;
+#endif
+
+	// Initialize common controls (needed to link with commctrl32.dll and
+	// obtain native XP look & feel).
+	InitCommonControls();
+
+	// fill in thisfile
+	if (!GetModuleFileNameA(NULL, thisfile, _MAX_PATH)) {
+		FATALERROR("System error - unable to load!");
+		return -1;
+	}
+	p = thisfile+strlen(thisfile) - 4;
+	if (strnicmp(p, ".exe", 4) != 0)
+		strcat(thisfile, ".exe");
+
+	// fill in here (directory of thisfile)
+	//GetModuleFileName returns an absolute path
+	strcpy(here, thisfile);
+	for (p=here+strlen(here); *p != '\\' && p >= here+2; --p);
+	*++p = '\0';
+	len = p - here;
+
+	workpath = getenv( "_MEIPASS2" );
+	rc = init(here, &thisfile[len], workpath);
+	if (rc)
+		return rc;
+	if (workpath) {
+		// we're the "child" process
+		rc = doIt(argc, argv);
+		finalizePython();
+	}
+	else {
+		if (extractBinaries(&workpath)) {
+			VS("Error extracting binaries");
+			return -1;
+		}
+		// if workpath got set to non-NULL, we've extracted stuff
+		if (workpath) {
+			// run the "child" process, then clean up
+			rc = relaunch(thisfile, workpath);
+		}
+		else {
+			// no "child" process necessary
+			rc = doIt(argc, argv);
+			finalizePython();
+		}
+		cleanUp();
+	}
+	return rc;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/zlib/README	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,3 @@
+This directory contains an extract of zlib 1.2.3. It is the minimum set of
+files necessary to decompress data from a zip file with the inflate compression
+scheme.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/zlib/adler32.c	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,149 @@
+/* adler32.c -- compute the Adler-32 checksum of a data stream
+ * Copyright (C) 1995-2004 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id: adler32.c,v 1.1 2009/02/05 23:03:31 stechong Exp $ */
+
+#define ZLIB_INTERNAL
+#include "zlib.h"
+
+#define BASE 65521UL    /* largest prime smaller than 65536 */
+#define NMAX 5552
+/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
+
+#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
+#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
+#define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
+#define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);
+#define DO16(buf)   DO8(buf,0); DO8(buf,8);
+
+/* use NO_DIVIDE if your processor does not do division in hardware */
+#ifdef NO_DIVIDE
+#  define MOD(a) \
+    do { \
+        if (a >= (BASE << 16)) a -= (BASE << 16); \
+        if (a >= (BASE << 15)) a -= (BASE << 15); \
+        if (a >= (BASE << 14)) a -= (BASE << 14); \
+        if (a >= (BASE << 13)) a -= (BASE << 13); \
+        if (a >= (BASE << 12)) a -= (BASE << 12); \
+        if (a >= (BASE << 11)) a -= (BASE << 11); \
+        if (a >= (BASE << 10)) a -= (BASE << 10); \
+        if (a >= (BASE << 9)) a -= (BASE << 9); \
+        if (a >= (BASE << 8)) a -= (BASE << 8); \
+        if (a >= (BASE << 7)) a -= (BASE << 7); \
+        if (a >= (BASE << 6)) a -= (BASE << 6); \
+        if (a >= (BASE << 5)) a -= (BASE << 5); \
+        if (a >= (BASE << 4)) a -= (BASE << 4); \
+        if (a >= (BASE << 3)) a -= (BASE << 3); \
+        if (a >= (BASE << 2)) a -= (BASE << 2); \
+        if (a >= (BASE << 1)) a -= (BASE << 1); \
+        if (a >= BASE) a -= BASE; \
+    } while (0)
+#  define MOD4(a) \
+    do { \
+        if (a >= (BASE << 4)) a -= (BASE << 4); \
+        if (a >= (BASE << 3)) a -= (BASE << 3); \
+        if (a >= (BASE << 2)) a -= (BASE << 2); \
+        if (a >= (BASE << 1)) a -= (BASE << 1); \
+        if (a >= BASE) a -= BASE; \
+    } while (0)
+#else
+#  define MOD(a) a %= BASE
+#  define MOD4(a) a %= BASE
+#endif
+
+/* ========================================================================= */
+uLong ZEXPORT adler32(adler, buf, len)
+    uLong adler;
+    const Bytef *buf;
+    uInt len;
+{
+    unsigned long sum2;
+    unsigned n;
+
+    /* split Adler-32 into component sums */
+    sum2 = (adler >> 16) & 0xffff;
+    adler &= 0xffff;
+
+    /* in case user likes doing a byte at a time, keep it fast */
+    if (len == 1) {
+        adler += buf[0];
+        if (adler >= BASE)
+            adler -= BASE;
+        sum2 += adler;
+        if (sum2 >= BASE)
+            sum2 -= BASE;
+        return adler | (sum2 << 16);
+    }
+
+    /* initial Adler-32 value (deferred check for len == 1 speed) */
+    if (buf == Z_NULL)
+        return 1L;
+
+    /* in case short lengths are provided, keep it somewhat fast */
+    if (len < 16) {
+        while (len--) {
+            adler += *buf++;
+            sum2 += adler;
+        }
+        if (adler >= BASE)
+            adler -= BASE;
+        MOD4(sum2);             /* only added so many BASE's */
+        return adler | (sum2 << 16);
+    }
+
+    /* do length NMAX blocks -- requires just one modulo operation */
+    while (len >= NMAX) {
+        len -= NMAX;
+        n = NMAX / 16;          /* NMAX is divisible by 16 */
+        do {
+            DO16(buf);          /* 16 sums unrolled */
+            buf += 16;
+        } while (--n);
+        MOD(adler);
+        MOD(sum2);
+    }
+
+    /* do remaining bytes (less than NMAX, still just one modulo) */
+    if (len) {                  /* avoid modulos if none remaining */
+        while (len >= 16) {
+            len -= 16;
+            DO16(buf);
+            buf += 16;
+        }
+        while (len--) {
+            adler += *buf++;
+            sum2 += adler;
+        }
+        MOD(adler);
+        MOD(sum2);
+    }
+
+    /* return recombined sums */
+    return adler | (sum2 << 16);
+}
+
+/* ========================================================================= */
+uLong ZEXPORT adler32_combine(adler1, adler2, len2)
+    uLong adler1;
+    uLong adler2;
+    z_off_t len2;
+{
+    unsigned long sum1;
+    unsigned long sum2;
+    unsigned rem;
+
+    /* the derivation of this formula is left as an exercise for the reader */
+    rem = (unsigned)(len2 % BASE);
+    sum1 = adler1 & 0xffff;
+    sum2 = rem * sum1;
+    MOD(sum2);
+    sum1 += (adler2 & 0xffff) + BASE - 1;
+    sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
+    if (sum1 > BASE) sum1 -= BASE;
+    if (sum1 > BASE) sum1 -= BASE;
+    if (sum2 > (BASE << 1)) sum2 -= (BASE << 1);
+    if (sum2 > BASE) sum2 -= BASE;
+    return sum1 | (sum2 << 16);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/zlib/crc32.c	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,423 @@
+/* crc32.c -- compute the CRC-32 of a data stream
+ * Copyright (C) 1995-2005 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ *
+ * Thanks to Rodney Brown <rbrown64@csc.com.au> for his contribution of faster
+ * CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing
+ * tables for updating the shift register in one step with three exclusive-ors
+ * instead of four steps with four exclusive-ors.  This results in about a
+ * factor of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3.
+ */
+
+/* @(#) $Id: crc32.c,v 1.1 2009/02/05 23:03:31 stechong Exp $ */
+
+/*
+  Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore
+  protection on the static variables used to control the first-use generation
+  of the crc tables.  Therefore, if you #define DYNAMIC_CRC_TABLE, you should
+  first call get_crc_table() to initialize the tables before allowing more than
+  one thread to use crc32().
+ */
+
+#ifdef MAKECRCH
+#  include <stdio.h>
+#  ifndef DYNAMIC_CRC_TABLE
+#    define DYNAMIC_CRC_TABLE
+#  endif /* !DYNAMIC_CRC_TABLE */
+#endif /* MAKECRCH */
+
+#include "zutil.h"      /* for STDC and FAR definitions */
+
+#define local static
+
+/* Find a four-byte integer type for crc32_little() and crc32_big(). */
+#ifndef NOBYFOUR
+#  ifdef STDC           /* need ANSI C limits.h to determine sizes */
+#    include <limits.h>
+#    define BYFOUR
+#    if (UINT_MAX == 0xffffffffUL)
+       typedef unsigned int u4;
+#    else
+#      if (ULONG_MAX == 0xffffffffUL)
+         typedef unsigned long u4;
+#      else
+#        if (USHRT_MAX == 0xffffffffUL)
+           typedef unsigned short u4;
+#        else
+#          undef BYFOUR     /* can't find a four-byte integer type! */
+#        endif
+#      endif
+#    endif
+#  endif /* STDC */
+#endif /* !NOBYFOUR */
+
+/* Definitions for doing the crc four data bytes at a time. */
+#ifdef BYFOUR
+#  define REV(w) (((w)>>24)+(((w)>>8)&0xff00)+ \
+                (((w)&0xff00)<<8)+(((w)&0xff)<<24))
+   local unsigned long crc32_little OF((unsigned long,
+                        const unsigned char FAR *, unsigned));
+   local unsigned long crc32_big OF((unsigned long,
+                        const unsigned char FAR *, unsigned));
+#  define TBLS 8
+#else
+#  define TBLS 1
+#endif /* BYFOUR */
+
+/* Local functions for crc concatenation */
+local unsigned long gf2_matrix_times OF((unsigned long *mat,
+                                         unsigned long vec));
+local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat));
+
+#ifdef DYNAMIC_CRC_TABLE
+
+local volatile int crc_table_empty = 1;
+local unsigned long FAR crc_table[TBLS][256];
+local void make_crc_table OF((void));
+#ifdef MAKECRCH
+   local void write_table OF((FILE *, const unsigned long FAR *));
+#endif /* MAKECRCH */
+/*
+  Generate tables for a byte-wise 32-bit CRC calculation on the polynomial:
+  x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.
+
+  Polynomials over GF(2) are represented in binary, one bit per coefficient,
+  with the lowest powers in the most significant bit.  Then adding polynomials
+  is just exclusive-or, and multiplying a polynomial by x is a right shift by
+  one.  If we call the above polynomial p, and represent a byte as the
+  polynomial q, also with the lowest power in the most significant bit (so the
+  byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p,
+  where a mod b means the remainder after dividing a by b.
+
+  This calculation is done using the shift-register method of multiplying and
+  taking the remainder.  The register is initialized to zero, and for each
+  incoming bit, x^32 is added mod p to the register if the bit is a one (where
+  x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by
+  x (which is shifting right by one and adding x^32 mod p if the bit shifted
+  out is a one).  We start with the highest power (least significant bit) of
+  q and repeat for all eight bits of q.
+
+  The first table is simply the CRC of all possible eight bit values.  This is
+  all the information needed to generate CRCs on data a byte at a time for all
+  combinations of CRC register values and incoming bytes.  The remaining tables
+  allow for word-at-a-time CRC calculation for both big-endian and little-
+  endian machines, where a word is four bytes.
+*/
+local void make_crc_table()
+{
+    unsigned long c;
+    int n, k;
+    unsigned long poly;                 /* polynomial exclusive-or pattern */
+    /* terms of polynomial defining this crc (except x^32): */
+    static volatile int first = 1;      /* flag to limit concurrent making */
+    static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
+
+    /* See if another task is already doing this (not thread-safe, but better
+       than nothing -- significantly reduces duration of vulnerability in
+       case the advice about DYNAMIC_CRC_TABLE is ignored) */
+    if (first) {
+        first = 0;
+
+        /* make exclusive-or pattern from polynomial (0xedb88320UL) */
+        poly = 0UL;
+        for (n = 0; n < sizeof(p)/sizeof(unsigned char); n++)
+            poly |= 1UL << (31 - p[n]);
+
+        /* generate a crc for every 8-bit value */
+        for (n = 0; n < 256; n++) {
+            c = (unsigned long)n;
+            for (k = 0; k < 8; k++)
+                c = c & 1 ? poly ^ (c >> 1) : c >> 1;
+            crc_table[0][n] = c;
+        }
+
+#ifdef BYFOUR
+        /* generate crc for each value followed by one, two, and three zeros,
+           and then the byte reversal of those as well as the first table */
+        for (n = 0; n < 256; n++) {
+            c = crc_table[0][n];
+            crc_table[4][n] = REV(c);
+            for (k = 1; k < 4; k++) {
+                c = crc_table[0][c & 0xff] ^ (c >> 8);
+                crc_table[k][n] = c;
+                crc_table[k + 4][n] = REV(c);
+            }
+        }
+#endif /* BYFOUR */
+
+        crc_table_empty = 0;
+    }
+    else {      /* not first */
+        /* wait for the other guy to finish (not efficient, but rare) */
+        while (crc_table_empty)
+            ;
+    }
+
+#ifdef MAKECRCH
+    /* write out CRC tables to crc32.h */
+    {
+        FILE *out;
+
+        out = fopen("crc32.h", "w");
+        if (out == NULL) return;
+        fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n");
+        fprintf(out, " * Generated automatically by crc32.c\n */\n\n");
+        fprintf(out, "local const unsigned long FAR ");
+        fprintf(out, "crc_table[TBLS][256] =\n{\n  {\n");
+        write_table(out, crc_table[0]);
+#  ifdef BYFOUR
+        fprintf(out, "#ifdef BYFOUR\n");
+        for (k = 1; k < 8; k++) {
+            fprintf(out, "  },\n  {\n");
+            write_table(out, crc_table[k]);
+        }
+        fprintf(out, "#endif\n");
+#  endif /* BYFOUR */
+        fprintf(out, "  }\n};\n");
+        fclose(out);
+    }
+#endif /* MAKECRCH */
+}
+
+#ifdef MAKECRCH
+local void write_table(out, table)
+    FILE *out;
+    const unsigned long FAR *table;
+{
+    int n;
+
+    for (n = 0; n < 256; n++)
+        fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : "    ", table[n],
+                n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", "));
+}
+#endif /* MAKECRCH */
+
+#else /* !DYNAMIC_CRC_TABLE */
+/* ========================================================================
+ * Tables of CRC-32s of all single-byte values, made by make_crc_table().
+ */
+#include "crc32.h"
+#endif /* DYNAMIC_CRC_TABLE */
+
+/* =========================================================================
+ * This function can be used by asm versions of crc32()
+ */
+const unsigned long FAR * ZEXPORT get_crc_table()
+{
+#ifdef DYNAMIC_CRC_TABLE
+    if (crc_table_empty)
+        make_crc_table();
+#endif /* DYNAMIC_CRC_TABLE */
+    return (const unsigned long FAR *)crc_table;
+}
+
+/* ========================================================================= */
+#define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8)
+#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1
+
+/* ========================================================================= */
+unsigned long ZEXPORT crc32(crc, buf, len)
+    unsigned long crc;
+    const unsigned char FAR *buf;
+    unsigned len;
+{
+    if (buf == Z_NULL) return 0UL;
+
+#ifdef DYNAMIC_CRC_TABLE
+    if (crc_table_empty)
+        make_crc_table();
+#endif /* DYNAMIC_CRC_TABLE */
+
+#ifdef BYFOUR
+    if (sizeof(void *) == sizeof(ptrdiff_t)) {
+        u4 endian;
+
+        endian = 1;
+        if (*((unsigned char *)(&endian)))
+            return crc32_little(crc, buf, len);
+        else
+            return crc32_big(crc, buf, len);
+    }
+#endif /* BYFOUR */
+    crc = crc ^ 0xffffffffUL;
+    while (len >= 8) {
+        DO8;
+        len -= 8;
+    }
+    if (len) do {
+        DO1;
+    } while (--len);
+    return crc ^ 0xffffffffUL;
+}
+
+#ifdef BYFOUR
+
+/* ========================================================================= */
+#define DOLIT4 c ^= *buf4++; \
+        c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \
+            crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24]
+#define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4
+
+/* ========================================================================= */
+local unsigned long crc32_little(crc, buf, len)
+    unsigned long crc;
+    const unsigned char FAR *buf;
+    unsigned len;
+{
+    register u4 c;
+    register const u4 FAR *buf4;
+
+    c = (u4)crc;
+    c = ~c;
+    while (len && ((ptrdiff_t)buf & 3)) {
+        c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
+        len--;
+    }
+
+    buf4 = (const u4 FAR *)(const void FAR *)buf;
+    while (len >= 32) {
+        DOLIT32;
+        len -= 32;
+    }
+    while (len >= 4) {
+        DOLIT4;
+        len -= 4;
+    }
+    buf = (const unsigned char FAR *)buf4;
+
+    if (len) do {
+        c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
+    } while (--len);
+    c = ~c;
+    return (unsigned long)c;
+}
+
+/* ========================================================================= */
+#define DOBIG4 c ^= *++buf4; \
+        c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \
+            crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24]
+#define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4
+
+/* ========================================================================= */
+local unsigned long crc32_big(crc, buf, len)
+    unsigned long crc;
+    const unsigned char FAR *buf;
+    unsigned len;
+{
+    register u4 c;
+    register const u4 FAR *buf4;
+
+    c = REV((u4)crc);
+    c = ~c;
+    while (len && ((ptrdiff_t)buf & 3)) {
+        c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
+        len--;
+    }
+
+    buf4 = (const u4 FAR *)(const void FAR *)buf;
+    buf4--;
+    while (len >= 32) {
+        DOBIG32;
+        len -= 32;
+    }
+    while (len >= 4) {
+        DOBIG4;
+        len -= 4;
+    }
+    buf4++;
+    buf = (const unsigned char FAR *)buf4;
+
+    if (len) do {
+        c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
+    } while (--len);
+    c = ~c;
+    return (unsigned long)(REV(c));
+}
+
+#endif /* BYFOUR */
+
+#define GF2_DIM 32      /* dimension of GF(2) vectors (length of CRC) */
+
+/* ========================================================================= */
+local unsigned long gf2_matrix_times(mat, vec)
+    unsigned long *mat;
+    unsigned long vec;
+{
+    unsigned long sum;
+
+    sum = 0;
+    while (vec) {
+        if (vec & 1)
+            sum ^= *mat;
+        vec >>= 1;
+        mat++;
+    }
+    return sum;
+}
+
+/* ========================================================================= */
+local void gf2_matrix_square(square, mat)
+    unsigned long *square;
+    unsigned long *mat;
+{
+    int n;
+
+    for (n = 0; n < GF2_DIM; n++)
+        square[n] = gf2_matrix_times(mat, mat[n]);
+}
+
+/* ========================================================================= */
+uLong ZEXPORT crc32_combine(crc1, crc2, len2)
+    uLong crc1;
+    uLong crc2;
+    z_off_t len2;
+{
+    int n;
+    unsigned long row;
+    unsigned long even[GF2_DIM];    /* even-power-of-two zeros operator */
+    unsigned long odd[GF2_DIM];     /* odd-power-of-two zeros operator */
+
+    /* degenerate case */
+    if (len2 == 0)
+        return crc1;
+
+    /* put operator for one zero bit in odd */
+    odd[0] = 0xedb88320L;           /* CRC-32 polynomial */
+    row = 1;
+    for (n = 1; n < GF2_DIM; n++) {
+        odd[n] = row;
+        row <<= 1;
+    }
+
+    /* put operator for two zero bits in even */
+    gf2_matrix_square(even, odd);
+
+    /* put operator for four zero bits in odd */
+    gf2_matrix_square(odd, even);
+
+    /* apply len2 zeros to crc1 (first square will put the operator for one
+       zero byte, eight zero bits, in even) */
+    do {
+        /* apply zeros operator for this bit of len2 */
+        gf2_matrix_square(even, odd);
+        if (len2 & 1)
+            crc1 = gf2_matrix_times(even, crc1);
+        len2 >>= 1;
+
+        /* if no more bits set, then done */
+        if (len2 == 0)
+            break;
+
+        /* another iteration of the loop with odd and even swapped */
+        gf2_matrix_square(odd, even);
+        if (len2 & 1)
+            crc1 = gf2_matrix_times(odd, crc1);
+        len2 >>= 1;
+
+        /* if no more bits set, then done */
+    } while (len2 != 0);
+
+    /* return combined crc */
+    crc1 ^= crc2;
+    return crc1;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/zlib/crc32.h	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,441 @@
+/* crc32.h -- tables for rapid CRC calculation
+ * Generated automatically by crc32.c
+ */
+
+local const unsigned long FAR crc_table[TBLS][256] =
+{
+  {
+    0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL,
+    0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL,
+    0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL,
+    0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL,
+    0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL,
+    0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL,
+    0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL,
+    0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL,
+    0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL,
+    0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL,
+    0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL,
+    0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL,
+    0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL,
+    0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL,
+    0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL,
+    0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL,
+    0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL,
+    0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL,
+    0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL,
+    0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL,
+    0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL,
+    0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL,
+    0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL,
+    0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL,
+    0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL,
+    0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL,
+    0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL,
+    0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL,
+    0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL,
+    0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL,
+    0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL,
+    0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL,
+    0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL,
+    0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL,
+    0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL,
+    0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL,
+    0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL,
+    0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL,
+    0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL,
+    0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL,
+    0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL,
+    0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL,
+    0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL,
+    0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL,
+    0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL,
+    0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL,
+    0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL,
+    0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL,
+    0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL,
+    0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL,
+    0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL,
+    0x2d02ef8dUL
+#ifdef BYFOUR
+  },
+  {
+    0x00000000UL, 0x191b3141UL, 0x32366282UL, 0x2b2d53c3UL, 0x646cc504UL,
+    0x7d77f445UL, 0x565aa786UL, 0x4f4196c7UL, 0xc8d98a08UL, 0xd1c2bb49UL,
+    0xfaefe88aUL, 0xe3f4d9cbUL, 0xacb54f0cUL, 0xb5ae7e4dUL, 0x9e832d8eUL,
+    0x87981ccfUL, 0x4ac21251UL, 0x53d92310UL, 0x78f470d3UL, 0x61ef4192UL,
+    0x2eaed755UL, 0x37b5e614UL, 0x1c98b5d7UL, 0x05838496UL, 0x821b9859UL,
+    0x9b00a918UL, 0xb02dfadbUL, 0xa936cb9aUL, 0xe6775d5dUL, 0xff6c6c1cUL,
+    0xd4413fdfUL, 0xcd5a0e9eUL, 0x958424a2UL, 0x8c9f15e3UL, 0xa7b24620UL,
+    0xbea97761UL, 0xf1e8e1a6UL, 0xe8f3d0e7UL, 0xc3de8324UL, 0xdac5b265UL,
+    0x5d5daeaaUL, 0x44469febUL, 0x6f6bcc28UL, 0x7670fd69UL, 0x39316baeUL,
+    0x202a5aefUL, 0x0b07092cUL, 0x121c386dUL, 0xdf4636f3UL, 0xc65d07b2UL,
+    0xed705471UL, 0xf46b6530UL, 0xbb2af3f7UL, 0xa231c2b6UL, 0x891c9175UL,
+    0x9007a034UL, 0x179fbcfbUL, 0x0e848dbaUL, 0x25a9de79UL, 0x3cb2ef38UL,
+    0x73f379ffUL, 0x6ae848beUL, 0x41c51b7dUL, 0x58de2a3cUL, 0xf0794f05UL,
+    0xe9627e44UL, 0xc24f2d87UL, 0xdb541cc6UL, 0x94158a01UL, 0x8d0ebb40UL,
+    0xa623e883UL, 0xbf38d9c2UL, 0x38a0c50dUL, 0x21bbf44cUL, 0x0a96a78fUL,
+    0x138d96ceUL, 0x5ccc0009UL, 0x45d73148UL, 0x6efa628bUL, 0x77e153caUL,
+    0xbabb5d54UL, 0xa3a06c15UL, 0x888d3fd6UL, 0x91960e97UL, 0xded79850UL,
+    0xc7cca911UL, 0xece1fad2UL, 0xf5facb93UL, 0x7262d75cUL, 0x6b79e61dUL,
+    0x4054b5deUL, 0x594f849fUL, 0x160e1258UL, 0x0f152319UL, 0x243870daUL,
+    0x3d23419bUL, 0x65fd6ba7UL, 0x7ce65ae6UL, 0x57cb0925UL, 0x4ed03864UL,
+    0x0191aea3UL, 0x188a9fe2UL, 0x33a7cc21UL, 0x2abcfd60UL, 0xad24e1afUL,
+    0xb43fd0eeUL, 0x9f12832dUL, 0x8609b26cUL, 0xc94824abUL, 0xd05315eaUL,
+    0xfb7e4629UL, 0xe2657768UL, 0x2f3f79f6UL, 0x362448b7UL, 0x1d091b74UL,
+    0x04122a35UL, 0x4b53bcf2UL, 0x52488db3UL, 0x7965de70UL, 0x607eef31UL,
+    0xe7e6f3feUL, 0xfefdc2bfUL, 0xd5d0917cUL, 0xcccba03dUL, 0x838a36faUL,
+    0x9a9107bbUL, 0xb1bc5478UL, 0xa8a76539UL, 0x3b83984bUL, 0x2298a90aUL,
+    0x09b5fac9UL, 0x10aecb88UL, 0x5fef5d4fUL, 0x46f46c0eUL, 0x6dd93fcdUL,
+    0x74c20e8cUL, 0xf35a1243UL, 0xea412302UL, 0xc16c70c1UL, 0xd8774180UL,
+    0x9736d747UL, 0x8e2de606UL, 0xa500b5c5UL, 0xbc1b8484UL, 0x71418a1aUL,
+    0x685abb5bUL, 0x4377e898UL, 0x5a6cd9d9UL, 0x152d4f1eUL, 0x0c367e5fUL,
+    0x271b2d9cUL, 0x3e001cddUL, 0xb9980012UL, 0xa0833153UL, 0x8bae6290UL,
+    0x92b553d1UL, 0xddf4c516UL, 0xc4eff457UL, 0xefc2a794UL, 0xf6d996d5UL,
+    0xae07bce9UL, 0xb71c8da8UL, 0x9c31de6bUL, 0x852aef2aUL, 0xca6b79edUL,
+    0xd37048acUL, 0xf85d1b6fUL, 0xe1462a2eUL, 0x66de36e1UL, 0x7fc507a0UL,
+    0x54e85463UL, 0x4df36522UL, 0x02b2f3e5UL, 0x1ba9c2a4UL, 0x30849167UL,
+    0x299fa026UL, 0xe4c5aeb8UL, 0xfdde9ff9UL, 0xd6f3cc3aUL, 0xcfe8fd7bUL,
+    0x80a96bbcUL, 0x99b25afdUL, 0xb29f093eUL, 0xab84387fUL, 0x2c1c24b0UL,
+    0x350715f1UL, 0x1e2a4632UL, 0x07317773UL, 0x4870e1b4UL, 0x516bd0f5UL,
+    0x7a468336UL, 0x635db277UL, 0xcbfad74eUL, 0xd2e1e60fUL, 0xf9ccb5ccUL,
+    0xe0d7848dUL, 0xaf96124aUL, 0xb68d230bUL, 0x9da070c8UL, 0x84bb4189UL,
+    0x03235d46UL, 0x1a386c07UL, 0x31153fc4UL, 0x280e0e85UL, 0x674f9842UL,
+    0x7e54a903UL, 0x5579fac0UL, 0x4c62cb81UL, 0x8138c51fUL, 0x9823f45eUL,
+    0xb30ea79dUL, 0xaa1596dcUL, 0xe554001bUL, 0xfc4f315aUL, 0xd7626299UL,
+    0xce7953d8UL, 0x49e14f17UL, 0x50fa7e56UL, 0x7bd72d95UL, 0x62cc1cd4UL,
+    0x2d8d8a13UL, 0x3496bb52UL, 0x1fbbe891UL, 0x06a0d9d0UL, 0x5e7ef3ecUL,
+    0x4765c2adUL, 0x6c48916eUL, 0x7553a02fUL, 0x3a1236e8UL, 0x230907a9UL,
+    0x0824546aUL, 0x113f652bUL, 0x96a779e4UL, 0x8fbc48a5UL, 0xa4911b66UL,
+    0xbd8a2a27UL, 0xf2cbbce0UL, 0xebd08da1UL, 0xc0fdde62UL, 0xd9e6ef23UL,
+    0x14bce1bdUL, 0x0da7d0fcUL, 0x268a833fUL, 0x3f91b27eUL, 0x70d024b9UL,
+    0x69cb15f8UL, 0x42e6463bUL, 0x5bfd777aUL, 0xdc656bb5UL, 0xc57e5af4UL,
+    0xee530937UL, 0xf7483876UL, 0xb809aeb1UL, 0xa1129ff0UL, 0x8a3fcc33UL,
+    0x9324fd72UL
+  },
+  {
+    0x00000000UL, 0x01c26a37UL, 0x0384d46eUL, 0x0246be59UL, 0x0709a8dcUL,
+    0x06cbc2ebUL, 0x048d7cb2UL, 0x054f1685UL, 0x0e1351b8UL, 0x0fd13b8fUL,
+    0x0d9785d6UL, 0x0c55efe1UL, 0x091af964UL, 0x08d89353UL, 0x0a9e2d0aUL,
+    0x0b5c473dUL, 0x1c26a370UL, 0x1de4c947UL, 0x1fa2771eUL, 0x1e601d29UL,
+    0x1b2f0bacUL, 0x1aed619bUL, 0x18abdfc2UL, 0x1969b5f5UL, 0x1235f2c8UL,
+    0x13f798ffUL, 0x11b126a6UL, 0x10734c91UL, 0x153c5a14UL, 0x14fe3023UL,
+    0x16b88e7aUL, 0x177ae44dUL, 0x384d46e0UL, 0x398f2cd7UL, 0x3bc9928eUL,
+    0x3a0bf8b9UL, 0x3f44ee3cUL, 0x3e86840bUL, 0x3cc03a52UL, 0x3d025065UL,
+    0x365e1758UL, 0x379c7d6fUL, 0x35dac336UL, 0x3418a901UL, 0x3157bf84UL,
+    0x3095d5b3UL, 0x32d36beaUL, 0x331101ddUL, 0x246be590UL, 0x25a98fa7UL,
+    0x27ef31feUL, 0x262d5bc9UL, 0x23624d4cUL, 0x22a0277bUL, 0x20e69922UL,
+    0x2124f315UL, 0x2a78b428UL, 0x2bbade1fUL, 0x29fc6046UL, 0x283e0a71UL,
+    0x2d711cf4UL, 0x2cb376c3UL, 0x2ef5c89aUL, 0x2f37a2adUL, 0x709a8dc0UL,
+    0x7158e7f7UL, 0x731e59aeUL, 0x72dc3399UL, 0x7793251cUL, 0x76514f2bUL,
+    0x7417f172UL, 0x75d59b45UL, 0x7e89dc78UL, 0x7f4bb64fUL, 0x7d0d0816UL,
+    0x7ccf6221UL, 0x798074a4UL, 0x78421e93UL, 0x7a04a0caUL, 0x7bc6cafdUL,
+    0x6cbc2eb0UL, 0x6d7e4487UL, 0x6f38fadeUL, 0x6efa90e9UL, 0x6bb5866cUL,
+    0x6a77ec5bUL, 0x68315202UL, 0x69f33835UL, 0x62af7f08UL, 0x636d153fUL,
+    0x612bab66UL, 0x60e9c151UL, 0x65a6d7d4UL, 0x6464bde3UL, 0x662203baUL,
+    0x67e0698dUL, 0x48d7cb20UL, 0x4915a117UL, 0x4b531f4eUL, 0x4a917579UL,
+    0x4fde63fcUL, 0x4e1c09cbUL, 0x4c5ab792UL, 0x4d98dda5UL, 0x46c49a98UL,
+    0x4706f0afUL, 0x45404ef6UL, 0x448224c1UL, 0x41cd3244UL, 0x400f5873UL,
+    0x4249e62aUL, 0x438b8c1dUL, 0x54f16850UL, 0x55330267UL, 0x5775bc3eUL,
+    0x56b7d609UL, 0x53f8c08cUL, 0x523aaabbUL, 0x507c14e2UL, 0x51be7ed5UL,
+    0x5ae239e8UL, 0x5b2053dfUL, 0x5966ed86UL, 0x58a487b1UL, 0x5deb9134UL,
+    0x5c29fb03UL, 0x5e6f455aUL, 0x5fad2f6dUL, 0xe1351b80UL, 0xe0f771b7UL,
+    0xe2b1cfeeUL, 0xe373a5d9UL, 0xe63cb35cUL, 0xe7fed96bUL, 0xe5b86732UL,
+    0xe47a0d05UL, 0xef264a38UL, 0xeee4200fUL, 0xeca29e56UL, 0xed60f461UL,
+    0xe82fe2e4UL, 0xe9ed88d3UL, 0xebab368aUL, 0xea695cbdUL, 0xfd13b8f0UL,
+    0xfcd1d2c7UL, 0xfe976c9eUL, 0xff5506a9UL, 0xfa1a102cUL, 0xfbd87a1bUL,
+    0xf99ec442UL, 0xf85cae75UL, 0xf300e948UL, 0xf2c2837fUL, 0xf0843d26UL,
+    0xf1465711UL, 0xf4094194UL, 0xf5cb2ba3UL, 0xf78d95faUL, 0xf64fffcdUL,
+    0xd9785d60UL, 0xd8ba3757UL, 0xdafc890eUL, 0xdb3ee339UL, 0xde71f5bcUL,
+    0xdfb39f8bUL, 0xddf521d2UL, 0xdc374be5UL, 0xd76b0cd8UL, 0xd6a966efUL,
+    0xd4efd8b6UL, 0xd52db281UL, 0xd062a404UL, 0xd1a0ce33UL, 0xd3e6706aUL,
+    0xd2241a5dUL, 0xc55efe10UL, 0xc49c9427UL, 0xc6da2a7eUL, 0xc7184049UL,
+    0xc25756ccUL, 0xc3953cfbUL, 0xc1d382a2UL, 0xc011e895UL, 0xcb4dafa8UL,
+    0xca8fc59fUL, 0xc8c97bc6UL, 0xc90b11f1UL, 0xcc440774UL, 0xcd866d43UL,
+    0xcfc0d31aUL, 0xce02b92dUL, 0x91af9640UL, 0x906dfc77UL, 0x922b422eUL,
+    0x93e92819UL, 0x96a63e9cUL, 0x976454abUL, 0x9522eaf2UL, 0x94e080c5UL,
+    0x9fbcc7f8UL, 0x9e7eadcfUL, 0x9c381396UL, 0x9dfa79a1UL, 0x98b56f24UL,
+    0x99770513UL, 0x9b31bb4aUL, 0x9af3d17dUL, 0x8d893530UL, 0x8c4b5f07UL,
+    0x8e0de15eUL, 0x8fcf8b69UL, 0x8a809decUL, 0x8b42f7dbUL, 0x89044982UL,
+    0x88c623b5UL, 0x839a6488UL, 0x82580ebfUL, 0x801eb0e6UL, 0x81dcdad1UL,
+    0x8493cc54UL, 0x8551a663UL, 0x8717183aUL, 0x86d5720dUL, 0xa9e2d0a0UL,
+    0xa820ba97UL, 0xaa6604ceUL, 0xaba46ef9UL, 0xaeeb787cUL, 0xaf29124bUL,
+    0xad6fac12UL, 0xacadc625UL, 0xa7f18118UL, 0xa633eb2fUL, 0xa4755576UL,
+    0xa5b73f41UL, 0xa0f829c4UL, 0xa13a43f3UL, 0xa37cfdaaUL, 0xa2be979dUL,
+    0xb5c473d0UL, 0xb40619e7UL, 0xb640a7beUL, 0xb782cd89UL, 0xb2cddb0cUL,
+    0xb30fb13bUL, 0xb1490f62UL, 0xb08b6555UL, 0xbbd72268UL, 0xba15485fUL,
+    0xb853f606UL, 0xb9919c31UL, 0xbcde8ab4UL, 0xbd1ce083UL, 0xbf5a5edaUL,
+    0xbe9834edUL
+  },
+  {
+    0x00000000UL, 0xb8bc6765UL, 0xaa09c88bUL, 0x12b5afeeUL, 0x8f629757UL,
+    0x37def032UL, 0x256b5fdcUL, 0x9dd738b9UL, 0xc5b428efUL, 0x7d084f8aUL,
+    0x6fbde064UL, 0xd7018701UL, 0x4ad6bfb8UL, 0xf26ad8ddUL, 0xe0df7733UL,
+    0x58631056UL, 0x5019579fUL, 0xe8a530faUL, 0xfa109f14UL, 0x42acf871UL,
+    0xdf7bc0c8UL, 0x67c7a7adUL, 0x75720843UL, 0xcdce6f26UL, 0x95ad7f70UL,
+    0x2d111815UL, 0x3fa4b7fbUL, 0x8718d09eUL, 0x1acfe827UL, 0xa2738f42UL,
+    0xb0c620acUL, 0x087a47c9UL, 0xa032af3eUL, 0x188ec85bUL, 0x0a3b67b5UL,
+    0xb28700d0UL, 0x2f503869UL, 0x97ec5f0cUL, 0x8559f0e2UL, 0x3de59787UL,
+    0x658687d1UL, 0xdd3ae0b4UL, 0xcf8f4f5aUL, 0x7733283fUL, 0xeae41086UL,
+    0x525877e3UL, 0x40edd80dUL, 0xf851bf68UL, 0xf02bf8a1UL, 0x48979fc4UL,
+    0x5a22302aUL, 0xe29e574fUL, 0x7f496ff6UL, 0xc7f50893UL, 0xd540a77dUL,
+    0x6dfcc018UL, 0x359fd04eUL, 0x8d23b72bUL, 0x9f9618c5UL, 0x272a7fa0UL,
+    0xbafd4719UL, 0x0241207cUL, 0x10f48f92UL, 0xa848e8f7UL, 0x9b14583dUL,
+    0x23a83f58UL, 0x311d90b6UL, 0x89a1f7d3UL, 0x1476cf6aUL, 0xaccaa80fUL,
+    0xbe7f07e1UL, 0x06c36084UL, 0x5ea070d2UL, 0xe61c17b7UL, 0xf4a9b859UL,
+    0x4c15df3cUL, 0xd1c2e785UL, 0x697e80e0UL, 0x7bcb2f0eUL, 0xc377486bUL,
+    0xcb0d0fa2UL, 0x73b168c7UL, 0x6104c729UL, 0xd9b8a04cUL, 0x446f98f5UL,
+    0xfcd3ff90UL, 0xee66507eUL, 0x56da371bUL, 0x0eb9274dUL, 0xb6054028UL,
+    0xa4b0efc6UL, 0x1c0c88a3UL, 0x81dbb01aUL, 0x3967d77fUL, 0x2bd27891UL,
+    0x936e1ff4UL, 0x3b26f703UL, 0x839a9066UL, 0x912f3f88UL, 0x299358edUL,
+    0xb4446054UL, 0x0cf80731UL, 0x1e4da8dfUL, 0xa6f1cfbaUL, 0xfe92dfecUL,
+    0x462eb889UL, 0x549b1767UL, 0xec277002UL, 0x71f048bbUL, 0xc94c2fdeUL,
+    0xdbf98030UL, 0x6345e755UL, 0x6b3fa09cUL, 0xd383c7f9UL, 0xc1366817UL,
+    0x798a0f72UL, 0xe45d37cbUL, 0x5ce150aeUL, 0x4e54ff40UL, 0xf6e89825UL,
+    0xae8b8873UL, 0x1637ef16UL, 0x048240f8UL, 0xbc3e279dUL, 0x21e91f24UL,
+    0x99557841UL, 0x8be0d7afUL, 0x335cb0caUL, 0xed59b63bUL, 0x55e5d15eUL,
+    0x47507eb0UL, 0xffec19d5UL, 0x623b216cUL, 0xda874609UL, 0xc832e9e7UL,
+    0x708e8e82UL, 0x28ed9ed4UL, 0x9051f9b1UL, 0x82e4565fUL, 0x3a58313aUL,
+    0xa78f0983UL, 0x1f336ee6UL, 0x0d86c108UL, 0xb53aa66dUL, 0xbd40e1a4UL,
+    0x05fc86c1UL, 0x1749292fUL, 0xaff54e4aUL, 0x322276f3UL, 0x8a9e1196UL,
+    0x982bbe78UL, 0x2097d91dUL, 0x78f4c94bUL, 0xc048ae2eUL, 0xd2fd01c0UL,
+    0x6a4166a5UL, 0xf7965e1cUL, 0x4f2a3979UL, 0x5d9f9697UL, 0xe523f1f2UL,
+    0x4d6b1905UL, 0xf5d77e60UL, 0xe762d18eUL, 0x5fdeb6ebUL, 0xc2098e52UL,
+    0x7ab5e937UL, 0x680046d9UL, 0xd0bc21bcUL, 0x88df31eaUL, 0x3063568fUL,
+    0x22d6f961UL, 0x9a6a9e04UL, 0x07bda6bdUL, 0xbf01c1d8UL, 0xadb46e36UL,
+    0x15080953UL, 0x1d724e9aUL, 0xa5ce29ffUL, 0xb77b8611UL, 0x0fc7e174UL,
+    0x9210d9cdUL, 0x2aacbea8UL, 0x38191146UL, 0x80a57623UL, 0xd8c66675UL,
+    0x607a0110UL, 0x72cfaefeUL, 0xca73c99bUL, 0x57a4f122UL, 0xef189647UL,
+    0xfdad39a9UL, 0x45115eccUL, 0x764dee06UL, 0xcef18963UL, 0xdc44268dUL,
+    0x64f841e8UL, 0xf92f7951UL, 0x41931e34UL, 0x5326b1daUL, 0xeb9ad6bfUL,
+    0xb3f9c6e9UL, 0x0b45a18cUL, 0x19f00e62UL, 0xa14c6907UL, 0x3c9b51beUL,
+    0x842736dbUL, 0x96929935UL, 0x2e2efe50UL, 0x2654b999UL, 0x9ee8defcUL,
+    0x8c5d7112UL, 0x34e11677UL, 0xa9362eceUL, 0x118a49abUL, 0x033fe645UL,
+    0xbb838120UL, 0xe3e09176UL, 0x5b5cf613UL, 0x49e959fdUL, 0xf1553e98UL,
+    0x6c820621UL, 0xd43e6144UL, 0xc68bceaaUL, 0x7e37a9cfUL, 0xd67f4138UL,
+    0x6ec3265dUL, 0x7c7689b3UL, 0xc4caeed6UL, 0x591dd66fUL, 0xe1a1b10aUL,
+    0xf3141ee4UL, 0x4ba87981UL, 0x13cb69d7UL, 0xab770eb2UL, 0xb9c2a15cUL,
+    0x017ec639UL, 0x9ca9fe80UL, 0x241599e5UL, 0x36a0360bUL, 0x8e1c516eUL,
+    0x866616a7UL, 0x3eda71c2UL, 0x2c6fde2cUL, 0x94d3b949UL, 0x090481f0UL,
+    0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL,
+    0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL,
+    0xde0506f1UL
+  },
+  {
+    0x00000000UL, 0x96300777UL, 0x2c610eeeUL, 0xba510999UL, 0x19c46d07UL,
+    0x8ff46a70UL, 0x35a563e9UL, 0xa395649eUL, 0x3288db0eUL, 0xa4b8dc79UL,
+    0x1ee9d5e0UL, 0x88d9d297UL, 0x2b4cb609UL, 0xbd7cb17eUL, 0x072db8e7UL,
+    0x911dbf90UL, 0x6410b71dUL, 0xf220b06aUL, 0x4871b9f3UL, 0xde41be84UL,
+    0x7dd4da1aUL, 0xebe4dd6dUL, 0x51b5d4f4UL, 0xc785d383UL, 0x56986c13UL,
+    0xc0a86b64UL, 0x7af962fdUL, 0xecc9658aUL, 0x4f5c0114UL, 0xd96c0663UL,
+    0x633d0ffaUL, 0xf50d088dUL, 0xc8206e3bUL, 0x5e10694cUL, 0xe44160d5UL,
+    0x727167a2UL, 0xd1e4033cUL, 0x47d4044bUL, 0xfd850dd2UL, 0x6bb50aa5UL,
+    0xfaa8b535UL, 0x6c98b242UL, 0xd6c9bbdbUL, 0x40f9bcacUL, 0xe36cd832UL,
+    0x755cdf45UL, 0xcf0dd6dcUL, 0x593dd1abUL, 0xac30d926UL, 0x3a00de51UL,
+    0x8051d7c8UL, 0x1661d0bfUL, 0xb5f4b421UL, 0x23c4b356UL, 0x9995bacfUL,
+    0x0fa5bdb8UL, 0x9eb80228UL, 0x0888055fUL, 0xb2d90cc6UL, 0x24e90bb1UL,
+    0x877c6f2fUL, 0x114c6858UL, 0xab1d61c1UL, 0x3d2d66b6UL, 0x9041dc76UL,
+    0x0671db01UL, 0xbc20d298UL, 0x2a10d5efUL, 0x8985b171UL, 0x1fb5b606UL,
+    0xa5e4bf9fUL, 0x33d4b8e8UL, 0xa2c90778UL, 0x34f9000fUL, 0x8ea80996UL,
+    0x18980ee1UL, 0xbb0d6a7fUL, 0x2d3d6d08UL, 0x976c6491UL, 0x015c63e6UL,
+    0xf4516b6bUL, 0x62616c1cUL, 0xd8306585UL, 0x4e0062f2UL, 0xed95066cUL,
+    0x7ba5011bUL, 0xc1f40882UL, 0x57c40ff5UL, 0xc6d9b065UL, 0x50e9b712UL,
+    0xeab8be8bUL, 0x7c88b9fcUL, 0xdf1ddd62UL, 0x492dda15UL, 0xf37cd38cUL,
+    0x654cd4fbUL, 0x5861b24dUL, 0xce51b53aUL, 0x7400bca3UL, 0xe230bbd4UL,
+    0x41a5df4aUL, 0xd795d83dUL, 0x6dc4d1a4UL, 0xfbf4d6d3UL, 0x6ae96943UL,
+    0xfcd96e34UL, 0x468867adUL, 0xd0b860daUL, 0x732d0444UL, 0xe51d0333UL,
+    0x5f4c0aaaUL, 0xc97c0dddUL, 0x3c710550UL, 0xaa410227UL, 0x10100bbeUL,
+    0x86200cc9UL, 0x25b56857UL, 0xb3856f20UL, 0x09d466b9UL, 0x9fe461ceUL,
+    0x0ef9de5eUL, 0x98c9d929UL, 0x2298d0b0UL, 0xb4a8d7c7UL, 0x173db359UL,
+    0x810db42eUL, 0x3b5cbdb7UL, 0xad6cbac0UL, 0x2083b8edUL, 0xb6b3bf9aUL,
+    0x0ce2b603UL, 0x9ad2b174UL, 0x3947d5eaUL, 0xaf77d29dUL, 0x1526db04UL,
+    0x8316dc73UL, 0x120b63e3UL, 0x843b6494UL, 0x3e6a6d0dUL, 0xa85a6a7aUL,
+    0x0bcf0ee4UL, 0x9dff0993UL, 0x27ae000aUL, 0xb19e077dUL, 0x44930ff0UL,
+    0xd2a30887UL, 0x68f2011eUL, 0xfec20669UL, 0x5d5762f7UL, 0xcb676580UL,
+    0x71366c19UL, 0xe7066b6eUL, 0x761bd4feUL, 0xe02bd389UL, 0x5a7ada10UL,
+    0xcc4add67UL, 0x6fdfb9f9UL, 0xf9efbe8eUL, 0x43beb717UL, 0xd58eb060UL,
+    0xe8a3d6d6UL, 0x7e93d1a1UL, 0xc4c2d838UL, 0x52f2df4fUL, 0xf167bbd1UL,
+    0x6757bca6UL, 0xdd06b53fUL, 0x4b36b248UL, 0xda2b0dd8UL, 0x4c1b0aafUL,
+    0xf64a0336UL, 0x607a0441UL, 0xc3ef60dfUL, 0x55df67a8UL, 0xef8e6e31UL,
+    0x79be6946UL, 0x8cb361cbUL, 0x1a8366bcUL, 0xa0d26f25UL, 0x36e26852UL,
+    0x95770cccUL, 0x03470bbbUL, 0xb9160222UL, 0x2f260555UL, 0xbe3bbac5UL,
+    0x280bbdb2UL, 0x925ab42bUL, 0x046ab35cUL, 0xa7ffd7c2UL, 0x31cfd0b5UL,
+    0x8b9ed92cUL, 0x1daede5bUL, 0xb0c2649bUL, 0x26f263ecUL, 0x9ca36a75UL,
+    0x0a936d02UL, 0xa906099cUL, 0x3f360eebUL, 0x85670772UL, 0x13570005UL,
+    0x824abf95UL, 0x147ab8e2UL, 0xae2bb17bUL, 0x381bb60cUL, 0x9b8ed292UL,
+    0x0dbed5e5UL, 0xb7efdc7cUL, 0x21dfdb0bUL, 0xd4d2d386UL, 0x42e2d4f1UL,
+    0xf8b3dd68UL, 0x6e83da1fUL, 0xcd16be81UL, 0x5b26b9f6UL, 0xe177b06fUL,
+    0x7747b718UL, 0xe65a0888UL, 0x706a0fffUL, 0xca3b0666UL, 0x5c0b0111UL,
+    0xff9e658fUL, 0x69ae62f8UL, 0xd3ff6b61UL, 0x45cf6c16UL, 0x78e20aa0UL,
+    0xeed20dd7UL, 0x5483044eUL, 0xc2b30339UL, 0x612667a7UL, 0xf71660d0UL,
+    0x4d476949UL, 0xdb776e3eUL, 0x4a6ad1aeUL, 0xdc5ad6d9UL, 0x660bdf40UL,
+    0xf03bd837UL, 0x53aebca9UL, 0xc59ebbdeUL, 0x7fcfb247UL, 0xe9ffb530UL,
+    0x1cf2bdbdUL, 0x8ac2bacaUL, 0x3093b353UL, 0xa6a3b424UL, 0x0536d0baUL,
+    0x9306d7cdUL, 0x2957de54UL, 0xbf67d923UL, 0x2e7a66b3UL, 0xb84a61c4UL,
+    0x021b685dUL, 0x942b6f2aUL, 0x37be0bb4UL, 0xa18e0cc3UL, 0x1bdf055aUL,
+    0x8def022dUL
+  },
+  {
+    0x00000000UL, 0x41311b19UL, 0x82623632UL, 0xc3532d2bUL, 0x04c56c64UL,
+    0x45f4777dUL, 0x86a75a56UL, 0xc796414fUL, 0x088ad9c8UL, 0x49bbc2d1UL,
+    0x8ae8effaUL, 0xcbd9f4e3UL, 0x0c4fb5acUL, 0x4d7eaeb5UL, 0x8e2d839eUL,
+    0xcf1c9887UL, 0x5112c24aUL, 0x1023d953UL, 0xd370f478UL, 0x9241ef61UL,
+    0x55d7ae2eUL, 0x14e6b537UL, 0xd7b5981cUL, 0x96848305UL, 0x59981b82UL,
+    0x18a9009bUL, 0xdbfa2db0UL, 0x9acb36a9UL, 0x5d5d77e6UL, 0x1c6c6cffUL,
+    0xdf3f41d4UL, 0x9e0e5acdUL, 0xa2248495UL, 0xe3159f8cUL, 0x2046b2a7UL,
+    0x6177a9beUL, 0xa6e1e8f1UL, 0xe7d0f3e8UL, 0x2483dec3UL, 0x65b2c5daUL,
+    0xaaae5d5dUL, 0xeb9f4644UL, 0x28cc6b6fUL, 0x69fd7076UL, 0xae6b3139UL,
+    0xef5a2a20UL, 0x2c09070bUL, 0x6d381c12UL, 0xf33646dfUL, 0xb2075dc6UL,
+    0x715470edUL, 0x30656bf4UL, 0xf7f32abbUL, 0xb6c231a2UL, 0x75911c89UL,
+    0x34a00790UL, 0xfbbc9f17UL, 0xba8d840eUL, 0x79dea925UL, 0x38efb23cUL,
+    0xff79f373UL, 0xbe48e86aUL, 0x7d1bc541UL, 0x3c2ade58UL, 0x054f79f0UL,
+    0x447e62e9UL, 0x872d4fc2UL, 0xc61c54dbUL, 0x018a1594UL, 0x40bb0e8dUL,
+    0x83e823a6UL, 0xc2d938bfUL, 0x0dc5a038UL, 0x4cf4bb21UL, 0x8fa7960aUL,
+    0xce968d13UL, 0x0900cc5cUL, 0x4831d745UL, 0x8b62fa6eUL, 0xca53e177UL,
+    0x545dbbbaUL, 0x156ca0a3UL, 0xd63f8d88UL, 0x970e9691UL, 0x5098d7deUL,
+    0x11a9ccc7UL, 0xd2fae1ecUL, 0x93cbfaf5UL, 0x5cd76272UL, 0x1de6796bUL,
+    0xdeb55440UL, 0x9f844f59UL, 0x58120e16UL, 0x1923150fUL, 0xda703824UL,
+    0x9b41233dUL, 0xa76bfd65UL, 0xe65ae67cUL, 0x2509cb57UL, 0x6438d04eUL,
+    0xa3ae9101UL, 0xe29f8a18UL, 0x21cca733UL, 0x60fdbc2aUL, 0xafe124adUL,
+    0xeed03fb4UL, 0x2d83129fUL, 0x6cb20986UL, 0xab2448c9UL, 0xea1553d0UL,
+    0x29467efbUL, 0x687765e2UL, 0xf6793f2fUL, 0xb7482436UL, 0x741b091dUL,
+    0x352a1204UL, 0xf2bc534bUL, 0xb38d4852UL, 0x70de6579UL, 0x31ef7e60UL,
+    0xfef3e6e7UL, 0xbfc2fdfeUL, 0x7c91d0d5UL, 0x3da0cbccUL, 0xfa368a83UL,
+    0xbb07919aUL, 0x7854bcb1UL, 0x3965a7a8UL, 0x4b98833bUL, 0x0aa99822UL,
+    0xc9fab509UL, 0x88cbae10UL, 0x4f5def5fUL, 0x0e6cf446UL, 0xcd3fd96dUL,
+    0x8c0ec274UL, 0x43125af3UL, 0x022341eaUL, 0xc1706cc1UL, 0x804177d8UL,
+    0x47d73697UL, 0x06e62d8eUL, 0xc5b500a5UL, 0x84841bbcUL, 0x1a8a4171UL,
+    0x5bbb5a68UL, 0x98e87743UL, 0xd9d96c5aUL, 0x1e4f2d15UL, 0x5f7e360cUL,
+    0x9c2d1b27UL, 0xdd1c003eUL, 0x120098b9UL, 0x533183a0UL, 0x9062ae8bUL,
+    0xd153b592UL, 0x16c5f4ddUL, 0x57f4efc4UL, 0x94a7c2efUL, 0xd596d9f6UL,
+    0xe9bc07aeUL, 0xa88d1cb7UL, 0x6bde319cUL, 0x2aef2a85UL, 0xed796bcaUL,
+    0xac4870d3UL, 0x6f1b5df8UL, 0x2e2a46e1UL, 0xe136de66UL, 0xa007c57fUL,
+    0x6354e854UL, 0x2265f34dUL, 0xe5f3b202UL, 0xa4c2a91bUL, 0x67918430UL,
+    0x26a09f29UL, 0xb8aec5e4UL, 0xf99fdefdUL, 0x3accf3d6UL, 0x7bfde8cfUL,
+    0xbc6ba980UL, 0xfd5ab299UL, 0x3e099fb2UL, 0x7f3884abUL, 0xb0241c2cUL,
+    0xf1150735UL, 0x32462a1eUL, 0x73773107UL, 0xb4e17048UL, 0xf5d06b51UL,
+    0x3683467aUL, 0x77b25d63UL, 0x4ed7facbUL, 0x0fe6e1d2UL, 0xccb5ccf9UL,
+    0x8d84d7e0UL, 0x4a1296afUL, 0x0b238db6UL, 0xc870a09dUL, 0x8941bb84UL,
+    0x465d2303UL, 0x076c381aUL, 0xc43f1531UL, 0x850e0e28UL, 0x42984f67UL,
+    0x03a9547eUL, 0xc0fa7955UL, 0x81cb624cUL, 0x1fc53881UL, 0x5ef42398UL,
+    0x9da70eb3UL, 0xdc9615aaUL, 0x1b0054e5UL, 0x5a314ffcUL, 0x996262d7UL,
+    0xd85379ceUL, 0x174fe149UL, 0x567efa50UL, 0x952dd77bUL, 0xd41ccc62UL,
+    0x138a8d2dUL, 0x52bb9634UL, 0x91e8bb1fUL, 0xd0d9a006UL, 0xecf37e5eUL,
+    0xadc26547UL, 0x6e91486cUL, 0x2fa05375UL, 0xe836123aUL, 0xa9070923UL,
+    0x6a542408UL, 0x2b653f11UL, 0xe479a796UL, 0xa548bc8fUL, 0x661b91a4UL,
+    0x272a8abdUL, 0xe0bccbf2UL, 0xa18dd0ebUL, 0x62defdc0UL, 0x23efe6d9UL,
+    0xbde1bc14UL, 0xfcd0a70dUL, 0x3f838a26UL, 0x7eb2913fUL, 0xb924d070UL,
+    0xf815cb69UL, 0x3b46e642UL, 0x7a77fd5bUL, 0xb56b65dcUL, 0xf45a7ec5UL,
+    0x370953eeUL, 0x763848f7UL, 0xb1ae09b8UL, 0xf09f12a1UL, 0x33cc3f8aUL,
+    0x72fd2493UL
+  },
+  {
+    0x00000000UL, 0x376ac201UL, 0x6ed48403UL, 0x59be4602UL, 0xdca80907UL,
+    0xebc2cb06UL, 0xb27c8d04UL, 0x85164f05UL, 0xb851130eUL, 0x8f3bd10fUL,
+    0xd685970dUL, 0xe1ef550cUL, 0x64f91a09UL, 0x5393d808UL, 0x0a2d9e0aUL,
+    0x3d475c0bUL, 0x70a3261cUL, 0x47c9e41dUL, 0x1e77a21fUL, 0x291d601eUL,
+    0xac0b2f1bUL, 0x9b61ed1aUL, 0xc2dfab18UL, 0xf5b56919UL, 0xc8f23512UL,
+    0xff98f713UL, 0xa626b111UL, 0x914c7310UL, 0x145a3c15UL, 0x2330fe14UL,
+    0x7a8eb816UL, 0x4de47a17UL, 0xe0464d38UL, 0xd72c8f39UL, 0x8e92c93bUL,
+    0xb9f80b3aUL, 0x3cee443fUL, 0x0b84863eUL, 0x523ac03cUL, 0x6550023dUL,
+    0x58175e36UL, 0x6f7d9c37UL, 0x36c3da35UL, 0x01a91834UL, 0x84bf5731UL,
+    0xb3d59530UL, 0xea6bd332UL, 0xdd011133UL, 0x90e56b24UL, 0xa78fa925UL,
+    0xfe31ef27UL, 0xc95b2d26UL, 0x4c4d6223UL, 0x7b27a022UL, 0x2299e620UL,
+    0x15f32421UL, 0x28b4782aUL, 0x1fdeba2bUL, 0x4660fc29UL, 0x710a3e28UL,
+    0xf41c712dUL, 0xc376b32cUL, 0x9ac8f52eUL, 0xada2372fUL, 0xc08d9a70UL,
+    0xf7e75871UL, 0xae591e73UL, 0x9933dc72UL, 0x1c259377UL, 0x2b4f5176UL,
+    0x72f11774UL, 0x459bd575UL, 0x78dc897eUL, 0x4fb64b7fUL, 0x16080d7dUL,
+    0x2162cf7cUL, 0xa4748079UL, 0x931e4278UL, 0xcaa0047aUL, 0xfdcac67bUL,
+    0xb02ebc6cUL, 0x87447e6dUL, 0xdefa386fUL, 0xe990fa6eUL, 0x6c86b56bUL,
+    0x5bec776aUL, 0x02523168UL, 0x3538f369UL, 0x087faf62UL, 0x3f156d63UL,
+    0x66ab2b61UL, 0x51c1e960UL, 0xd4d7a665UL, 0xe3bd6464UL, 0xba032266UL,
+    0x8d69e067UL, 0x20cbd748UL, 0x17a11549UL, 0x4e1f534bUL, 0x7975914aUL,
+    0xfc63de4fUL, 0xcb091c4eUL, 0x92b75a4cUL, 0xa5dd984dUL, 0x989ac446UL,
+    0xaff00647UL, 0xf64e4045UL, 0xc1248244UL, 0x4432cd41UL, 0x73580f40UL,
+    0x2ae64942UL, 0x1d8c8b43UL, 0x5068f154UL, 0x67023355UL, 0x3ebc7557UL,
+    0x09d6b756UL, 0x8cc0f853UL, 0xbbaa3a52UL, 0xe2147c50UL, 0xd57ebe51UL,
+    0xe839e25aUL, 0xdf53205bUL, 0x86ed6659UL, 0xb187a458UL, 0x3491eb5dUL,
+    0x03fb295cUL, 0x5a456f5eUL, 0x6d2fad5fUL, 0x801b35e1UL, 0xb771f7e0UL,
+    0xeecfb1e2UL, 0xd9a573e3UL, 0x5cb33ce6UL, 0x6bd9fee7UL, 0x3267b8e5UL,
+    0x050d7ae4UL, 0x384a26efUL, 0x0f20e4eeUL, 0x569ea2ecUL, 0x61f460edUL,
+    0xe4e22fe8UL, 0xd388ede9UL, 0x8a36abebUL, 0xbd5c69eaUL, 0xf0b813fdUL,
+    0xc7d2d1fcUL, 0x9e6c97feUL, 0xa90655ffUL, 0x2c101afaUL, 0x1b7ad8fbUL,
+    0x42c49ef9UL, 0x75ae5cf8UL, 0x48e900f3UL, 0x7f83c2f2UL, 0x263d84f0UL,
+    0x115746f1UL, 0x944109f4UL, 0xa32bcbf5UL, 0xfa958df7UL, 0xcdff4ff6UL,
+    0x605d78d9UL, 0x5737bad8UL, 0x0e89fcdaUL, 0x39e33edbUL, 0xbcf571deUL,
+    0x8b9fb3dfUL, 0xd221f5ddUL, 0xe54b37dcUL, 0xd80c6bd7UL, 0xef66a9d6UL,
+    0xb6d8efd4UL, 0x81b22dd5UL, 0x04a462d0UL, 0x33cea0d1UL, 0x6a70e6d3UL,
+    0x5d1a24d2UL, 0x10fe5ec5UL, 0x27949cc4UL, 0x7e2adac6UL, 0x494018c7UL,
+    0xcc5657c2UL, 0xfb3c95c3UL, 0xa282d3c1UL, 0x95e811c0UL, 0xa8af4dcbUL,
+    0x9fc58fcaUL, 0xc67bc9c8UL, 0xf1110bc9UL, 0x740744ccUL, 0x436d86cdUL,
+    0x1ad3c0cfUL, 0x2db902ceUL, 0x4096af91UL, 0x77fc6d90UL, 0x2e422b92UL,
+    0x1928e993UL, 0x9c3ea696UL, 0xab546497UL, 0xf2ea2295UL, 0xc580e094UL,
+    0xf8c7bc9fUL, 0xcfad7e9eUL, 0x9613389cUL, 0xa179fa9dUL, 0x246fb598UL,
+    0x13057799UL, 0x4abb319bUL, 0x7dd1f39aUL, 0x3035898dUL, 0x075f4b8cUL,
+    0x5ee10d8eUL, 0x698bcf8fUL, 0xec9d808aUL, 0xdbf7428bUL, 0x82490489UL,
+    0xb523c688UL, 0x88649a83UL, 0xbf0e5882UL, 0xe6b01e80UL, 0xd1dadc81UL,
+    0x54cc9384UL, 0x63a65185UL, 0x3a181787UL, 0x0d72d586UL, 0xa0d0e2a9UL,
+    0x97ba20a8UL, 0xce0466aaUL, 0xf96ea4abUL, 0x7c78ebaeUL, 0x4b1229afUL,
+    0x12ac6fadUL, 0x25c6adacUL, 0x1881f1a7UL, 0x2feb33a6UL, 0x765575a4UL,
+    0x413fb7a5UL, 0xc429f8a0UL, 0xf3433aa1UL, 0xaafd7ca3UL, 0x9d97bea2UL,
+    0xd073c4b5UL, 0xe71906b4UL, 0xbea740b6UL, 0x89cd82b7UL, 0x0cdbcdb2UL,
+    0x3bb10fb3UL, 0x620f49b1UL, 0x55658bb0UL, 0x6822d7bbUL, 0x5f4815baUL,
+    0x06f653b8UL, 0x319c91b9UL, 0xb48adebcUL, 0x83e01cbdUL, 0xda5e5abfUL,
+    0xed3498beUL
+  },
+  {
+    0x00000000UL, 0x6567bcb8UL, 0x8bc809aaUL, 0xeeafb512UL, 0x5797628fUL,
+    0x32f0de37UL, 0xdc5f6b25UL, 0xb938d79dUL, 0xef28b4c5UL, 0x8a4f087dUL,
+    0x64e0bd6fUL, 0x018701d7UL, 0xb8bfd64aUL, 0xddd86af2UL, 0x3377dfe0UL,
+    0x56106358UL, 0x9f571950UL, 0xfa30a5e8UL, 0x149f10faUL, 0x71f8ac42UL,
+    0xc8c07bdfUL, 0xada7c767UL, 0x43087275UL, 0x266fcecdUL, 0x707fad95UL,
+    0x1518112dUL, 0xfbb7a43fUL, 0x9ed01887UL, 0x27e8cf1aUL, 0x428f73a2UL,
+    0xac20c6b0UL, 0xc9477a08UL, 0x3eaf32a0UL, 0x5bc88e18UL, 0xb5673b0aUL,
+    0xd00087b2UL, 0x6938502fUL, 0x0c5fec97UL, 0xe2f05985UL, 0x8797e53dUL,
+    0xd1878665UL, 0xb4e03addUL, 0x5a4f8fcfUL, 0x3f283377UL, 0x8610e4eaUL,
+    0xe3775852UL, 0x0dd8ed40UL, 0x68bf51f8UL, 0xa1f82bf0UL, 0xc49f9748UL,
+    0x2a30225aUL, 0x4f579ee2UL, 0xf66f497fUL, 0x9308f5c7UL, 0x7da740d5UL,
+    0x18c0fc6dUL, 0x4ed09f35UL, 0x2bb7238dUL, 0xc518969fUL, 0xa07f2a27UL,
+    0x1947fdbaUL, 0x7c204102UL, 0x928ff410UL, 0xf7e848a8UL, 0x3d58149bUL,
+    0x583fa823UL, 0xb6901d31UL, 0xd3f7a189UL, 0x6acf7614UL, 0x0fa8caacUL,
+    0xe1077fbeUL, 0x8460c306UL, 0xd270a05eUL, 0xb7171ce6UL, 0x59b8a9f4UL,
+    0x3cdf154cUL, 0x85e7c2d1UL, 0xe0807e69UL, 0x0e2fcb7bUL, 0x6b4877c3UL,
+    0xa20f0dcbUL, 0xc768b173UL, 0x29c70461UL, 0x4ca0b8d9UL, 0xf5986f44UL,
+    0x90ffd3fcUL, 0x7e5066eeUL, 0x1b37da56UL, 0x4d27b90eUL, 0x284005b6UL,
+    0xc6efb0a4UL, 0xa3880c1cUL, 0x1ab0db81UL, 0x7fd76739UL, 0x9178d22bUL,
+    0xf41f6e93UL, 0x03f7263bUL, 0x66909a83UL, 0x883f2f91UL, 0xed589329UL,
+    0x546044b4UL, 0x3107f80cUL, 0xdfa84d1eUL, 0xbacff1a6UL, 0xecdf92feUL,
+    0x89b82e46UL, 0x67179b54UL, 0x027027ecUL, 0xbb48f071UL, 0xde2f4cc9UL,
+    0x3080f9dbUL, 0x55e74563UL, 0x9ca03f6bUL, 0xf9c783d3UL, 0x176836c1UL,
+    0x720f8a79UL, 0xcb375de4UL, 0xae50e15cUL, 0x40ff544eUL, 0x2598e8f6UL,
+    0x73888baeUL, 0x16ef3716UL, 0xf8408204UL, 0x9d273ebcUL, 0x241fe921UL,
+    0x41785599UL, 0xafd7e08bUL, 0xcab05c33UL, 0x3bb659edUL, 0x5ed1e555UL,
+    0xb07e5047UL, 0xd519ecffUL, 0x6c213b62UL, 0x094687daUL, 0xe7e932c8UL,
+    0x828e8e70UL, 0xd49eed28UL, 0xb1f95190UL, 0x5f56e482UL, 0x3a31583aUL,
+    0x83098fa7UL, 0xe66e331fUL, 0x08c1860dUL, 0x6da63ab5UL, 0xa4e140bdUL,
+    0xc186fc05UL, 0x2f294917UL, 0x4a4ef5afUL, 0xf3762232UL, 0x96119e8aUL,
+    0x78be2b98UL, 0x1dd99720UL, 0x4bc9f478UL, 0x2eae48c0UL, 0xc001fdd2UL,
+    0xa566416aUL, 0x1c5e96f7UL, 0x79392a4fUL, 0x97969f5dUL, 0xf2f123e5UL,
+    0x05196b4dUL, 0x607ed7f5UL, 0x8ed162e7UL, 0xebb6de5fUL, 0x528e09c2UL,
+    0x37e9b57aUL, 0xd9460068UL, 0xbc21bcd0UL, 0xea31df88UL, 0x8f566330UL,
+    0x61f9d622UL, 0x049e6a9aUL, 0xbda6bd07UL, 0xd8c101bfUL, 0x366eb4adUL,
+    0x53090815UL, 0x9a4e721dUL, 0xff29cea5UL, 0x11867bb7UL, 0x74e1c70fUL,
+    0xcdd91092UL, 0xa8beac2aUL, 0x46111938UL, 0x2376a580UL, 0x7566c6d8UL,
+    0x10017a60UL, 0xfeaecf72UL, 0x9bc973caUL, 0x22f1a457UL, 0x479618efUL,
+    0xa939adfdUL, 0xcc5e1145UL, 0x06ee4d76UL, 0x6389f1ceUL, 0x8d2644dcUL,
+    0xe841f864UL, 0x51792ff9UL, 0x341e9341UL, 0xdab12653UL, 0xbfd69aebUL,
+    0xe9c6f9b3UL, 0x8ca1450bUL, 0x620ef019UL, 0x07694ca1UL, 0xbe519b3cUL,
+    0xdb362784UL, 0x35999296UL, 0x50fe2e2eUL, 0x99b95426UL, 0xfcdee89eUL,
+    0x12715d8cUL, 0x7716e134UL, 0xce2e36a9UL, 0xab498a11UL, 0x45e63f03UL,
+    0x208183bbUL, 0x7691e0e3UL, 0x13f65c5bUL, 0xfd59e949UL, 0x983e55f1UL,
+    0x2106826cUL, 0x44613ed4UL, 0xaace8bc6UL, 0xcfa9377eUL, 0x38417fd6UL,
+    0x5d26c36eUL, 0xb389767cUL, 0xd6eecac4UL, 0x6fd61d59UL, 0x0ab1a1e1UL,
+    0xe41e14f3UL, 0x8179a84bUL, 0xd769cb13UL, 0xb20e77abUL, 0x5ca1c2b9UL,
+    0x39c67e01UL, 0x80fea99cUL, 0xe5991524UL, 0x0b36a036UL, 0x6e511c8eUL,
+    0xa7166686UL, 0xc271da3eUL, 0x2cde6f2cUL, 0x49b9d394UL, 0xf0810409UL,
+    0x95e6b8b1UL, 0x7b490da3UL, 0x1e2eb11bUL, 0x483ed243UL, 0x2d596efbUL,
+    0xc3f6dbe9UL, 0xa6916751UL, 0x1fa9b0ccUL, 0x7ace0c74UL, 0x9461b966UL,
+    0xf10605deUL
+#endif
+  }
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/zlib/crypt.h	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,132 @@
+/* crypt.h -- base code for crypt/uncrypt ZIPfile
+
+
+   Version 1.01e, February 12th, 2005
+
+   Copyright (C) 1998-2005 Gilles Vollant
+
+   This code is a modified version of crypting code in Infozip distribution
+
+   The encryption/decryption parts of this source code (as opposed to the
+   non-echoing password parts) were originally written in Europe.  The
+   whole source package can be freely distributed, including from the USA.
+   (Prior to January 2000, re-export from the US was a violation of US law.)
+
+   This encryption code is a direct transcription of the algorithm from
+   Roger Schlafly, described by Phil Katz in the file appnote.txt.  This
+   file (appnote.txt) is distributed with the PKZIP program (even in the
+   version without encryption capabilities).
+
+   If you don't need crypting in your application, just define symbols
+   NOCRYPT and NOUNCRYPT.
+
+   This code support the "Traditional PKWARE Encryption".
+
+   The new AES encryption added on Zip format by Winzip (see the page
+   http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong
+   Encryption is not supported.
+*/
+
+#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))
+
+/***********************************************************************
+ * Return the next byte in the pseudo-random sequence
+ */
+static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab)
+{
+    unsigned temp;  /* POTENTIAL BUG:  temp*(temp^1) may overflow in an
+                     * unpredictable manner on 16-bit systems; not a problem
+                     * with any known compiler so far, though */
+
+    temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
+    return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
+}
+
+/***********************************************************************
+ * Update the encryption keys with the next byte of plain text
+ */
+static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c)
+{
+    (*(pkeys+0)) = CRC32((*(pkeys+0)), c);
+    (*(pkeys+1)) += (*(pkeys+0)) & 0xff;
+    (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1;
+    {
+      register int keyshift = (int)((*(pkeys+1)) >> 24);
+      (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift);
+    }
+    return c;
+}
+
+
+/***********************************************************************
+ * Initialize the encryption keys and the random header according to
+ * the given password.
+ */
+static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab)
+{
+    *(pkeys+0) = 305419896L;
+    *(pkeys+1) = 591751049L;
+    *(pkeys+2) = 878082192L;
+    while (*passwd != '\0') {
+        update_keys(pkeys,pcrc_32_tab,(int)*passwd);
+        passwd++;
+    }
+}
+
+#define zdecode(pkeys,pcrc_32_tab,c) \
+    (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab)))
+
+#define zencode(pkeys,pcrc_32_tab,c,t) \
+    (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c))
+
+#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED
+
+#define RAND_HEAD_LEN  12
+   /* "last resort" source for second part of crypt seed pattern */
+#  ifndef ZCR_SEED2
+#    define ZCR_SEED2 3141592654UL     /* use PI as default pattern */
+#  endif
+
+static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting)
+    const char *passwd;         /* password string */
+    unsigned char *buf;         /* where to write header */
+    int bufSize;
+    unsigned long* pkeys;
+    const unsigned long* pcrc_32_tab;
+    unsigned long crcForCrypting;
+{
+    int n;                       /* index in random header */
+    int t;                       /* temporary */
+    int c;                       /* random byte */
+    unsigned char header[RAND_HEAD_LEN-2]; /* random header */
+    static unsigned calls = 0;   /* ensure different random header each time */
+
+    if (bufSize<RAND_HEAD_LEN)
+      return 0;
+
+    /* First generate RAND_HEAD_LEN-2 random bytes. We encrypt the
+     * output of rand() to get less predictability, since rand() is
+     * often poorly implemented.
+     */
+    if (++calls == 1)
+    {
+        srand((unsigned)(time(NULL) ^ ZCR_SEED2));
+    }
+    init_keys(passwd, pkeys, pcrc_32_tab);
+    for (n = 0; n < RAND_HEAD_LEN-2; n++)
+    {
+        c = (rand() >> 7) & 0xff;
+        header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t);
+    }
+    /* Encrypt random header (last two bytes is high word of crc) */
+    init_keys(passwd, pkeys, pcrc_32_tab);
+    for (n = 0; n < RAND_HEAD_LEN-2; n++)
+    {
+        buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t);
+    }
+    buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t);
+    buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t);
+    return n;
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/zlib/inffast.c	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,318 @@
+/* inffast.c -- fast decoding
+ * Copyright (C) 1995-2004 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+#include "inflate.h"
+#include "inffast.h"
+
+#ifndef ASMINF
+
+/* Allow machine dependent optimization for post-increment or pre-increment.
+   Based on testing to date,
+   Pre-increment preferred for:
+   - PowerPC G3 (Adler)
+   - MIPS R5000 (Randers-Pehrson)
+   Post-increment preferred for:
+   - none
+   No measurable difference:
+   - Pentium III (Anderson)
+   - M68060 (Nikl)
+ */
+#ifdef POSTINC
+#  define OFF 0
+#  define PUP(a) *(a)++
+#else
+#  define OFF 1
+#  define PUP(a) *++(a)
+#endif
+
+/*
+   Decode literal, length, and distance codes and write out the resulting
+   literal and match bytes until either not enough input or output is
+   available, an end-of-block is encountered, or a data error is encountered.
+   When large enough input and output buffers are supplied to inflate(), for
+   example, a 16K input buffer and a 64K output buffer, more than 95% of the
+   inflate execution time is spent in this routine.
+
+   Entry assumptions:
+
+        state->mode == LEN
+        strm->avail_in >= 6
+        strm->avail_out >= 258
+        start >= strm->avail_out
+        state->bits < 8
+
+   On return, state->mode is one of:
+
+        LEN -- ran out of enough output space or enough available input
+        TYPE -- reached end of block code, inflate() to interpret next block
+        BAD -- error in block data
+
+   Notes:
+
+    - The maximum input bits used by a length/distance pair is 15 bits for the
+      length code, 5 bits for the length extra, 15 bits for the distance code,
+      and 13 bits for the distance extra.  This totals 48 bits, or six bytes.
+      Therefore if strm->avail_in >= 6, then there is enough input to avoid
+      checking for available input while decoding.
+
+    - The maximum bytes that a single length/distance pair can output is 258
+      bytes, which is the maximum length that can be coded.  inflate_fast()
+      requires strm->avail_out >= 258 for each loop to avoid checking for
+      output space.
+ */
+void inflate_fast(strm, start)
+z_streamp strm;
+unsigned start;         /* inflate()'s starting value for strm->avail_out */
+{
+    struct inflate_state FAR *state;
+    unsigned char FAR *in;      /* local strm->next_in */
+    unsigned char FAR *last;    /* while in < last, enough input available */
+    unsigned char FAR *out;     /* local strm->next_out */
+    unsigned char FAR *beg;     /* inflate()'s initial strm->next_out */
+    unsigned char FAR *end;     /* while out < end, enough space available */
+#ifdef INFLATE_STRICT
+    unsigned dmax;              /* maximum distance from zlib header */
+#endif
+    unsigned wsize;             /* window size or zero if not using window */
+    unsigned whave;             /* valid bytes in the window */
+    unsigned write;             /* window write index */
+    unsigned char FAR *window;  /* allocated sliding window, if wsize != 0 */
+    unsigned long hold;         /* local strm->hold */
+    unsigned bits;              /* local strm->bits */
+    code const FAR *lcode;      /* local strm->lencode */
+    code const FAR *dcode;      /* local strm->distcode */
+    unsigned lmask;             /* mask for first level of length codes */
+    unsigned dmask;             /* mask for first level of distance codes */
+    code this;                  /* retrieved table entry */
+    unsigned op;                /* code bits, operation, extra bits, or */
+                                /*  window position, window bytes to copy */
+    unsigned len;               /* match length, unused bytes */
+    unsigned dist;              /* match distance */
+    unsigned char FAR *from;    /* where to copy match from */
+
+    /* copy state to local variables */
+    state = (struct inflate_state FAR *)strm->state;
+    in = strm->next_in - OFF;
+    last = in + (strm->avail_in - 5);
+    out = strm->next_out - OFF;
+    beg = out - (start - strm->avail_out);
+    end = out + (strm->avail_out - 257);
+#ifdef INFLATE_STRICT
+    dmax = state->dmax;
+#endif
+    wsize = state->wsize;
+    whave = state->whave;
+    write = state->write;
+    window = state->window;
+    hold = state->hold;
+    bits = state->bits;
+    lcode = state->lencode;
+    dcode = state->distcode;
+    lmask = (1U << state->lenbits) - 1;
+    dmask = (1U << state->distbits) - 1;
+
+    /* decode literals and length/distances until end-of-block or not enough
+       input data or output space */
+    do {
+        if (bits < 15) {
+            hold += (unsigned long)(PUP(in)) << bits;
+            bits += 8;
+            hold += (unsigned long)(PUP(in)) << bits;
+            bits += 8;
+        }
+        this = lcode[hold & lmask];
+      dolen:
+        op = (unsigned)(this.bits);
+        hold >>= op;
+        bits -= op;
+        op = (unsigned)(this.op);
+        if (op == 0) {                          /* literal */
+            Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ?
+                    "inflate:         literal '%c'\n" :
+                    "inflate:         literal 0x%02x\n", this.val));
+            PUP(out) = (unsigned char)(this.val);
+        }
+        else if (op & 16) {                     /* length base */
+            len = (unsigned)(this.val);
+            op &= 15;                           /* number of extra bits */
+            if (op) {
+                if (bits < op) {
+                    hold += (unsigned long)(PUP(in)) << bits;
+                    bits += 8;
+                }
+                len += (unsigned)hold & ((1U << op) - 1);
+                hold >>= op;
+                bits -= op;
+            }
+            Tracevv((stderr, "inflate:         length %u\n", len));
+            if (bits < 15) {
+                hold += (unsigned long)(PUP(in)) << bits;
+                bits += 8;
+                hold += (unsigned long)(PUP(in)) << bits;
+                bits += 8;
+            }
+            this = dcode[hold & dmask];
+          dodist:
+            op = (unsigned)(this.bits);
+            hold >>= op;
+            bits -= op;
+            op = (unsigned)(this.op);
+            if (op & 16) {                      /* distance base */
+                dist = (unsigned)(this.val);
+                op &= 15;                       /* number of extra bits */
+                if (bits < op) {
+                    hold += (unsigned long)(PUP(in)) << bits;
+                    bits += 8;
+                    if (bits < op) {
+                        hold += (unsigned long)(PUP(in)) << bits;
+                        bits += 8;
+                    }
+                }
+                dist += (unsigned)hold & ((1U << op) - 1);
+#ifdef INFLATE_STRICT
+                if (dist > dmax) {
+                    strm->msg = (char *)"invalid distance too far back";
+                    state->mode = BAD;
+                    break;
+                }
+#endif
+                hold >>= op;
+                bits -= op;
+                Tracevv((stderr, "inflate:         distance %u\n", dist));
+                op = (unsigned)(out - beg);     /* max distance in output */
+                if (dist > op) {                /* see if copy from window */
+                    op = dist - op;             /* distance back in window */
+                    if (op > whave) {
+                        strm->msg = (char *)"invalid distance too far back";
+                        state->mode = BAD;
+                        break;
+                    }
+                    from = window - OFF;
+                    if (write == 0) {           /* very common case */
+                        from += wsize - op;
+                        if (op < len) {         /* some from window */
+                            len -= op;
+                            do {
+                                PUP(out) = PUP(from);
+                            } while (--op);
+                            from = out - dist;  /* rest from output */
+                        }
+                    }
+                    else if (write < op) {      /* wrap around window */
+                        from += wsize + write - op;
+                        op -= write;
+                        if (op < len) {         /* some from end of window */
+                            len -= op;
+                            do {
+                                PUP(out) = PUP(from);
+                            } while (--op);
+                            from = window - OFF;
+                            if (write < len) {  /* some from start of window */
+                                op = write;
+                                len -= op;
+                                do {
+                                    PUP(out) = PUP(from);
+                                } while (--op);
+                                from = out - dist;      /* rest from output */
+                            }
+                        }
+                    }
+                    else {                      /* contiguous in window */
+                        from += write - op;
+                        if (op < len) {         /* some from window */
+                            len -= op;
+                            do {
+                                PUP(out) = PUP(from);
+                            } while (--op);
+                            from = out - dist;  /* rest from output */
+                        }
+                    }
+                    while (len > 2) {
+                        PUP(out) = PUP(from);
+                        PUP(out) = PUP(from);
+                        PUP(out) = PUP(from);
+                        len -= 3;
+                    }
+                    if (len) {
+                        PUP(out) = PUP(from);
+                        if (len > 1)
+                            PUP(out) = PUP(from);
+                    }
+                }
+                else {
+                    from = out - dist;          /* copy direct from output */
+                    do {                        /* minimum length is three */
+                        PUP(out) = PUP(from);
+                        PUP(out) = PUP(from);
+                        PUP(out) = PUP(from);
+                        len -= 3;
+                    } while (len > 2);
+                    if (len) {
+                        PUP(out) = PUP(from);
+                        if (len > 1)
+                            PUP(out) = PUP(from);
+                    }
+                }
+            }
+            else if ((op & 64) == 0) {          /* 2nd level distance code */
+                this = dcode[this.val + (hold & ((1U << op) - 1))];
+                goto dodist;
+            }
+            else {
+                strm->msg = (char *)"invalid distance code";
+                state->mode = BAD;
+                break;
+            }
+        }
+        else if ((op & 64) == 0) {              /* 2nd level length code */
+            this = lcode[this.val + (hold & ((1U << op) - 1))];
+            goto dolen;
+        }
+        else if (op & 32) {                     /* end-of-block */
+            Tracevv((stderr, "inflate:         end of block\n"));
+            state->mode = TYPE;
+            break;
+        }
+        else {
+            strm->msg = (char *)"invalid literal/length code";
+            state->mode = BAD;
+            break;
+        }
+    } while (in < last && out < end);
+
+    /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
+    len = bits >> 3;
+    in -= len;
+    bits -= len << 3;
+    hold &= (1U << bits) - 1;
+
+    /* update state and return */
+    strm->next_in = in + OFF;
+    strm->next_out = out + OFF;
+    strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last));
+    strm->avail_out = (unsigned)(out < end ?
+                                 257 + (end - out) : 257 - (out - end));
+    state->hold = hold;
+    state->bits = bits;
+    return;
+}
+
+/*
+   inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe):
+   - Using bit fields for code structure
+   - Different op definition to avoid & for extra bits (do & for table bits)
+   - Three separate decoding do-loops for direct, window, and write == 0
+   - Special case for distance > 1 copies to do overlapped load and store copy
+   - Explicit branch predictions (based on measured branch probabilities)
+   - Deferring match copy and interspersed it with decoding subsequent codes
+   - Swapping literal/length else
+   - Swapping window/direct else
+   - Larger unrolled copy loops (three is about right)
+   - Moving len -= 3 statement into middle of loop
+ */
+
+#endif /* !ASMINF */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/zlib/inffast.h	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,11 @@
+/* inffast.h -- header to use inffast.c
+ * Copyright (C) 1995-2003 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+   part of the implementation of the compression library and is
+   subject to change. Applications should only use zlib.h.
+ */
+
+void inflate_fast OF((z_streamp strm, unsigned start));
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/zlib/inffixed.h	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,94 @@
+    /* inffixed.h -- table for decoding fixed codes
+     * Generated automatically by makefixed().
+     */
+
+    /* WARNING: this file should *not* be used by applications. It
+       is part of the implementation of the compression library and
+       is subject to change. Applications should only use zlib.h.
+     */
+
+    static const code lenfix[512] = {
+        {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48},
+        {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128},
+        {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59},
+        {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176},
+        {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20},
+        {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100},
+        {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8},
+        {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216},
+        {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76},
+        {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114},
+        {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2},
+        {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148},
+        {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42},
+        {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86},
+        {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15},
+        {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236},
+        {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62},
+        {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142},
+        {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31},
+        {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162},
+        {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25},
+        {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105},
+        {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4},
+        {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202},
+        {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69},
+        {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125},
+        {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13},
+        {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195},
+        {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35},
+        {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91},
+        {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19},
+        {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246},
+        {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55},
+        {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135},
+        {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99},
+        {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190},
+        {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16},
+        {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96},
+        {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6},
+        {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209},
+        {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72},
+        {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116},
+        {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4},
+        {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153},
+        {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44},
+        {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82},
+        {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11},
+        {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229},
+        {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58},
+        {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138},
+        {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51},
+        {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173},
+        {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30},
+        {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110},
+        {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0},
+        {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195},
+        {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65},
+        {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121},
+        {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9},
+        {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258},
+        {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37},
+        {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93},
+        {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23},
+        {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251},
+        {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51},
+        {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131},
+        {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67},
+        {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183},
+        {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23},
+        {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103},
+        {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9},
+        {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223},
+        {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79},
+        {0,9,255}
+    };
+
+    static const code distfix[32] = {
+        {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025},
+        {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193},
+        {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385},
+        {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577},
+        {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073},
+        {22,5,193},{64,5,0}
+    };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/zlib/inflate.c	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,1368 @@
+/* inflate.c -- zlib decompression
+ * Copyright (C) 1995-2005 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/*
+ * Change history:
+ *
+ * 1.2.beta0    24 Nov 2002
+ * - First version -- complete rewrite of inflate to simplify code, avoid
+ *   creation of window when not needed, minimize use of window when it is
+ *   needed, make inffast.c even faster, implement gzip decoding, and to
+ *   improve code readability and style over the previous zlib inflate code
+ *
+ * 1.2.beta1    25 Nov 2002
+ * - Use pointers for available input and output checking in inffast.c
+ * - Remove input and output counters in inffast.c
+ * - Change inffast.c entry and loop from avail_in >= 7 to >= 6
+ * - Remove unnecessary second byte pull from length extra in inffast.c
+ * - Unroll direct copy to three copies per loop in inffast.c
+ *
+ * 1.2.beta2    4 Dec 2002
+ * - Change external routine names to reduce potential conflicts
+ * - Correct filename to inffixed.h for fixed tables in inflate.c
+ * - Make hbuf[] unsigned char to match parameter type in inflate.c
+ * - Change strm->next_out[-state->offset] to *(strm->next_out - state->offset)
+ *   to avoid negation problem on Alphas (64 bit) in inflate.c
+ *
+ * 1.2.beta3    22 Dec 2002
+ * - Add comments on state->bits assertion in inffast.c
+ * - Add comments on op field in inftrees.h
+ * - Fix bug in reuse of allocated window after inflateReset()
+ * - Remove bit fields--back to byte structure for speed
+ * - Remove distance extra == 0 check in inflate_fast()--only helps for lengths
+ * - Change post-increments to pre-increments in inflate_fast(), PPC biased?
+ * - Add compile time option, POSTINC, to use post-increments instead (Intel?)
+ * - Make MATCH copy in inflate() much faster for when inflate_fast() not used
+ * - Use local copies of stream next and avail values, as well as local bit
+ *   buffer and bit count in inflate()--for speed when inflate_fast() not used
+ *
+ * 1.2.beta4    1 Jan 2003
+ * - Split ptr - 257 statements in inflate_table() to avoid compiler warnings
+ * - Move a comment on output buffer sizes from inffast.c to inflate.c
+ * - Add comments in inffast.c to introduce the inflate_fast() routine
+ * - Rearrange window copies in inflate_fast() for speed and simplification
+ * - Unroll last copy for window match in inflate_fast()
+ * - Use local copies of window variables in inflate_fast() for speed
+ * - Pull out common write == 0 case for speed in inflate_fast()
+ * - Make op and len in inflate_fast() unsigned for consistency
+ * - Add FAR to lcode and dcode declarations in inflate_fast()
+ * - Simplified bad distance check in inflate_fast()
+ * - Added inflateBackInit(), inflateBack(), and inflateBackEnd() in new
+ *   source file infback.c to provide a call-back interface to inflate for
+ *   programs like gzip and unzip -- uses window as output buffer to avoid
+ *   window copying
+ *
+ * 1.2.beta5    1 Jan 2003
+ * - Improved inflateBack() interface to allow the caller to provide initial
+ *   input in strm.
+ * - Fixed stored blocks bug in inflateBack()
+ *
+ * 1.2.beta6    4 Jan 2003
+ * - Added comments in inffast.c on effectiveness of POSTINC
+ * - Typecasting all around to reduce compiler warnings
+ * - Changed loops from while (1) or do {} while (1) to for (;;), again to
+ *   make compilers happy
+ * - Changed type of window in inflateBackInit() to unsigned char *
+ *
+ * 1.2.beta7    27 Jan 2003
+ * - Changed many types to unsigned or unsigned short to avoid warnings
+ * - Added inflateCopy() function
+ *
+ * 1.2.0        9 Mar 2003
+ * - Changed inflateBack() interface to provide separate opaque descriptors
+ *   for the in() and out() functions
+ * - Changed inflateBack() argument and in_func typedef to swap the length
+ *   and buffer address return values for the input function
+ * - Check next_in and next_out for Z_NULL on entry to inflate()
+ *
+ * The history for versions after 1.2.0 are in ChangeLog in zlib distribution.
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+#include "inflate.h"
+#include "inffast.h"
+
+#ifdef MAKEFIXED
+#  ifndef BUILDFIXED
+#    define BUILDFIXED
+#  endif
+#endif
+
+/* function prototypes */
+local void fixedtables OF((struct inflate_state FAR *state));
+local int updatewindow OF((z_streamp strm, unsigned out));
+#ifdef BUILDFIXED
+   void makefixed OF((void));
+#endif
+local unsigned syncsearch OF((unsigned FAR *have, unsigned char FAR *buf,
+                              unsigned len));
+
+int ZEXPORT inflateReset(strm)
+z_streamp strm;
+{
+    struct inflate_state FAR *state;
+
+    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    strm->total_in = strm->total_out = state->total = 0;
+    strm->msg = Z_NULL;
+    strm->adler = 1;        /* to support ill-conceived Java test suite */
+    state->mode = HEAD;
+    state->last = 0;
+    state->havedict = 0;
+    state->dmax = 32768U;
+    state->head = Z_NULL;
+    state->wsize = 0;
+    state->whave = 0;
+    state->write = 0;
+    state->hold = 0;
+    state->bits = 0;
+    state->lencode = state->distcode = state->next = state->codes;
+    Tracev((stderr, "inflate: reset\n"));
+    return Z_OK;
+}
+
+int ZEXPORT inflatePrime(strm, bits, value)
+z_streamp strm;
+int bits;
+int value;
+{
+    struct inflate_state FAR *state;
+
+    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR;
+    value &= (1L << bits) - 1;
+    state->hold += value << state->bits;
+    state->bits += bits;
+    return Z_OK;
+}
+
+int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size)
+z_streamp strm;
+int windowBits;
+const char *version;
+int stream_size;
+{
+    struct inflate_state FAR *state;
+
+    if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
+        stream_size != (int)(sizeof(z_stream)))
+        return Z_VERSION_ERROR;
+    if (strm == Z_NULL) return Z_STREAM_ERROR;
+    strm->msg = Z_NULL;                 /* in case we return an error */
+    if (strm->zalloc == (alloc_func)0) {
+        strm->zalloc = zcalloc;
+        strm->opaque = (voidpf)0;
+    }
+    if (strm->zfree == (free_func)0) strm->zfree = zcfree;
+    state = (struct inflate_state FAR *)
+            ZALLOC(strm, 1, sizeof(struct inflate_state));
+    if (state == Z_NULL) return Z_MEM_ERROR;
+    Tracev((stderr, "inflate: allocated\n"));
+    strm->state = (struct internal_state FAR *)state;
+    if (windowBits < 0) {
+        state->wrap = 0;
+        windowBits = -windowBits;
+    }
+    else {
+        state->wrap = (windowBits >> 4) + 1;
+#ifdef GUNZIP
+        if (windowBits < 48) windowBits &= 15;
+#endif
+    }
+    if (windowBits < 8 || windowBits > 15) {
+        ZFREE(strm, state);
+        strm->state = Z_NULL;
+        return Z_STREAM_ERROR;
+    }
+    state->wbits = (unsigned)windowBits;
+    state->window = Z_NULL;
+    return inflateReset(strm);
+}
+
+int ZEXPORT inflateInit_(strm, version, stream_size)
+z_streamp strm;
+const char *version;
+int stream_size;
+{
+    return inflateInit2_(strm, DEF_WBITS, version, stream_size);
+}
+
+/*
+   Return state with length and distance decoding tables and index sizes set to
+   fixed code decoding.  Normally this returns fixed tables from inffixed.h.
+   If BUILDFIXED is defined, then instead this routine builds the tables the
+   first time it's called, and returns those tables the first time and
+   thereafter.  This reduces the size of the code by about 2K bytes, in
+   exchange for a little execution time.  However, BUILDFIXED should not be
+   used for threaded applications, since the rewriting of the tables and virgin
+   may not be thread-safe.
+ */
+local void fixedtables(state)
+struct inflate_state FAR *state;
+{
+#ifdef BUILDFIXED
+    static int virgin = 1;
+    static code *lenfix, *distfix;
+    static code fixed[544];
+
+    /* build fixed huffman tables if first call (may not be thread safe) */
+    if (virgin) {
+        unsigned sym, bits;
+        static code *next;
+
+        /* literal/length table */
+        sym = 0;
+        while (sym < 144) state->lens[sym++] = 8;
+        while (sym < 256) state->lens[sym++] = 9;
+        while (sym < 280) state->lens[sym++] = 7;
+        while (sym < 288) state->lens[sym++] = 8;
+        next = fixed;
+        lenfix = next;
+        bits = 9;
+        inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
+
+        /* distance table */
+        sym = 0;
+        while (sym < 32) state->lens[sym++] = 5;
+        distfix = next;
+        bits = 5;
+        inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
+
+        /* do this just once */
+        virgin = 0;
+    }
+#else /* !BUILDFIXED */
+#   include "inffixed.h"
+#endif /* BUILDFIXED */
+    state->lencode = lenfix;
+    state->lenbits = 9;
+    state->distcode = distfix;
+    state->distbits = 5;
+}
+
+#ifdef MAKEFIXED
+#include <stdio.h>
+
+/*
+   Write out the inffixed.h that is #include'd above.  Defining MAKEFIXED also
+   defines BUILDFIXED, so the tables are built on the fly.  makefixed() writes
+   those tables to stdout, which would be piped to inffixed.h.  A small program
+   can simply call makefixed to do this:
+
+    void makefixed(void);
+
+    int main(void)
+    {
+        makefixed();
+        return 0;
+    }
+
+   Then that can be linked with zlib built with MAKEFIXED defined and run:
+
+    a.out > inffixed.h
+ */
+void makefixed()
+{
+    unsigned low, size;
+    struct inflate_state state;
+
+    fixedtables(&state);
+    puts("    /* inffixed.h -- table for decoding fixed codes");
+    puts("     * Generated automatically by makefixed().");
+    puts("     */");
+    puts("");
+    puts("    /* WARNING: this file should *not* be used by applications.");
+    puts("       It is part of the implementation of this library and is");
+    puts("       subject to change. Applications should only use zlib.h.");
+    puts("     */");
+    puts("");
+    size = 1U << 9;
+    printf("    static const code lenfix[%u] = {", size);
+    low = 0;
+    for (;;) {
+        if ((low % 7) == 0) printf("\n        ");
+        printf("{%u,%u,%d}", state.lencode[low].op, state.lencode[low].bits,
+               state.lencode[low].val);
+        if (++low == size) break;
+        putchar(',');
+    }
+    puts("\n    };");
+    size = 1U << 5;
+    printf("\n    static const code distfix[%u] = {", size);
+    low = 0;
+    for (;;) {
+        if ((low % 6) == 0) printf("\n        ");
+        printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits,
+               state.distcode[low].val);
+        if (++low == size) break;
+        putchar(',');
+    }
+    puts("\n    };");
+}
+#endif /* MAKEFIXED */
+
+/*
+   Update the window with the last wsize (normally 32K) bytes written before
+   returning.  If window does not exist yet, create it.  This is only called
+   when a window is already in use, or when output has been written during this
+   inflate call, but the end of the deflate stream has not been reached yet.
+   It is also called to create a window for dictionary data when a dictionary
+   is loaded.
+
+   Providing output buffers larger than 32K to inflate() should provide a speed
+   advantage, since only the last 32K of output is copied to the sliding window
+   upon return from inflate(), and since all distances after the first 32K of
+   output will fall in the output data, making match copies simpler and faster.
+   The advantage may be dependent on the size of the processor's data caches.
+ */
+local int updatewindow(strm, out)
+z_streamp strm;
+unsigned out;
+{
+    struct inflate_state FAR *state;
+    unsigned copy, dist;
+
+    state = (struct inflate_state FAR *)strm->state;
+
+    /* if it hasn't been done already, allocate space for the window */
+    if (state->window == Z_NULL) {
+        state->window = (unsigned char FAR *)
+                        ZALLOC(strm, 1U << state->wbits,
+                               sizeof(unsigned char));
+        if (state->window == Z_NULL) return 1;
+    }
+
+    /* if window not in use yet, initialize */
+    if (state->wsize == 0) {
+        state->wsize = 1U << state->wbits;
+        state->write = 0;
+        state->whave = 0;
+    }
+
+    /* copy state->wsize or less output bytes into the circular window */
+    copy = out - strm->avail_out;
+    if (copy >= state->wsize) {
+        zmemcpy(state->window, strm->next_out - state->wsize, state->wsize);
+        state->write = 0;
+        state->whave = state->wsize;
+    }
+    else {
+        dist = state->wsize - state->write;
+        if (dist > copy) dist = copy;
+        zmemcpy(state->window + state->write, strm->next_out - copy, dist);
+        copy -= dist;
+        if (copy) {
+            zmemcpy(state->window, strm->next_out - copy, copy);
+            state->write = copy;
+            state->whave = state->wsize;
+        }
+        else {
+            state->write += dist;
+            if (state->write == state->wsize) state->write = 0;
+            if (state->whave < state->wsize) state->whave += dist;
+        }
+    }
+    return 0;
+}
+
+/* Macros for inflate(): */
+
+/* check function to use adler32() for zlib or crc32() for gzip */
+#ifdef GUNZIP
+#  define UPDATE(check, buf, len) \
+    (state->flags ? crc32(check, buf, len) : adler32(check, buf, len))
+#else
+#  define UPDATE(check, buf, len) adler32(check, buf, len)
+#endif
+
+/* check macros for header crc */
+#ifdef GUNZIP
+#  define CRC2(check, word) \
+    do { \
+        hbuf[0] = (unsigned char)(word); \
+        hbuf[1] = (unsigned char)((word) >> 8); \
+        check = crc32(check, hbuf, 2); \
+    } while (0)
+
+#  define CRC4(check, word) \
+    do { \
+        hbuf[0] = (unsigned char)(word); \
+        hbuf[1] = (unsigned char)((word) >> 8); \
+        hbuf[2] = (unsigned char)((word) >> 16); \
+        hbuf[3] = (unsigned char)((word) >> 24); \
+        check = crc32(check, hbuf, 4); \
+    } while (0)
+#endif
+
+/* Load registers with state in inflate() for speed */
+#define LOAD() \
+    do { \
+        put = strm->next_out; \
+        left = strm->avail_out; \
+        next = strm->next_in; \
+        have = strm->avail_in; \
+        hold = state->hold; \
+        bits = state->bits; \
+    } while (0)
+
+/* Restore state from registers in inflate() */
+#define RESTORE() \
+    do { \
+        strm->next_out = put; \
+        strm->avail_out = left; \
+        strm->next_in = next; \
+        strm->avail_in = have; \
+        state->hold = hold; \
+        state->bits = bits; \
+    } while (0)
+
+/* Clear the input bit accumulator */
+#define INITBITS() \
+    do { \
+        hold = 0; \
+        bits = 0; \
+    } while (0)
+
+/* Get a byte of input into the bit accumulator, or return from inflate()
+   if there is no input available. */
+#define PULLBYTE() \
+    do { \
+        if (have == 0) goto inf_leave; \
+        have--; \
+        hold += (unsigned long)(*next++) << bits; \
+        bits += 8; \
+    } while (0)
+
+/* Assure that there are at least n bits in the bit accumulator.  If there is
+   not enough available input to do that, then return from inflate(). */
+#define NEEDBITS(n) \
+    do { \
+        while (bits < (unsigned)(n)) \
+            PULLBYTE(); \
+    } while (0)
+
+/* Return the low n bits of the bit accumulator (n < 16) */
+#define BITS(n) \
+    ((unsigned)hold & ((1U << (n)) - 1))
+
+/* Remove n bits from the bit accumulator */
+#define DROPBITS(n) \
+    do { \
+        hold >>= (n); \
+        bits -= (unsigned)(n); \
+    } while (0)
+
+/* Remove zero to seven bits as needed to go to a byte boundary */
+#define BYTEBITS() \
+    do { \
+        hold >>= bits & 7; \
+        bits -= bits & 7; \
+    } while (0)
+
+/* Reverse the bytes in a 32-bit value */
+#define REVERSE(q) \
+    ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
+     (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
+
+/*
+   inflate() uses a state machine to process as much input data and generate as
+   much output data as possible before returning.  The state machine is
+   structured roughly as follows:
+
+    for (;;) switch (state) {
+    ...
+    case STATEn:
+        if (not enough input data or output space to make progress)
+            return;
+        ... make progress ...
+        state = STATEm;
+        break;
+    ...
+    }
+
+   so when inflate() is called again, the same case is attempted again, and
+   if the appropriate resources are provided, the machine proceeds to the
+   next state.  The NEEDBITS() macro is usually the way the state evaluates
+   whether it can proceed or should return.  NEEDBITS() does the return if
+   the requested bits are not available.  The typical use of the BITS macros
+   is:
+
+        NEEDBITS(n);
+        ... do something with BITS(n) ...
+        DROPBITS(n);
+
+   where NEEDBITS(n) either returns from inflate() if there isn't enough
+   input left to load n bits into the accumulator, or it continues.  BITS(n)
+   gives the low n bits in the accumulator.  When done, DROPBITS(n) drops
+   the low n bits off the accumulator.  INITBITS() clears the accumulator
+   and sets the number of available bits to zero.  BYTEBITS() discards just
+   enough bits to put the accumulator on a byte boundary.  After BYTEBITS()
+   and a NEEDBITS(8), then BITS(8) would return the next byte in the stream.
+
+   NEEDBITS(n) uses PULLBYTE() to get an available byte of input, or to return
+   if there is no input available.  The decoding of variable length codes uses
+   PULLBYTE() directly in order to pull just enough bytes to decode the next
+   code, and no more.
+
+   Some states loop until they get enough input, making sure that enough
+   state information is maintained to continue the loop where it left off
+   if NEEDBITS() returns in the loop.  For example, want, need, and keep
+   would all have to actually be part of the saved state in case NEEDBITS()
+   returns:
+
+    case STATEw:
+        while (want < need) {
+            NEEDBITS(n);
+            keep[want++] = BITS(n);
+            DROPBITS(n);
+        }
+        state = STATEx;
+    case STATEx:
+
+   As shown above, if the next state is also the next case, then the break
+   is omitted.
+
+   A state may also return if there is not enough output space available to
+   complete that state.  Those states are copying stored data, writing a
+   literal byte, and copying a matching string.
+
+   When returning, a "goto inf_leave" is used to update the total counters,
+   update the check value, and determine whether any progress has been made
+   during that inflate() call in order to return the proper return code.
+   Progress is defined as a change in either strm->avail_in or strm->avail_out.
+   When there is a window, goto inf_leave will update the window with the last
+   output written.  If a goto inf_leave occurs in the middle of decompression
+   and there is no window currently, goto inf_leave will create one and copy
+   output to the window for the next call of inflate().
+
+   In this implementation, the flush parameter of inflate() only affects the
+   return code (per zlib.h).  inflate() always writes as much as possible to
+   strm->next_out, given the space available and the provided input--the effect
+   documented in zlib.h of Z_SYNC_FLUSH.  Furthermore, inflate() always defers
+   the allocation of and copying into a sliding window until necessary, which
+   provides the effect documented in zlib.h for Z_FINISH when the entire input
+   stream available.  So the only thing the flush parameter actually does is:
+   when flush is set to Z_FINISH, inflate() cannot return Z_OK.  Instead it
+   will return Z_BUF_ERROR if it has not reached the end of the stream.
+ */
+
+int ZEXPORT inflate(strm, flush)
+z_streamp strm;
+int flush;
+{
+    struct inflate_state FAR *state;
+    unsigned char FAR *next;    /* next input */
+    unsigned char FAR *put;     /* next output */
+    unsigned have, left;        /* available input and output */
+    unsigned long hold;         /* bit buffer */
+    unsigned bits;              /* bits in bit buffer */
+    unsigned in, out;           /* save starting available input and output */
+    unsigned copy;              /* number of stored or match bytes to copy */
+    unsigned char FAR *from;    /* where to copy match bytes from */
+    code this;                  /* current decoding table entry */
+    code last;                  /* parent table entry */
+    unsigned len;               /* length to copy for repeats, bits to drop */
+    int ret;                    /* return code */
+#ifdef GUNZIP
+    unsigned char hbuf[4];      /* buffer for gzip header crc calculation */
+#endif
+    static const unsigned short order[19] = /* permutation of code lengths */
+        {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
+
+    if (strm == Z_NULL || strm->state == Z_NULL || strm->next_out == Z_NULL ||
+        (strm->next_in == Z_NULL && strm->avail_in != 0))
+        return Z_STREAM_ERROR;
+
+    state = (struct inflate_state FAR *)strm->state;
+    if (state->mode == TYPE) state->mode = TYPEDO;      /* skip check */
+    LOAD();
+    in = have;
+    out = left;
+    ret = Z_OK;
+    for (;;)
+        switch (state->mode) {
+        case HEAD:
+            if (state->wrap == 0) {
+                state->mode = TYPEDO;
+                break;
+            }
+            NEEDBITS(16);
+#ifdef GUNZIP
+            if ((state->wrap & 2) && hold == 0x8b1f) {  /* gzip header */
+                state->check = crc32(0L, Z_NULL, 0);
+                CRC2(state->check, hold);
+                INITBITS();
+                state->mode = FLAGS;
+                break;
+            }
+            state->flags = 0;           /* expect zlib header */
+            if (state->head != Z_NULL)
+                state->head->done = -1;
+            if (!(state->wrap & 1) ||   /* check if zlib header allowed */
+#else
+            if (
+#endif
+                ((BITS(8) << 8) + (hold >> 8)) % 31) {
+                strm->msg = (char *)"incorrect header check";
+                state->mode = BAD;
+                break;
+            }
+            if (BITS(4) != Z_DEFLATED) {
+                strm->msg = (char *)"unknown compression method";
+                state->mode = BAD;
+                break;
+            }
+            DROPBITS(4);
+            len = BITS(4) + 8;
+            if (len > state->wbits) {
+                strm->msg = (char *)"invalid window size";
+                state->mode = BAD;
+                break;
+            }
+            state->dmax = 1U << len;
+            Tracev((stderr, "inflate:   zlib header ok\n"));
+            strm->adler = state->check = adler32(0L, Z_NULL, 0);
+            state->mode = hold & 0x200 ? DICTID : TYPE;
+            INITBITS();
+            break;
+#ifdef GUNZIP
+        case FLAGS:
+            NEEDBITS(16);
+            state->flags = (int)(hold);
+            if ((state->flags & 0xff) != Z_DEFLATED) {
+                strm->msg = (char *)"unknown compression method";
+                state->mode = BAD;
+                break;
+            }
+            if (state->flags & 0xe000) {
+                strm->msg = (char *)"unknown header flags set";
+                state->mode = BAD;
+                break;
+            }
+            if (state->head != Z_NULL)
+                state->head->text = (int)((hold >> 8) & 1);
+            if (state->flags & 0x0200) CRC2(state->check, hold);
+            INITBITS();
+            state->mode = TIME;
+        case TIME:
+            NEEDBITS(32);
+            if (state->head != Z_NULL)
+                state->head->time = hold;
+            if (state->flags & 0x0200) CRC4(state->check, hold);
+            INITBITS();
+            state->mode = OS;
+        case OS:
+            NEEDBITS(16);
+            if (state->head != Z_NULL) {
+                state->head->xflags = (int)(hold & 0xff);
+                state->head->os = (int)(hold >> 8);
+            }
+            if (state->flags & 0x0200) CRC2(state->check, hold);
+            INITBITS();
+            state->mode = EXLEN;
+        case EXLEN:
+            if (state->flags & 0x0400) {
+                NEEDBITS(16);
+                state->length = (unsigned)(hold);
+                if (state->head != Z_NULL)
+                    state->head->extra_len = (unsigned)hold;
+                if (state->flags & 0x0200) CRC2(state->check, hold);
+                INITBITS();
+            }
+            else if (state->head != Z_NULL)
+                state->head->extra = Z_NULL;
+            state->mode = EXTRA;
+        case EXTRA:
+            if (state->flags & 0x0400) {
+                copy = state->length;
+                if (copy > have) copy = have;
+                if (copy) {
+                    if (state->head != Z_NULL &&
+                        state->head->extra != Z_NULL) {
+                        len = state->head->extra_len - state->length;
+                        zmemcpy(state->head->extra + len, next,
+                                len + copy > state->head->extra_max ?
+                                state->head->extra_max - len : copy);
+                    }
+                    if (state->flags & 0x0200)
+                        state->check = crc32(state->check, next, copy);
+                    have -= copy;
+                    next += copy;
+                    state->length -= copy;
+                }
+                if (state->length) goto inf_leave;
+            }
+            state->length = 0;
+            state->mode = NAME;
+        case NAME:
+            if (state->flags & 0x0800) {
+                if (have == 0) goto inf_leave;
+                copy = 0;
+                do {
+                    len = (unsigned)(next[copy++]);
+                    if (state->head != Z_NULL &&
+                            state->head->name != Z_NULL &&
+                            state->length < state->head->name_max)
+                        state->head->name[state->length++] = len;
+                } while (len && copy < have);
+                if (state->flags & 0x0200)
+                    state->check = crc32(state->check, next, copy);
+                have -= copy;
+                next += copy;
+                if (len) goto inf_leave;
+            }
+            else if (state->head != Z_NULL)
+                state->head->name = Z_NULL;
+            state->length = 0;
+            state->mode = COMMENT;
+        case COMMENT:
+            if (state->flags & 0x1000) {
+                if (have == 0) goto inf_leave;
+                copy = 0;
+                do {
+                    len = (unsigned)(next[copy++]);
+                    if (state->head != Z_NULL &&
+                            state->head->comment != Z_NULL &&
+                            state->length < state->head->comm_max)
+                        state->head->comment[state->length++] = len;
+                } while (len && copy < have);
+                if (state->flags & 0x0200)
+                    state->check = crc32(state->check, next, copy);
+                have -= copy;
+                next += copy;
+                if (len) goto inf_leave;
+            }
+            else if (state->head != Z_NULL)
+                state->head->comment = Z_NULL;
+            state->mode = HCRC;
+        case HCRC:
+            if (state->flags & 0x0200) {
+                NEEDBITS(16);
+                if (hold != (state->check & 0xffff)) {
+                    strm->msg = (char *)"header crc mismatch";
+                    state->mode = BAD;
+                    break;
+                }
+                INITBITS();
+            }
+            if (state->head != Z_NULL) {
+                state->head->hcrc = (int)((state->flags >> 9) & 1);
+                state->head->done = 1;
+            }
+            strm->adler = state->check = crc32(0L, Z_NULL, 0);
+            state->mode = TYPE;
+            break;
+#endif
+        case DICTID:
+            NEEDBITS(32);
+            strm->adler = state->check = REVERSE(hold);
+            INITBITS();
+            state->mode = DICT;
+        case DICT:
+            if (state->havedict == 0) {
+                RESTORE();
+                return Z_NEED_DICT;
+            }
+            strm->adler = state->check = adler32(0L, Z_NULL, 0);
+            state->mode = TYPE;
+        case TYPE:
+            if (flush == Z_BLOCK) goto inf_leave;
+        case TYPEDO:
+            if (state->last) {
+                BYTEBITS();
+                state->mode = CHECK;
+                break;
+            }
+            NEEDBITS(3);
+            state->last = BITS(1);
+            DROPBITS(1);
+            switch (BITS(2)) {
+            case 0:                             /* stored block */
+                Tracev((stderr, "inflate:     stored block%s\n",
+                        state->last ? " (last)" : ""));
+                state->mode = STORED;
+                break;
+            case 1:                             /* fixed block */
+                fixedtables(state);
+                Tracev((stderr, "inflate:     fixed codes block%s\n",
+                        state->last ? " (last)" : ""));
+                state->mode = LEN;              /* decode codes */
+                break;
+            case 2:                             /* dynamic block */
+                Tracev((stderr, "inflate:     dynamic codes block%s\n",
+                        state->last ? " (last)" : ""));
+                state->mode = TABLE;
+                break;
+            case 3:
+                strm->msg = (char *)"invalid block type";
+                state->mode = BAD;
+            }
+            DROPBITS(2);
+            break;
+        case STORED:
+            BYTEBITS();                         /* go to byte boundary */
+            NEEDBITS(32);
+            if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
+                strm->msg = (char *)"invalid stored block lengths";
+                state->mode = BAD;
+                break;
+            }
+            state->length = (unsigned)hold & 0xffff;
+            Tracev((stderr, "inflate:       stored length %u\n",
+                    state->length));
+            INITBITS();
+            state->mode = COPY;
+        case COPY:
+            copy = state->length;
+            if (copy) {
+                if (copy > have) copy = have;
+                if (copy > left) copy = left;
+                if (copy == 0) goto inf_leave;
+                zmemcpy(put, next, copy);
+                have -= copy;
+                next += copy;
+                left -= copy;
+                put += copy;
+                state->length -= copy;
+                break;
+            }
+            Tracev((stderr, "inflate:       stored end\n"));
+            state->mode = TYPE;
+            break;
+        case TABLE:
+            NEEDBITS(14);
+            state->nlen = BITS(5) + 257;
+            DROPBITS(5);
+            state->ndist = BITS(5) + 1;
+            DROPBITS(5);
+            state->ncode = BITS(4) + 4;
+            DROPBITS(4);
+#ifndef PKZIP_BUG_WORKAROUND
+            if (state->nlen > 286 || state->ndist > 30) {
+                strm->msg = (char *)"too many length or distance symbols";
+                state->mode = BAD;
+                break;
+            }
+#endif
+            Tracev((stderr, "inflate:       table sizes ok\n"));
+            state->have = 0;
+            state->mode = LENLENS;
+        case LENLENS:
+            while (state->have < state->ncode) {
+                NEEDBITS(3);
+                state->lens[order[state->have++]] = (unsigned short)BITS(3);
+                DROPBITS(3);
+            }
+            while (state->have < 19)
+                state->lens[order[state->have++]] = 0;
+            state->next = state->codes;
+            state->lencode = (code const FAR *)(state->next);
+            state->lenbits = 7;
+            ret = inflate_table(CODES, state->lens, 19, &(state->next),
+                                &(state->lenbits), state->work);
+            if (ret) {
+                strm->msg = (char *)"invalid code lengths set";
+                state->mode = BAD;
+                break;
+            }
+            Tracev((stderr, "inflate:       code lengths ok\n"));
+            state->have = 0;
+            state->mode = CODELENS;
+        case CODELENS:
+            while (state->have < state->nlen + state->ndist) {
+                for (;;) {
+                    this = state->lencode[BITS(state->lenbits)];
+                    if ((unsigned)(this.bits) <= bits) break;
+                    PULLBYTE();
+                }
+                if (this.val < 16) {
+                    NEEDBITS(this.bits);
+                    DROPBITS(this.bits);
+                    state->lens[state->have++] = this.val;
+                }
+                else {
+                    if (this.val == 16) {
+                        NEEDBITS(this.bits + 2);
+                        DROPBITS(this.bits);
+                        if (state->have == 0) {
+                            strm->msg = (char *)"invalid bit length repeat";
+                            state->mode = BAD;
+                            break;
+                        }
+                        len = state->lens[state->have - 1];
+                        copy = 3 + BITS(2);
+                        DROPBITS(2);
+                    }
+                    else if (this.val == 17) {
+                        NEEDBITS(this.bits + 3);
+                        DROPBITS(this.bits);
+                        len = 0;
+                        copy = 3 + BITS(3);
+                        DROPBITS(3);
+                    }
+                    else {
+                        NEEDBITS(this.bits + 7);
+                        DROPBITS(this.bits);
+                        len = 0;
+                        copy = 11 + BITS(7);
+                        DROPBITS(7);
+                    }
+                    if (state->have + copy > state->nlen + state->ndist) {
+                        strm->msg = (char *)"invalid bit length repeat";
+                        state->mode = BAD;
+                        break;
+                    }
+                    while (copy--)
+                        state->lens[state->have++] = (unsigned short)len;
+                }
+            }
+
+            /* handle error breaks in while */
+            if (state->mode == BAD) break;
+
+            /* build code tables */
+            state->next = state->codes;
+            state->lencode = (code const FAR *)(state->next);
+            state->lenbits = 9;
+            ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
+                                &(state->lenbits), state->work);
+            if (ret) {
+                strm->msg = (char *)"invalid literal/lengths set";
+                state->mode = BAD;
+                break;
+            }
+            state->distcode = (code const FAR *)(state->next);
+            state->distbits = 6;
+            ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
+                            &(state->next), &(state->distbits), state->work);
+            if (ret) {
+                strm->msg = (char *)"invalid distances set";
+                state->mode = BAD;
+                break;
+            }
+            Tracev((stderr, "inflate:       codes ok\n"));
+            state->mode = LEN;
+        case LEN:
+            if (have >= 6 && left >= 258) {
+                RESTORE();
+                inflate_fast(strm, out);
+                LOAD();
+                break;
+            }
+            for (;;) {
+                this = state->lencode[BITS(state->lenbits)];
+                if ((unsigned)(this.bits) <= bits) break;
+                PULLBYTE();
+            }
+            if (this.op && (this.op & 0xf0) == 0) {
+                last = this;
+                for (;;) {
+                    this = state->lencode[last.val +
+                            (BITS(last.bits + last.op) >> last.bits)];
+                    if ((unsigned)(last.bits + this.bits) <= bits) break;
+                    PULLBYTE();
+                }
+                DROPBITS(last.bits);
+            }
+            DROPBITS(this.bits);
+            state->length = (unsigned)this.val;
+            if ((int)(this.op) == 0) {
+                Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ?
+                        "inflate:         literal '%c'\n" :
+                        "inflate:         literal 0x%02x\n", this.val));
+                state->mode = LIT;
+                break;
+            }
+            if (this.op & 32) {
+                Tracevv((stderr, "inflate:         end of block\n"));
+                state->mode = TYPE;
+                break;
+            }
+            if (this.op & 64) {
+                strm->msg = (char *)"invalid literal/length code";
+                state->mode = BAD;
+                break;
+            }
+            state->extra = (unsigned)(this.op) & 15;
+            state->mode = LENEXT;
+        case LENEXT:
+            if (state->extra) {
+                NEEDBITS(state->extra);
+                state->length += BITS(state->extra);
+                DROPBITS(state->extra);
+            }
+            Tracevv((stderr, "inflate:         length %u\n", state->length));
+            state->mode = DIST;
+        case DIST:
+            for (;;) {
+                this = state->distcode[BITS(state->distbits)];
+                if ((unsigned)(this.bits) <= bits) break;
+                PULLBYTE();
+            }
+            if ((this.op & 0xf0) == 0) {
+                last = this;
+                for (;;) {
+                    this = state->distcode[last.val +
+                            (BITS(last.bits + last.op) >> last.bits)];
+                    if ((unsigned)(last.bits + this.bits) <= bits) break;
+                    PULLBYTE();
+                }
+                DROPBITS(last.bits);
+            }
+            DROPBITS(this.bits);
+            if (this.op & 64) {
+                strm->msg = (char *)"invalid distance code";
+                state->mode = BAD;
+                break;
+            }
+            state->offset = (unsigned)this.val;
+            state->extra = (unsigned)(this.op) & 15;
+            state->mode = DISTEXT;
+        case DISTEXT:
+            if (state->extra) {
+                NEEDBITS(state->extra);
+                state->offset += BITS(state->extra);
+                DROPBITS(state->extra);
+            }
+#ifdef INFLATE_STRICT
+            if (state->offset > state->dmax) {
+                strm->msg = (char *)"invalid distance too far back";
+                state->mode = BAD;
+                break;
+            }
+#endif
+            if (state->offset > state->whave + out - left) {
+                strm->msg = (char *)"invalid distance too far back";
+                state->mode = BAD;
+                break;
+            }
+            Tracevv((stderr, "inflate:         distance %u\n", state->offset));
+            state->mode = MATCH;
+        case MATCH:
+            if (left == 0) goto inf_leave;
+            copy = out - left;
+            if (state->offset > copy) {         /* copy from window */
+                copy = state->offset - copy;
+                if (copy > state->write) {
+                    copy -= state->write;
+                    from = state->window + (state->wsize - copy);
+                }
+                else
+                    from = state->window + (state->write - copy);
+                if (copy > state->length) copy = state->length;
+            }
+            else {                              /* copy from output */
+                from = put - state->offset;
+                copy = state->length;
+            }
+            if (copy > left) copy = left;
+            left -= copy;
+            state->length -= copy;
+            do {
+                *put++ = *from++;
+            } while (--copy);
+            if (state->length == 0) state->mode = LEN;
+            break;
+        case LIT:
+            if (left == 0) goto inf_leave;
+            *put++ = (unsigned char)(state->length);
+            left--;
+            state->mode = LEN;
+            break;
+        case CHECK:
+            if (state->wrap) {
+                NEEDBITS(32);
+                out -= left;
+                strm->total_out += out;
+                state->total += out;
+                if (out)
+                    strm->adler = state->check =
+                        UPDATE(state->check, put - out, out);
+                out = left;
+                if ((
+#ifdef GUNZIP
+                     state->flags ? hold :
+#endif
+                     REVERSE(hold)) != state->check) {
+                    strm->msg = (char *)"incorrect data check";
+                    state->mode = BAD;
+                    break;
+                }
+                INITBITS();
+                Tracev((stderr, "inflate:   check matches trailer\n"));
+            }
+#ifdef GUNZIP
+            state->mode = LENGTH;
+        case LENGTH:
+            if (state->wrap && state->flags) {
+                NEEDBITS(32);
+                if (hold != (state->total & 0xffffffffUL)) {
+                    strm->msg = (char *)"incorrect length check";
+                    state->mode = BAD;
+                    break;
+                }
+                INITBITS();
+                Tracev((stderr, "inflate:   length matches trailer\n"));
+            }
+#endif
+            state->mode = DONE;
+        case DONE:
+            ret = Z_STREAM_END;
+            goto inf_leave;
+        case BAD:
+            ret = Z_DATA_ERROR;
+            goto inf_leave;
+        case MEM:
+            return Z_MEM_ERROR;
+        case SYNC:
+        default:
+            return Z_STREAM_ERROR;
+        }
+
+    /*
+       Return from inflate(), updating the total counts and the check value.
+       If there was no progress during the inflate() call, return a buffer
+       error.  Call updatewindow() to create and/or update the window state.
+       Note: a memory error from inflate() is non-recoverable.
+     */
+  inf_leave:
+    RESTORE();
+    if (state->wsize || (state->mode < CHECK && out != strm->avail_out))
+        if (updatewindow(strm, out)) {
+            state->mode = MEM;
+            return Z_MEM_ERROR;
+        }
+    in -= strm->avail_in;
+    out -= strm->avail_out;
+    strm->total_in += in;
+    strm->total_out += out;
+    state->total += out;
+    if (state->wrap && out)
+        strm->adler = state->check =
+            UPDATE(state->check, strm->next_out - out, out);
+    strm->data_type = state->bits + (state->last ? 64 : 0) +
+                      (state->mode == TYPE ? 128 : 0);
+    if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
+        ret = Z_BUF_ERROR;
+    return ret;
+}
+
+int ZEXPORT inflateEnd(strm)
+z_streamp strm;
+{
+    struct inflate_state FAR *state;
+    if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
+        return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    if (state->window != Z_NULL) ZFREE(strm, state->window);
+    ZFREE(strm, strm->state);
+    strm->state = Z_NULL;
+    Tracev((stderr, "inflate: end\n"));
+    return Z_OK;
+}
+
+int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength)
+z_streamp strm;
+const Bytef *dictionary;
+uInt dictLength;
+{
+    struct inflate_state FAR *state;
+    unsigned long id;
+
+    /* check state */
+    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    if (state->wrap != 0 && state->mode != DICT)
+        return Z_STREAM_ERROR;
+
+    /* check for correct dictionary id */
+    if (state->mode == DICT) {
+        id = adler32(0L, Z_NULL, 0);
+        id = adler32(id, dictionary, dictLength);
+        if (id != state->check)
+            return Z_DATA_ERROR;
+    }
+
+    /* copy dictionary to window */
+    if (updatewindow(strm, strm->avail_out)) {
+        state->mode = MEM;
+        return Z_MEM_ERROR;
+    }
+    if (dictLength > state->wsize) {
+        zmemcpy(state->window, dictionary + dictLength - state->wsize,
+                state->wsize);
+        state->whave = state->wsize;
+    }
+    else {
+        zmemcpy(state->window + state->wsize - dictLength, dictionary,
+                dictLength);
+        state->whave = dictLength;
+    }
+    state->havedict = 1;
+    Tracev((stderr, "inflate:   dictionary set\n"));
+    return Z_OK;
+}
+
+int ZEXPORT inflateGetHeader(strm, head)
+z_streamp strm;
+gz_headerp head;
+{
+    struct inflate_state FAR *state;
+
+    /* check state */
+    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    if ((state->wrap & 2) == 0) return Z_STREAM_ERROR;
+
+    /* save header structure */
+    state->head = head;
+    head->done = 0;
+    return Z_OK;
+}
+
+/*
+   Search buf[0..len-1] for the pattern: 0, 0, 0xff, 0xff.  Return when found
+   or when out of input.  When called, *have is the number of pattern bytes
+   found in order so far, in 0..3.  On return *have is updated to the new
+   state.  If on return *have equals four, then the pattern was found and the
+   return value is how many bytes were read including the last byte of the
+   pattern.  If *have is less than four, then the pattern has not been found
+   yet and the return value is len.  In the latter case, syncsearch() can be
+   called again with more data and the *have state.  *have is initialized to
+   zero for the first call.
+ */
+local unsigned syncsearch(have, buf, len)
+unsigned FAR *have;
+unsigned char FAR *buf;
+unsigned len;
+{
+    unsigned got;
+    unsigned next;
+
+    got = *have;
+    next = 0;
+    while (next < len && got < 4) {
+        if ((int)(buf[next]) == (got < 2 ? 0 : 0xff))
+            got++;
+        else if (buf[next])
+            got = 0;
+        else
+            got = 4 - got;
+        next++;
+    }
+    *have = got;
+    return next;
+}
+
+int ZEXPORT inflateSync(strm)
+z_streamp strm;
+{
+    unsigned len;               /* number of bytes to look at or looked at */
+    unsigned long in, out;      /* temporary to save total_in and total_out */
+    unsigned char buf[4];       /* to restore bit buffer to byte string */
+    struct inflate_state FAR *state;
+
+    /* check parameters */
+    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR;
+
+    /* if first time, start search in bit buffer */
+    if (state->mode != SYNC) {
+        state->mode = SYNC;
+        state->hold <<= state->bits & 7;
+        state->bits -= state->bits & 7;
+        len = 0;
+        while (state->bits >= 8) {
+            buf[len++] = (unsigned char)(state->hold);
+            state->hold >>= 8;
+            state->bits -= 8;
+        }
+        state->have = 0;
+        syncsearch(&(state->have), buf, len);
+    }
+
+    /* search available input */
+    len = syncsearch(&(state->have), strm->next_in, strm->avail_in);
+    strm->avail_in -= len;
+    strm->next_in += len;
+    strm->total_in += len;
+
+    /* return no joy or set up to restart inflate() on a new block */
+    if (state->have != 4) return Z_DATA_ERROR;
+    in = strm->total_in;  out = strm->total_out;
+    inflateReset(strm);
+    strm->total_in = in;  strm->total_out = out;
+    state->mode = TYPE;
+    return Z_OK;
+}
+
+/*
+   Returns true if inflate is currently at the end of a block generated by
+   Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP
+   implementation to provide an additional safety check. PPP uses
+   Z_SYNC_FLUSH but removes the length bytes of the resulting empty stored
+   block. When decompressing, PPP checks that at the end of input packet,
+   inflate is waiting for these length bytes.
+ */
+int ZEXPORT inflateSyncPoint(strm)
+z_streamp strm;
+{
+    struct inflate_state FAR *state;
+
+    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+    return state->mode == STORED && state->bits == 0;
+}
+
+int ZEXPORT inflateCopy(dest, source)
+z_streamp dest;
+z_streamp source;
+{
+    struct inflate_state FAR *state;
+    struct inflate_state FAR *copy;
+    unsigned char FAR *window;
+    unsigned wsize;
+
+    /* check input */
+    if (dest == Z_NULL || source == Z_NULL || source->state == Z_NULL ||
+        source->zalloc == (alloc_func)0 || source->zfree == (free_func)0)
+        return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)source->state;
+
+    /* allocate space */
+    copy = (struct inflate_state FAR *)
+           ZALLOC(source, 1, sizeof(struct inflate_state));
+    if (copy == Z_NULL) return Z_MEM_ERROR;
+    window = Z_NULL;
+    if (state->window != Z_NULL) {
+        window = (unsigned char FAR *)
+                 ZALLOC(source, 1U << state->wbits, sizeof(unsigned char));
+        if (window == Z_NULL) {
+            ZFREE(source, copy);
+            return Z_MEM_ERROR;
+        }
+    }
+
+    /* copy state */
+    zmemcpy(dest, source, sizeof(z_stream));
+    zmemcpy(copy, state, sizeof(struct inflate_state));
+    if (state->lencode >= state->codes &&
+        state->lencode <= state->codes + ENOUGH - 1) {
+        copy->lencode = copy->codes + (state->lencode - state->codes);
+        copy->distcode = copy->codes + (state->distcode - state->codes);
+    }
+    copy->next = copy->codes + (state->next - state->codes);
+    if (window != Z_NULL) {
+        wsize = 1U << state->wbits;
+        zmemcpy(window, state->window, wsize);
+    }
+    copy->window = window;
+    dest->state = (struct internal_state FAR *)copy;
+    return Z_OK;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/zlib/inflate.h	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,115 @@
+/* inflate.h -- internal inflate state definition
+ * Copyright (C) 1995-2004 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+   part of the implementation of the compression library and is
+   subject to change. Applications should only use zlib.h.
+ */
+
+/* define NO_GZIP when compiling if you want to disable gzip header and
+   trailer decoding by inflate().  NO_GZIP would be used to avoid linking in
+   the crc code when it is not needed.  For shared libraries, gzip decoding
+   should be left enabled. */
+#ifndef NO_GZIP
+#  define GUNZIP
+#endif
+
+/* Possible inflate modes between inflate() calls */
+typedef enum {
+    HEAD,       /* i: waiting for magic header */
+    FLAGS,      /* i: waiting for method and flags (gzip) */
+    TIME,       /* i: waiting for modification time (gzip) */
+    OS,         /* i: waiting for extra flags and operating system (gzip) */
+    EXLEN,      /* i: waiting for extra length (gzip) */
+    EXTRA,      /* i: waiting for extra bytes (gzip) */
+    NAME,       /* i: waiting for end of file name (gzip) */
+    COMMENT,    /* i: waiting for end of comment (gzip) */
+    HCRC,       /* i: waiting for header crc (gzip) */
+    DICTID,     /* i: waiting for dictionary check value */
+    DICT,       /* waiting for inflateSetDictionary() call */
+        TYPE,       /* i: waiting for type bits, including last-flag bit */
+        TYPEDO,     /* i: same, but skip check to exit inflate on new block */
+        STORED,     /* i: waiting for stored size (length and complement) */
+        COPY,       /* i/o: waiting for input or output to copy stored block */
+        TABLE,      /* i: waiting for dynamic block table lengths */
+        LENLENS,    /* i: waiting for code length code lengths */
+        CODELENS,   /* i: waiting for length/lit and distance code lengths */
+            LEN,        /* i: waiting for length/lit code */
+            LENEXT,     /* i: waiting for length extra bits */
+            DIST,       /* i: waiting for distance code */
+            DISTEXT,    /* i: waiting for distance extra bits */
+            MATCH,      /* o: waiting for output space to copy string */
+            LIT,        /* o: waiting for output space to write literal */
+    CHECK,      /* i: waiting for 32-bit check value */
+    LENGTH,     /* i: waiting for 32-bit length (gzip) */
+    DONE,       /* finished check, done -- remain here until reset */
+    BAD,        /* got a data error -- remain here until reset */
+    MEM,        /* got an inflate() memory error -- remain here until reset */
+    SYNC        /* looking for synchronization bytes to restart inflate() */
+} inflate_mode;
+
+/*
+    State transitions between above modes -
+
+    (most modes can go to the BAD or MEM mode -- not shown for clarity)
+
+    Process header:
+        HEAD -> (gzip) or (zlib)
+        (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME
+        NAME -> COMMENT -> HCRC -> TYPE
+        (zlib) -> DICTID or TYPE
+        DICTID -> DICT -> TYPE
+    Read deflate blocks:
+            TYPE -> STORED or TABLE or LEN or CHECK
+            STORED -> COPY -> TYPE
+            TABLE -> LENLENS -> CODELENS -> LEN
+    Read deflate codes:
+                LEN -> LENEXT or LIT or TYPE
+                LENEXT -> DIST -> DISTEXT -> MATCH -> LEN
+                LIT -> LEN
+    Process trailer:
+        CHECK -> LENGTH -> DONE
+ */
+
+/* state maintained between inflate() calls.  Approximately 7K bytes. */
+struct inflate_state {
+    inflate_mode mode;          /* current inflate mode */
+    int last;                   /* true if processing last block */
+    int wrap;                   /* bit 0 true for zlib, bit 1 true for gzip */
+    int havedict;               /* true if dictionary provided */
+    int flags;                  /* gzip header method and flags (0 if zlib) */
+    unsigned dmax;              /* zlib header max distance (INFLATE_STRICT) */
+    unsigned long check;        /* protected copy of check value */
+    unsigned long total;        /* protected copy of output count */
+    gz_headerp head;            /* where to save gzip header information */
+        /* sliding window */
+    unsigned wbits;             /* log base 2 of requested window size */
+    unsigned wsize;             /* window size or zero if not using window */
+    unsigned whave;             /* valid bytes in the window */
+    unsigned write;             /* window write index */
+    unsigned char FAR *window;  /* allocated sliding window, if needed */
+        /* bit accumulator */
+    unsigned long hold;         /* input bit accumulator */
+    unsigned bits;              /* number of bits in "in" */
+        /* for string and stored block copying */
+    unsigned length;            /* literal or length of data to copy */
+    unsigned offset;            /* distance back to copy string from */
+        /* for table and code decoding */
+    unsigned extra;             /* extra bits needed */
+        /* fixed and dynamic code tables */
+    code const FAR *lencode;    /* starting table for length/literal codes */
+    code const FAR *distcode;   /* starting table for distance codes */
+    unsigned lenbits;           /* index bits for lencode */
+    unsigned distbits;          /* index bits for distcode */
+        /* dynamic table building */
+    unsigned ncode;             /* number of code length code lengths */
+    unsigned nlen;              /* number of length code lengths */
+    unsigned ndist;             /* number of distance code lengths */
+    unsigned have;              /* number of code lengths in lens[] */
+    code FAR *next;             /* next available space in codes[] */
+    unsigned short lens[320];   /* temporary storage for code lengths */
+    unsigned short work[288];   /* work area for code table building */
+    code codes[ENOUGH];         /* space for code tables */
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/zlib/inftrees.c	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,329 @@
+/* inftrees.c -- generate Huffman trees for efficient decoding
+ * Copyright (C) 1995-2005 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+
+#define MAXBITS 15
+
+const char inflate_copyright[] =
+   " inflate 1.2.3 Copyright 1995-2005 Mark Adler ";
+/*
+  If you use the zlib library in a product, an acknowledgment is welcome
+  in the documentation of your product. If for some reason you cannot
+  include such an acknowledgment, I would appreciate that you keep this
+  copyright string in the executable of your product.
+ */
+
+/*
+   Build a set of tables to decode the provided canonical Huffman code.
+   The code lengths are lens[0..codes-1].  The result starts at *table,
+   whose indices are 0..2^bits-1.  work is a writable array of at least
+   lens shorts, which is used as a work area.  type is the type of code
+   to be generated, CODES, LENS, or DISTS.  On return, zero is success,
+   -1 is an invalid code, and +1 means that ENOUGH isn't enough.  table
+   on return points to the next available entry's address.  bits is the
+   requested root table index bits, and on return it is the actual root
+   table index bits.  It will differ if the request is greater than the
+   longest code or if it is less than the shortest code.
+ */
+int inflate_table(type, lens, codes, table, bits, work)
+codetype type;
+unsigned short FAR *lens;
+unsigned codes;
+code FAR * FAR *table;
+unsigned FAR *bits;
+unsigned short FAR *work;
+{
+    unsigned len;               /* a code's length in bits */
+    unsigned sym;               /* index of code symbols */
+    unsigned min, max;          /* minimum and maximum code lengths */
+    unsigned root;              /* number of index bits for root table */
+    unsigned curr;              /* number of index bits for current table */
+    unsigned drop;              /* code bits to drop for sub-table */
+    int left;                   /* number of prefix codes available */
+    unsigned used;              /* code entries in table used */
+    unsigned huff;              /* Huffman code */
+    unsigned incr;              /* for incrementing code, index */
+    unsigned fill;              /* index for replicating entries */
+    unsigned low;               /* low bits for current root entry */
+    unsigned mask;              /* mask for low root bits */
+    code this;                  /* table entry for duplication */
+    code FAR *next;             /* next available space in table */
+    const unsigned short FAR *base;     /* base value table to use */
+    const unsigned short FAR *extra;    /* extra bits table to use */
+    int end;                    /* use base and extra for symbol > end */
+    unsigned short count[MAXBITS+1];    /* number of codes of each length */
+    unsigned short offs[MAXBITS+1];     /* offsets in table for each length */
+    static const unsigned short lbase[31] = { /* Length codes 257..285 base */
+        3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
+        35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
+    static const unsigned short lext[31] = { /* Length codes 257..285 extra */
+        16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
+        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 201, 196};
+    static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
+        1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
+        257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
+        8193, 12289, 16385, 24577, 0, 0};
+    static const unsigned short dext[32] = { /* Distance codes 0..29 extra */
+        16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
+        23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
+        28, 28, 29, 29, 64, 64};
+
+    /*
+       Process a set of code lengths to create a canonical Huffman code.  The
+       code lengths are lens[0..codes-1].  Each length corresponds to the
+       symbols 0..codes-1.  The Huffman code is generated by first sorting the
+       symbols by length from short to long, and retaining the symbol order
+       for codes with equal lengths.  Then the code starts with all zero bits
+       for the first code of the shortest length, and the codes are integer
+       increments for the same length, and zeros are appended as the length
+       increases.  For the deflate format, these bits are stored backwards
+       from their more natural integer increment ordering, and so when the
+       decoding tables are built in the large loop below, the integer codes
+       are incremented backwards.
+
+       This routine assumes, but does not check, that all of the entries in
+       lens[] are in the range 0..MAXBITS.  The caller must assure this.
+       1..MAXBITS is interpreted as that code length.  zero means that that
+       symbol does not occur in this code.
+
+       The codes are sorted by computing a count of codes for each length,
+       creating from that a table of starting indices for each length in the
+       sorted table, and then entering the symbols in order in the sorted
+       table.  The sorted table is work[], with that space being provided by
+       the caller.
+
+       The length counts are used for other purposes as well, i.e. finding
+       the minimum and maximum length codes, determining if there are any
+       codes at all, checking for a valid set of lengths, and looking ahead
+       at length counts to determine sub-table sizes when building the
+       decoding tables.
+     */
+
+    /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
+    for (len = 0; len <= MAXBITS; len++)
+        count[len] = 0;
+    for (sym = 0; sym < codes; sym++)
+        count[lens[sym]]++;
+
+    /* bound code lengths, force root to be within code lengths */
+    root = *bits;
+    for (max = MAXBITS; max >= 1; max--)
+        if (count[max] != 0) break;
+    if (root > max) root = max;
+    if (max == 0) {                     /* no symbols to code at all */
+        this.op = (unsigned char)64;    /* invalid code marker */
+        this.bits = (unsigned char)1;
+        this.val = (unsigned short)0;
+        *(*table)++ = this;             /* make a table to force an error */
+        *(*table)++ = this;
+        *bits = 1;
+        return 0;     /* no symbols, but wait for decoding to report error */
+    }
+    for (min = 1; min <= MAXBITS; min++)
+        if (count[min] != 0) break;
+    if (root < min) root = min;
+
+    /* check for an over-subscribed or incomplete set of lengths */
+    left = 1;
+    for (len = 1; len <= MAXBITS; len++) {
+        left <<= 1;
+        left -= count[len];
+        if (left < 0) return -1;        /* over-subscribed */
+    }
+    if (left > 0 && (type == CODES || max != 1))
+        return -1;                      /* incomplete set */
+
+    /* generate offsets into symbol table for each length for sorting */
+    offs[1] = 0;
+    for (len = 1; len < MAXBITS; len++)
+        offs[len + 1] = offs[len] + count[len];
+
+    /* sort symbols by length, by symbol order within each length */
+    for (sym = 0; sym < codes; sym++)
+        if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym;
+
+    /*
+       Create and fill in decoding tables.  In this loop, the table being
+       filled is at next and has curr index bits.  The code being used is huff
+       with length len.  That code is converted to an index by dropping drop
+       bits off of the bottom.  For codes where len is less than drop + curr,
+       those top drop + curr - len bits are incremented through all values to
+       fill the table with replicated entries.
+
+       root is the number of index bits for the root table.  When len exceeds
+       root, sub-tables are created pointed to by the root entry with an index
+       of the low root bits of huff.  This is saved in low to check for when a
+       new sub-table should be started.  drop is zero when the root table is
+       being filled, and drop is root when sub-tables are being filled.
+
+       When a new sub-table is needed, it is necessary to look ahead in the
+       code lengths to determine what size sub-table is needed.  The length
+       counts are used for this, and so count[] is decremented as codes are
+       entered in the tables.
+
+       used keeps track of how many table entries have been allocated from the
+       provided *table space.  It is checked when a LENS table is being made
+       against the space in *table, ENOUGH, minus the maximum space needed by
+       the worst case distance code, MAXD.  This should never happen, but the
+       sufficiency of ENOUGH has not been proven exhaustively, hence the check.
+       This assumes that when type == LENS, bits == 9.
+
+       sym increments through all symbols, and the loop terminates when
+       all codes of length max, i.e. all codes, have been processed.  This
+       routine permits incomplete codes, so another loop after this one fills
+       in the rest of the decoding tables with invalid code markers.
+     */
+
+    /* set up for code type */
+    switch (type) {
+    case CODES:
+        base = extra = work;    /* dummy value--not used */
+        end = 19;
+        break;
+    case LENS:
+        base = lbase;
+        base -= 257;
+        extra = lext;
+        extra -= 257;
+        end = 256;
+        break;
+    default:            /* DISTS */
+        base = dbase;
+        extra = dext;
+        end = -1;
+    }
+
+    /* initialize state for loop */
+    huff = 0;                   /* starting code */
+    sym = 0;                    /* starting code symbol */
+    len = min;                  /* starting code length */
+    next = *table;              /* current table to fill in */
+    curr = root;                /* current table index bits */
+    drop = 0;                   /* current bits to drop from code for index */
+    low = (unsigned)(-1);       /* trigger new sub-table when len > root */
+    used = 1U << root;          /* use root table entries */
+    mask = used - 1;            /* mask for comparing low */
+
+    /* check available table space */
+    if (type == LENS && used >= ENOUGH - MAXD)
+        return 1;
+
+    /* process all codes and make table entries */
+    for (;;) {
+        /* create table entry */
+        this.bits = (unsigned char)(len - drop);
+        if ((int)(work[sym]) < end) {
+            this.op = (unsigned char)0;
+            this.val = work[sym];
+        }
+        else if ((int)(work[sym]) > end) {
+            this.op = (unsigned char)(extra[work[sym]]);
+            this.val = base[work[sym]];
+        }
+        else {
+            this.op = (unsigned char)(32 + 64);         /* end of block */
+            this.val = 0;
+        }
+
+        /* replicate for those indices with low len bits equal to huff */
+        incr = 1U << (len - drop);
+        fill = 1U << curr;
+        min = fill;                 /* save offset to next table */
+        do {
+            fill -= incr;
+            next[(huff >> drop) + fill] = this;
+        } while (fill != 0);
+
+        /* backwards increment the len-bit code huff */
+        incr = 1U << (len - 1);
+        while (huff & incr)
+            incr >>= 1;
+        if (incr != 0) {
+            huff &= incr - 1;
+            huff += incr;
+        }
+        else
+            huff = 0;
+
+        /* go to next symbol, update count, len */
+        sym++;
+        if (--(count[len]) == 0) {
+            if (len == max) break;
+            len = lens[work[sym]];
+        }
+
+        /* create new sub-table if needed */
+        if (len > root && (huff & mask) != low) {
+            /* if first time, transition to sub-tables */
+            if (drop == 0)
+                drop = root;
+
+            /* increment past last table */
+            next += min;            /* here min is 1 << curr */
+
+            /* determine length of next table */
+            curr = len - drop;
+            left = (int)(1 << curr);
+            while (curr + drop < max) {
+                left -= count[curr + drop];
+                if (left <= 0) break;
+                curr++;
+                left <<= 1;
+            }
+
+            /* check for enough space */
+            used += 1U << curr;
+            if (type == LENS && used >= ENOUGH - MAXD)
+                return 1;
+
+            /* point entry in root table to sub-table */
+            low = huff & mask;
+            (*table)[low].op = (unsigned char)curr;
+            (*table)[low].bits = (unsigned char)root;
+            (*table)[low].val = (unsigned short)(next - *table);
+        }
+    }
+
+    /*
+       Fill in rest of table for incomplete codes.  This loop is similar to the
+       loop above in incrementing huff for table indices.  It is assumed that
+       len is equal to curr + drop, so there is no loop needed to increment
+       through high index bits.  When the current sub-table is filled, the loop
+       drops back to the root table to fill in any remaining entries there.
+     */
+    this.op = (unsigned char)64;                /* invalid code marker */
+    this.bits = (unsigned char)(len - drop);
+    this.val = (unsigned short)0;
+    while (huff != 0) {
+        /* when done with sub-table, drop back to root table */
+        if (drop != 0 && (huff & mask) != low) {
+            drop = 0;
+            len = root;
+            next = *table;
+            this.bits = (unsigned char)len;
+        }
+
+        /* put invalid code marker in table */
+        next[huff >> drop] = this;
+
+        /* backwards increment the len-bit code huff */
+        incr = 1U << (len - 1);
+        while (huff & incr)
+            incr >>= 1;
+        if (incr != 0) {
+            huff &= incr - 1;
+            huff += incr;
+        }
+        else
+            huff = 0;
+    }
+
+    /* set return parameters */
+    *table += used;
+    *bits = root;
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/zlib/inftrees.h	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,55 @@
+/* inftrees.h -- header to use inftrees.c
+ * Copyright (C) 1995-2005 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+   part of the implementation of the compression library and is
+   subject to change. Applications should only use zlib.h.
+ */
+
+/* Structure for decoding tables.  Each entry provides either the
+   information needed to do the operation requested by the code that
+   indexed that table entry, or it provides a pointer to another
+   table that indexes more bits of the code.  op indicates whether
+   the entry is a pointer to another table, a literal, a length or
+   distance, an end-of-block, or an invalid code.  For a table
+   pointer, the low four bits of op is the number of index bits of
+   that table.  For a length or distance, the low four bits of op
+   is the number of extra bits to get after the code.  bits is
+   the number of bits in this code or part of the code to drop off
+   of the bit buffer.  val is the actual byte to output in the case
+   of a literal, the base length or distance, or the offset from
+   the current table to the next table.  Each entry is four bytes. */
+typedef struct {
+    unsigned char op;           /* operation, extra bits, table bits */
+    unsigned char bits;         /* bits in this part of the code */
+    unsigned short val;         /* offset in table or code value */
+} code;
+
+/* op values as set by inflate_table():
+    00000000 - literal
+    0000tttt - table link, tttt != 0 is the number of table index bits
+    0001eeee - length or distance, eeee is the number of extra bits
+    01100000 - end of block
+    01000000 - invalid code
+ */
+
+/* Maximum size of dynamic tree.  The maximum found in a long but non-
+   exhaustive search was 1444 code structures (852 for length/literals
+   and 592 for distances, the latter actually the result of an
+   exhaustive search).  The true maximum is not known, but the value
+   below is more than safe. */
+#define ENOUGH 2048
+#define MAXD 592
+
+/* Type of code to build for inftable() */
+typedef enum {
+    CODES,
+    LENS,
+    DISTS
+} codetype;
+
+extern int inflate_table OF((codetype type, unsigned short FAR *lens,
+                             unsigned codes, code FAR * FAR *table,
+                             unsigned FAR *bits, unsigned short FAR *work));
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/zlib/ioapi.c	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,177 @@
+/* ioapi.c -- IO base function header for compress/uncompress .zip
+   files using zlib + zip or unzip API
+
+   Version 1.01e, February 12th, 2005
+
+   Copyright (C) 1998-2005 Gilles Vollant
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "zlib.h"
+#include "ioapi.h"
+
+
+
+/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */
+
+#ifndef SEEK_CUR
+#define SEEK_CUR    1
+#endif
+
+#ifndef SEEK_END
+#define SEEK_END    2
+#endif
+
+#ifndef SEEK_SET
+#define SEEK_SET    0
+#endif
+
+voidpf ZCALLBACK fopen_file_func OF((
+   voidpf opaque,
+   const char* filename,
+   int mode));
+
+uLong ZCALLBACK fread_file_func OF((
+   voidpf opaque,
+   voidpf stream,
+   void* buf,
+   uLong size));
+
+uLong ZCALLBACK fwrite_file_func OF((
+   voidpf opaque,
+   voidpf stream,
+   const void* buf,
+   uLong size));
+
+long ZCALLBACK ftell_file_func OF((
+   voidpf opaque,
+   voidpf stream));
+
+long ZCALLBACK fseek_file_func OF((
+   voidpf opaque,
+   voidpf stream,
+   uLong offset,
+   int origin));
+
+int ZCALLBACK fclose_file_func OF((
+   voidpf opaque,
+   voidpf stream));
+
+int ZCALLBACK ferror_file_func OF((
+   voidpf opaque,
+   voidpf stream));
+
+
+voidpf ZCALLBACK fopen_file_func (opaque, filename, mode)
+   voidpf opaque;
+   const char* filename;
+   int mode;
+{
+    FILE* file = NULL;
+    const char* mode_fopen = NULL;
+    if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
+        mode_fopen = "rb";
+    else
+    if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
+        mode_fopen = "r+b";
+    else
+    if (mode & ZLIB_FILEFUNC_MODE_CREATE)
+        mode_fopen = "wb";
+
+    if ((filename!=NULL) && (mode_fopen != NULL))
+        file = fopen(filename, mode_fopen);
+    return file;
+}
+
+
+uLong ZCALLBACK fread_file_func (opaque, stream, buf, size)
+   voidpf opaque;
+   voidpf stream;
+   void* buf;
+   uLong size;
+{
+    uLong ret;
+    ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream);
+    return ret;
+}
+
+
+uLong ZCALLBACK fwrite_file_func (opaque, stream, buf, size)
+   voidpf opaque;
+   voidpf stream;
+   const void* buf;
+   uLong size;
+{
+    uLong ret;
+    ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream);
+    return ret;
+}
+
+long ZCALLBACK ftell_file_func (opaque, stream)
+   voidpf opaque;
+   voidpf stream;
+{
+    long ret;
+    ret = ftell((FILE *)stream);
+    return ret;
+}
+
+long ZCALLBACK fseek_file_func (opaque, stream, offset, origin)
+   voidpf opaque;
+   voidpf stream;
+   uLong offset;
+   int origin;
+{
+    int fseek_origin=0;
+    long ret;
+    switch (origin)
+    {
+    case ZLIB_FILEFUNC_SEEK_CUR :
+        fseek_origin = SEEK_CUR;
+        break;
+    case ZLIB_FILEFUNC_SEEK_END :
+        fseek_origin = SEEK_END;
+        break;
+    case ZLIB_FILEFUNC_SEEK_SET :
+        fseek_origin = SEEK_SET;
+        break;
+    default: return -1;
+    }
+    ret = 0;
+    fseek((FILE *)stream, offset, fseek_origin);
+    return ret;
+}
+
+int ZCALLBACK fclose_file_func (opaque, stream)
+   voidpf opaque;
+   voidpf stream;
+{
+    int ret;
+    ret = fclose((FILE *)stream);
+    return ret;
+}
+
+int ZCALLBACK ferror_file_func (opaque, stream)
+   voidpf opaque;
+   voidpf stream;
+{
+    int ret;
+    ret = ferror((FILE *)stream);
+    return ret;
+}
+
+void fill_fopen_filefunc (pzlib_filefunc_def)
+  zlib_filefunc_def* pzlib_filefunc_def;
+{
+    pzlib_filefunc_def->zopen_file = fopen_file_func;
+    pzlib_filefunc_def->zread_file = fread_file_func;
+    pzlib_filefunc_def->zwrite_file = fwrite_file_func;
+    pzlib_filefunc_def->ztell_file = ftell_file_func;
+    pzlib_filefunc_def->zseek_file = fseek_file_func;
+    pzlib_filefunc_def->zclose_file = fclose_file_func;
+    pzlib_filefunc_def->zerror_file = ferror_file_func;
+    pzlib_filefunc_def->opaque = NULL;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/zlib/ioapi.h	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,75 @@
+/* ioapi.h -- IO base function header for compress/uncompress .zip
+   files using zlib + zip or unzip API
+
+   Version 1.01e, February 12th, 2005
+
+   Copyright (C) 1998-2005 Gilles Vollant
+*/
+
+#ifndef _ZLIBIOAPI_H
+#define _ZLIBIOAPI_H
+
+
+#define ZLIB_FILEFUNC_SEEK_CUR (1)
+#define ZLIB_FILEFUNC_SEEK_END (2)
+#define ZLIB_FILEFUNC_SEEK_SET (0)
+
+#define ZLIB_FILEFUNC_MODE_READ      (1)
+#define ZLIB_FILEFUNC_MODE_WRITE     (2)
+#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3)
+
+#define ZLIB_FILEFUNC_MODE_EXISTING (4)
+#define ZLIB_FILEFUNC_MODE_CREATE   (8)
+
+
+#ifndef ZCALLBACK
+
+#if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK)
+#define ZCALLBACK CALLBACK
+#else
+#define ZCALLBACK
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode));
+typedef uLong  (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size));
+typedef uLong  (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
+typedef long   (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream));
+typedef long   (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin));
+typedef int    (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream));
+typedef int    (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream));
+
+typedef struct zlib_filefunc_def_s
+{
+    open_file_func      zopen_file;
+    read_file_func      zread_file;
+    write_file_func     zwrite_file;
+    tell_file_func      ztell_file;
+    seek_file_func      zseek_file;
+    close_file_func     zclose_file;
+    testerror_file_func zerror_file;
+    voidpf              opaque;
+} zlib_filefunc_def;
+
+
+
+void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def));
+
+#define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size))
+#define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size))
+#define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream))
+#define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode))
+#define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream))
+#define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream))
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/zlib/unzip.c	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,1598 @@
+/* unzip.c -- IO for uncompress .zip files using zlib
+   Version 1.01e, February 12th, 2005
+
+   Copyright (C) 1998-2005 Gilles Vollant
+
+   Read unzip.h for more info
+*/
+
+/* Decryption code comes from crypt.c by Info-ZIP but has been greatly reduced in terms of
+compatibility with older software. The following is from the original crypt.c. Code
+woven in by Terry Thorsen 1/2003.
+*/
+/*
+  Copyright (c) 1990-2000 Info-ZIP.  All rights reserved.
+
+  See the accompanying file LICENSE, version 2000-Apr-09 or later
+  (the contents of which are also included in zip.h) for terms of use.
+  If, for some reason, all these files are missing, the Info-ZIP license
+  also may be found at:  ftp://ftp.info-zip.org/pub/infozip/license.html
+*/
+/*
+  crypt.c (full version) by Info-ZIP.      Last revised:  [see crypt.h]
+
+  The encryption/decryption parts of this source code (as opposed to the
+  non-echoing password parts) were originally written in Europe.  The
+  whole source package can be freely distributed, including from the USA.
+  (Prior to January 2000, re-export from the US was a violation of US law.)
+ */
+
+/*
+  This encryption code is a direct transcription of the algorithm from
+  Roger Schlafly, described by Phil Katz in the file appnote.txt.  This
+  file (appnote.txt) is distributed with the PKZIP program (even in the
+  version without encryption capabilities).
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "zlib.h"
+#include "unzip.h"
+
+#ifdef STDC
+#  include <stddef.h>
+#  include <string.h>
+#  include <stdlib.h>
+#endif
+#ifdef NO_ERRNO_H
+    extern int errno;
+#else
+#   include <errno.h>
+#endif
+
+
+#ifndef local
+#  define local static
+#endif
+/* compile with -Dlocal if your debugger can't find static symbols */
+
+
+#ifndef CASESENSITIVITYDEFAULT_NO
+#  if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES)
+#    define CASESENSITIVITYDEFAULT_NO
+#  endif
+#endif
+
+
+#ifndef UNZ_BUFSIZE
+#define UNZ_BUFSIZE (16384)
+#endif
+
+#ifndef UNZ_MAXFILENAMEINZIP
+#define UNZ_MAXFILENAMEINZIP (256)
+#endif
+
+#ifndef ALLOC
+# define ALLOC(size) (malloc(size))
+#endif
+#ifndef TRYFREE
+# define TRYFREE(p) {if (p) free(p);}
+#endif
+
+#define SIZECENTRALDIRITEM (0x2e)
+#define SIZEZIPLOCALHEADER (0x1e)
+
+
+
+
+const char unz_copyright[] =
+   " unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll";
+
+/* unz_file_info_interntal contain internal info about a file in zipfile*/
+typedef struct unz_file_info_internal_s
+{
+    uLong offset_curfile;/* relative offset of local header 4 bytes */
+} unz_file_info_internal;
+
+
+/* file_in_zip_read_info_s contain internal information about a file in zipfile,
+    when reading and decompress it */
+typedef struct
+{
+    char  *read_buffer;         /* internal buffer for compressed data */
+    z_stream stream;            /* zLib stream structure for inflate */
+
+    uLong pos_in_zipfile;       /* position in byte on the zipfile, for fseek*/
+    uLong stream_initialised;   /* flag set if stream structure is initialised*/
+
+    uLong offset_local_extrafield;/* offset of the local extra field */
+    uInt  size_local_extrafield;/* size of the local extra field */
+    uLong pos_local_extrafield;   /* position in the local extra field in read*/
+
+    uLong crc32;                /* crc32 of all data uncompressed */
+    uLong crc32_wait;           /* crc32 we must obtain after decompress all */
+    uLong rest_read_compressed; /* number of byte to be decompressed */
+    uLong rest_read_uncompressed;/*number of byte to be obtained after decomp*/
+    zlib_filefunc_def z_filefunc;
+    voidpf filestream;        /* io structore of the zipfile */
+    uLong compression_method;   /* compression method (0==store) */
+    uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/
+    int   raw;
+} file_in_zip_read_info_s;
+
+
+/* unz_s contain internal information about the zipfile
+*/
+typedef struct
+{
+    zlib_filefunc_def z_filefunc;
+    voidpf filestream;        /* io structore of the zipfile */
+    unz_global_info gi;       /* public global information */
+    uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/
+    uLong num_file;             /* number of the current file in the zipfile*/
+    uLong pos_in_central_dir;   /* pos of the current file in the central dir*/
+    uLong current_file_ok;      /* flag about the usability of the current file*/
+    uLong central_pos;          /* position of the beginning of the central dir*/
+
+    uLong size_central_dir;     /* size of the central directory  */
+    uLong offset_central_dir;   /* offset of start of central directory with
+                                   respect to the starting disk number */
+
+    unz_file_info cur_file_info; /* public info about the current file in zip*/
+    unz_file_info_internal cur_file_info_internal; /* private info about it*/
+    file_in_zip_read_info_s* pfile_in_zip_read; /* structure about the current
+                                        file if we are decompressing it */
+    int encrypted;
+#    ifndef NOUNCRYPT
+    unsigned long keys[3];     /* keys defining the pseudo-random sequence */
+    const unsigned long* pcrc_32_tab;
+#    endif
+} unz_s;
+
+
+#ifndef NOUNCRYPT
+#include "crypt.h"
+#endif
+
+/* ===========================================================================
+     Read a byte from a gz_stream; update next_in and avail_in. Return EOF
+   for end of file.
+   IN assertion: the stream s has been sucessfully opened for reading.
+*/
+
+
+local int unzlocal_getByte OF((
+    const zlib_filefunc_def* pzlib_filefunc_def,
+    voidpf filestream,
+    int *pi));
+
+local int unzlocal_getByte(pzlib_filefunc_def,filestream,pi)
+    const zlib_filefunc_def* pzlib_filefunc_def;
+    voidpf filestream;
+    int *pi;
+{
+    unsigned char c;
+    int err = (int)ZREAD(*pzlib_filefunc_def,filestream,&c,1);
+    if (err==1)
+    {
+        *pi = (int)c;
+        return UNZ_OK;
+    }
+    else
+    {
+        if (ZERROR(*pzlib_filefunc_def,filestream))
+            return UNZ_ERRNO;
+        else
+            return UNZ_EOF;
+    }
+}
+
+
+/* ===========================================================================
+   Reads a long in LSB order from the given gz_stream. Sets
+*/
+local int unzlocal_getShort OF((
+    const zlib_filefunc_def* pzlib_filefunc_def,
+    voidpf filestream,
+    uLong *pX));
+
+local int unzlocal_getShort (pzlib_filefunc_def,filestream,pX)
+    const zlib_filefunc_def* pzlib_filefunc_def;
+    voidpf filestream;
+    uLong *pX;
+{
+    uLong x ;
+    int i;
+    int err;
+
+    err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i);
+    x = (uLong)i;
+
+    if (err==UNZ_OK)
+        err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i);
+    x += ((uLong)i)<<8;
+
+    if (err==UNZ_OK)
+        *pX = x;
+    else
+        *pX = 0;
+    return err;
+}
+
+local int unzlocal_getLong OF((
+    const zlib_filefunc_def* pzlib_filefunc_def,
+    voidpf filestream,
+    uLong *pX));
+
+local int unzlocal_getLong (pzlib_filefunc_def,filestream,pX)
+    const zlib_filefunc_def* pzlib_filefunc_def;
+    voidpf filestream;
+    uLong *pX;
+{
+    uLong x ;
+    int i;
+    int err;
+
+    err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i);
+    x = (uLong)i;
+
+    if (err==UNZ_OK)
+        err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i);
+    x += ((uLong)i)<<8;
+
+    if (err==UNZ_OK)
+        err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i);
+    x += ((uLong)i)<<16;
+
+    if (err==UNZ_OK)
+        err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i);
+    x += ((uLong)i)<<24;
+
+    if (err==UNZ_OK)
+        *pX = x;
+    else
+        *pX = 0;
+    return err;
+}
+
+
+/* My own strcmpi / strcasecmp */
+local int strcmpcasenosensitive_internal (fileName1,fileName2)
+    const char* fileName1;
+    const char* fileName2;
+{
+    for (;;)
+    {
+        char c1=*(fileName1++);
+        char c2=*(fileName2++);
+        if ((c1>='a') && (c1<='z'))
+            c1 -= 0x20;
+        if ((c2>='a') && (c2<='z'))
+            c2 -= 0x20;
+        if (c1=='\0')
+            return ((c2=='\0') ? 0 : -1);
+        if (c2=='\0')
+            return 1;
+        if (c1<c2)
+            return -1;
+        if (c1>c2)
+            return 1;
+    }
+}
+
+
+#ifdef  CASESENSITIVITYDEFAULT_NO
+#define CASESENSITIVITYDEFAULTVALUE 2
+#else
+#define CASESENSITIVITYDEFAULTVALUE 1
+#endif
+
+#ifndef STRCMPCASENOSENTIVEFUNCTION
+#define STRCMPCASENOSENTIVEFUNCTION strcmpcasenosensitive_internal
+#endif
+
+/*
+   Compare two filename (fileName1,fileName2).
+   If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
+   If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
+                                                                or strcasecmp)
+   If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
+        (like 1 on Unix, 2 on Windows)
+
+*/
+extern int ZEXPORT unzStringFileNameCompare (fileName1,fileName2,iCaseSensitivity)
+    const char* fileName1;
+    const char* fileName2;
+    int iCaseSensitivity;
+{
+    if (iCaseSensitivity==0)
+        iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE;
+
+    if (iCaseSensitivity==1)
+        return strcmp(fileName1,fileName2);
+
+    return STRCMPCASENOSENTIVEFUNCTION(fileName1,fileName2);
+}
+
+#ifndef BUFREADCOMMENT
+#define BUFREADCOMMENT (0x400)
+#endif
+
+/*
+  Locate the Central directory of a zipfile (at the end, just before
+    the global comment)
+*/
+local uLong unzlocal_SearchCentralDir OF((
+    const zlib_filefunc_def* pzlib_filefunc_def,
+    voidpf filestream));
+
+local uLong unzlocal_SearchCentralDir(pzlib_filefunc_def,filestream)
+    const zlib_filefunc_def* pzlib_filefunc_def;
+    voidpf filestream;
+{
+    unsigned char* buf;
+    uLong uSizeFile;
+    uLong uBackRead;
+    uLong uMaxBack=0xffff; /* maximum size of global comment */
+    uLong uPosFound=0;
+
+    if (ZSEEK(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0)
+        return 0;
+
+
+    uSizeFile = ZTELL(*pzlib_filefunc_def,filestream);
+
+    if (uMaxBack>uSizeFile)
+        uMaxBack = uSizeFile;
+
+    buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4);
+    if (buf==NULL)
+        return 0;
+
+    uBackRead = 4;
+    while (uBackRead<uMaxBack)
+    {
+        uLong uReadSize,uReadPos ;
+        int i;
+        if (uBackRead+BUFREADCOMMENT>uMaxBack)
+            uBackRead = uMaxBack;
+        else
+            uBackRead+=BUFREADCOMMENT;
+        uReadPos = uSizeFile-uBackRead ;
+
+        uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ?
+                     (BUFREADCOMMENT+4) : (uSizeFile-uReadPos);
+        if (ZSEEK(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0)
+            break;
+
+        if (ZREAD(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize)
+            break;
+
+        for (i=(int)uReadSize-3; (i--)>0;)
+            if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
+                ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06))
+            {
+                uPosFound = uReadPos+i;
+                break;
+            }
+
+        if (uPosFound!=0)
+            break;
+    }
+    TRYFREE(buf);
+    return uPosFound;
+}
+
+/*
+  Open a Zip file. path contain the full pathname (by example,
+     on a Windows NT computer "c:\\test\\zlib114.zip" or on an Unix computer
+     "zlib/zlib114.zip".
+     If the zipfile cannot be opened (file doesn't exist or in not valid), the
+       return value is NULL.
+     Else, the return value is a unzFile Handle, usable with other function
+       of this unzip package.
+*/
+extern unzFile ZEXPORT unzOpen2 (path, pzlib_filefunc_def)
+    const char *path;
+    zlib_filefunc_def* pzlib_filefunc_def;
+{
+    unz_s us;
+    unz_s *s;
+    uLong central_pos,uL;
+
+    uLong number_disk;          /* number of the current dist, used for
+                                   spaning ZIP, unsupported, always 0*/
+    uLong number_disk_with_CD;  /* number the the disk with central dir, used
+                                   for spaning ZIP, unsupported, always 0*/
+    uLong number_entry_CD;      /* total number of entries in
+                                   the central dir
+                                   (same than number_entry on nospan) */
+
+    int err=UNZ_OK;
+
+    if (unz_copyright[0]!=' ')
+        return NULL;
+
+    if (pzlib_filefunc_def==NULL)
+        fill_fopen_filefunc(&us.z_filefunc);
+    else
+        us.z_filefunc = *pzlib_filefunc_def;
+
+    us.filestream= (*(us.z_filefunc.zopen_file))(us.z_filefunc.opaque,
+                                                 path,
+                                                 ZLIB_FILEFUNC_MODE_READ |
+                                                 ZLIB_FILEFUNC_MODE_EXISTING);
+    if (us.filestream==NULL)
+        return NULL;
+
+    central_pos = unzlocal_SearchCentralDir(&us.z_filefunc,us.filestream);
+    if (central_pos==0)
+        err=UNZ_ERRNO;
+
+    if (ZSEEK(us.z_filefunc, us.filestream,
+                                      central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0)
+        err=UNZ_ERRNO;
+
+    /* the signature, already checked */
+    if (unzlocal_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK)
+        err=UNZ_ERRNO;
+
+    /* number of this disk */
+    if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK)
+        err=UNZ_ERRNO;
+
+    /* number of the disk with the start of the central directory */
+    if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK)
+        err=UNZ_ERRNO;
+
+    /* total number of entries in the central dir on this disk */
+    if (unzlocal_getShort(&us.z_filefunc, us.filestream,&us.gi.number_entry)!=UNZ_OK)
+        err=UNZ_ERRNO;
+
+    /* total number of entries in the central dir */
+    if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_entry_CD)!=UNZ_OK)
+        err=UNZ_ERRNO;
+
+    if ((number_entry_CD!=us.gi.number_entry) ||
+        (number_disk_with_CD!=0) ||
+        (number_disk!=0))
+        err=UNZ_BADZIPFILE;
+
+    /* size of the central directory */
+    if (unzlocal_getLong(&us.z_filefunc, us.filestream,&us.size_central_dir)!=UNZ_OK)
+        err=UNZ_ERRNO;
+
+    /* offset of start of central directory with respect to the
+          starting disk number */
+    if (unzlocal_getLong(&us.z_filefunc, us.filestream,&us.offset_central_dir)!=UNZ_OK)
+        err=UNZ_ERRNO;
+
+    /* zipfile comment length */
+    if (unzlocal_getShort(&us.z_filefunc, us.filestream,&us.gi.size_comment)!=UNZ_OK)
+        err=UNZ_ERRNO;
+
+    if ((central_pos<us.offset_central_dir+us.size_central_dir) &&
+        (err==UNZ_OK))
+        err=UNZ_BADZIPFILE;
+
+    if (err!=UNZ_OK)
+    {
+        ZCLOSE(us.z_filefunc, us.filestream);
+        return NULL;
+    }
+
+    us.byte_before_the_zipfile = central_pos -
+                            (us.offset_central_dir+us.size_central_dir);
+    us.central_pos = central_pos;
+    us.pfile_in_zip_read = NULL;
+    us.encrypted = 0;
+
+
+    s=(unz_s*)ALLOC(sizeof(unz_s));
+    *s=us;
+    unzGoToFirstFile((unzFile)s);
+    return (unzFile)s;
+}
+
+
+extern unzFile ZEXPORT unzOpen (path)
+    const char *path;
+{
+    return unzOpen2(path, NULL);
+}
+
+/*
+  Close a ZipFile opened with unzipOpen.
+  If there is files inside the .Zip opened with unzipOpenCurrentFile (see later),
+    these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
+  return UNZ_OK if there is no problem. */
+extern int ZEXPORT unzClose (file)
+    unzFile file;
+{
+    unz_s* s;
+    if (file==NULL)
+        return UNZ_PARAMERROR;
+    s=(unz_s*)file;
+
+    if (s->pfile_in_zip_read!=NULL)
+        unzCloseCurrentFile(file);
+
+    ZCLOSE(s->z_filefunc, s->filestream);
+    TRYFREE(s);
+    return UNZ_OK;
+}
+
+
+/*
+  Write info about the ZipFile in the *pglobal_info structure.
+  No preparation of the structure is needed
+  return UNZ_OK if there is no problem. */
+extern int ZEXPORT unzGetGlobalInfo (file,pglobal_info)
+    unzFile file;
+    unz_global_info *pglobal_info;
+{
+    unz_s* s;
+    if (file==NULL)
+        return UNZ_PARAMERROR;
+    s=(unz_s*)file;
+    *pglobal_info=s->gi;
+    return UNZ_OK;
+}
+
+
+/*
+   Translate date/time from Dos format to tm_unz (readable more easilty)
+*/
+local void unzlocal_DosDateToTmuDate (ulDosDate, ptm)
+    uLong ulDosDate;
+    tm_unz* ptm;
+{
+    uLong uDate;
+    uDate = (uLong)(ulDosDate>>16);
+    ptm->tm_mday = (uInt)(uDate&0x1f) ;
+    ptm->tm_mon =  (uInt)((((uDate)&0x1E0)/0x20)-1) ;
+    ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ;
+
+    ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800);
+    ptm->tm_min =  (uInt) ((ulDosDate&0x7E0)/0x20) ;
+    ptm->tm_sec =  (uInt) (2*(ulDosDate&0x1f)) ;
+}
+
+/*
+  Get Info about the current file in the zipfile, with internal only info
+*/
+local int unzlocal_GetCurrentFileInfoInternal OF((unzFile file,
+                                                  unz_file_info *pfile_info,
+                                                  unz_file_info_internal
+                                                  *pfile_info_internal,
+                                                  char *szFileName,
+                                                  uLong fileNameBufferSize,
+                                                  void *extraField,
+                                                  uLong extraFieldBufferSize,
+                                                  char *szComment,
+                                                  uLong commentBufferSize));
+
+local int unzlocal_GetCurrentFileInfoInternal (file,
+                                              pfile_info,
+                                              pfile_info_internal,
+                                              szFileName, fileNameBufferSize,
+                                              extraField, extraFieldBufferSize,
+                                              szComment,  commentBufferSize)
+    unzFile file;
+    unz_file_info *pfile_info;
+    unz_file_info_internal *pfile_info_internal;
+    char *szFileName;
+    uLong fileNameBufferSize;
+    void *extraField;
+    uLong extraFieldBufferSize;
+    char *szComment;
+    uLong commentBufferSize;
+{
+    unz_s* s;
+    unz_file_info file_info;
+    unz_file_info_internal file_info_internal;
+    int err=UNZ_OK;
+    uLong uMagic;
+    long lSeek=0;
+
+    if (file==NULL)
+        return UNZ_PARAMERROR;
+    s=(unz_s*)file;
+    if (ZSEEK(s->z_filefunc, s->filestream,
+              s->pos_in_central_dir+s->byte_before_the_zipfile,
+              ZLIB_FILEFUNC_SEEK_SET)!=0)
+        err=UNZ_ERRNO;
+
+
+    /* we check the magic */
+    if (err==UNZ_OK)
+        if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK)
+            err=UNZ_ERRNO;
+        else if (uMagic!=0x02014b50)
+            err=UNZ_BADZIPFILE;
+
+    if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.version) != UNZ_OK)
+        err=UNZ_ERRNO;
+
+    if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.version_needed) != UNZ_OK)
+        err=UNZ_ERRNO;
+
+    if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.flag) != UNZ_OK)
+        err=UNZ_ERRNO;
+
+    if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.compression_method) != UNZ_OK)
+        err=UNZ_ERRNO;
+
+    if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.dosDate) != UNZ_OK)
+        err=UNZ_ERRNO;
+
+    unzlocal_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date);
+
+    if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.crc) != UNZ_OK)
+        err=UNZ_ERRNO;
+
+    if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.compressed_size) != UNZ_OK)
+        err=UNZ_ERRNO;
+
+    if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.uncompressed_size) != UNZ_OK)
+        err=UNZ_ERRNO;
+
+    if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_filename) != UNZ_OK)
+        err=UNZ_ERRNO;
+
+    if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_extra) != UNZ_OK)
+        err=UNZ_ERRNO;
+
+    if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_comment) != UNZ_OK)
+        err=UNZ_ERRNO;
+
+    if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.disk_num_start) != UNZ_OK)
+        err=UNZ_ERRNO;
+
+    if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.internal_fa) != UNZ_OK)
+        err=UNZ_ERRNO;
+
+    if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.external_fa) != UNZ_OK)
+        err=UNZ_ERRNO;
+
+    if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info_internal.offset_curfile) != UNZ_OK)
+        err=UNZ_ERRNO;
+
+    lSeek+=file_info.size_filename;
+    if ((err==UNZ_OK) && (szFileName!=NULL))
+    {
+        uLong uSizeRead ;
+        if (file_info.size_filename<fileNameBufferSize)
+        {
+            *(szFileName+file_info.size_filename)='\0';
+            uSizeRead = file_info.size_filename;
+        }
+        else
+            uSizeRead = fileNameBufferSize;
+
+        if ((file_info.size_filename>0) && (fileNameBufferSize>0))
+            if (ZREAD(s->z_filefunc, s->filestream,szFileName,uSizeRead)!=uSizeRead)
+                err=UNZ_ERRNO;
+        lSeek -= uSizeRead;
+    }
+
+
+    if ((err==UNZ_OK) && (extraField!=NULL))
+    {
+        uLong uSizeRead ;
+        if (file_info.size_file_extra<extraFieldBufferSize)
+            uSizeRead = file_info.size_file_extra;
+        else
+            uSizeRead = extraFieldBufferSize;
+
+        if (lSeek!=0)
+            if (ZSEEK(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
+                lSeek=0;
+            else
+                err=UNZ_ERRNO;
+        if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0))
+            if (ZREAD(s->z_filefunc, s->filestream,extraField,uSizeRead)!=uSizeRead)
+                err=UNZ_ERRNO;
+        lSeek += file_info.size_file_extra - uSizeRead;
+    }
+    else
+        lSeek+=file_info.size_file_extra;
+
+
+    if ((err==UNZ_OK) && (szComment!=NULL))
+    {
+        uLong uSizeRead ;
+        if (file_info.size_file_comment<commentBufferSize)
+        {
+            *(szComment+file_info.size_file_comment)='\0';
+            uSizeRead = file_info.size_file_comment;
+        }
+        else
+            uSizeRead = commentBufferSize;
+
+        if (lSeek!=0)
+            if (ZSEEK(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
+                lSeek=0;
+            else
+                err=UNZ_ERRNO;
+        if ((file_info.size_file_comment>0) && (commentBufferSize>0))
+            if (ZREAD(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead)
+                err=UNZ_ERRNO;
+        lSeek+=file_info.size_file_comment - uSizeRead;
+    }
+    else
+        lSeek+=file_info.size_file_comment;
+
+    if ((err==UNZ_OK) && (pfile_info!=NULL))
+        *pfile_info=file_info;
+
+    if ((err==UNZ_OK) && (pfile_info_internal!=NULL))
+        *pfile_info_internal=file_info_internal;
+
+    return err;
+}
+
+
+
+/*
+  Write info about the ZipFile in the *pglobal_info structure.
+  No preparation of the structure is needed
+  return UNZ_OK if there is no problem.
+*/
+extern int ZEXPORT unzGetCurrentFileInfo (file,
+                                          pfile_info,
+                                          szFileName, fileNameBufferSize,
+                                          extraField, extraFieldBufferSize,
+                                          szComment,  commentBufferSize)
+    unzFile file;
+    unz_file_info *pfile_info;
+    char *szFileName;
+    uLong fileNameBufferSize;
+    void *extraField;
+    uLong extraFieldBufferSize;
+    char *szComment;
+    uLong commentBufferSize;
+{
+    return unzlocal_GetCurrentFileInfoInternal(file,pfile_info,NULL,
+                                                szFileName,fileNameBufferSize,
+                                                extraField,extraFieldBufferSize,
+                                                szComment,commentBufferSize);
+}
+
+/*
+  Set the current file of the zipfile to the first file.
+  return UNZ_OK if there is no problem
+*/
+extern int ZEXPORT unzGoToFirstFile (file)
+    unzFile file;
+{
+    int err=UNZ_OK;
+    unz_s* s;
+    if (file==NULL)
+        return UNZ_PARAMERROR;
+    s=(unz_s*)file;
+    s->pos_in_central_dir=s->offset_central_dir;
+    s->num_file=0;
+    err=unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info,
+                                             &s->cur_file_info_internal,
+                                             NULL,0,NULL,0,NULL,0);
+    s->current_file_ok = (err == UNZ_OK);
+    return err;
+}
+
+/*
+  Set the current file of the zipfile to the next file.
+  return UNZ_OK if there is no problem
+  return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
+*/
+extern int ZEXPORT unzGoToNextFile (file)
+    unzFile file;
+{
+    unz_s* s;
+    int err;
+
+    if (file==NULL)
+        return UNZ_PARAMERROR;
+    s=(unz_s*)file;
+    if (!s->current_file_ok)
+        return UNZ_END_OF_LIST_OF_FILE;
+    if (s->gi.number_entry != 0xffff)    /* 2^16 files overflow hack */
+      if (s->num_file+1==s->gi.number_entry)
+        return UNZ_END_OF_LIST_OF_FILE;
+
+    s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename +
+            s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ;
+    s->num_file++;
+    err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info,
+                                               &s->cur_file_info_internal,
+                                               NULL,0,NULL,0,NULL,0);
+    s->current_file_ok = (err == UNZ_OK);
+    return err;
+}
+
+
+/*
+  Try locate the file szFileName in the zipfile.
+  For the iCaseSensitivity signification, see unzipStringFileNameCompare
+
+  return value :
+  UNZ_OK if the file is found. It becomes the current file.
+  UNZ_END_OF_LIST_OF_FILE if the file is not found
+*/
+extern int ZEXPORT unzLocateFile (file, szFileName, iCaseSensitivity)
+    unzFile file;
+    const char *szFileName;
+    int iCaseSensitivity;
+{
+    unz_s* s;
+    int err;
+
+    /* We remember the 'current' position in the file so that we can jump
+     * back there if we fail.
+     */
+    unz_file_info cur_file_infoSaved;
+    unz_file_info_internal cur_file_info_internalSaved;
+    uLong num_fileSaved;
+    uLong pos_in_central_dirSaved;
+
+
+    if (file==NULL)
+        return UNZ_PARAMERROR;
+
+    if (strlen(szFileName)>=UNZ_MAXFILENAMEINZIP)
+        return UNZ_PARAMERROR;
+
+    s=(unz_s*)file;
+    if (!s->current_file_ok)
+        return UNZ_END_OF_LIST_OF_FILE;
+
+    /* Save the current state */
+    num_fileSaved = s->num_file;
+    pos_in_central_dirSaved = s->pos_in_central_dir;
+    cur_file_infoSaved = s->cur_file_info;
+    cur_file_info_internalSaved = s->cur_file_info_internal;
+
+    err = unzGoToFirstFile(file);
+
+    while (err == UNZ_OK)
+    {
+        char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1];
+        err = unzGetCurrentFileInfo(file,NULL,
+                                    szCurrentFileName,sizeof(szCurrentFileName)-1,
+                                    NULL,0,NULL,0);
+        if (err == UNZ_OK)
+        {
+            if (unzStringFileNameCompare(szCurrentFileName,
+                                            szFileName,iCaseSensitivity)==0)
+                return UNZ_OK;
+            err = unzGoToNextFile(file);
+        }
+    }
+
+    /* We failed, so restore the state of the 'current file' to where we
+     * were.
+     */
+    s->num_file = num_fileSaved ;
+    s->pos_in_central_dir = pos_in_central_dirSaved ;
+    s->cur_file_info = cur_file_infoSaved;
+    s->cur_file_info_internal = cur_file_info_internalSaved;
+    return err;
+}
+
+
+/*
+///////////////////////////////////////////
+// Contributed by Ryan Haksi (mailto://cryogen@infoserve.net)
+// I need random access
+//
+// Further optimization could be realized by adding an ability
+// to cache the directory in memory. The goal being a single
+// comprehensive file read to put the file I need in a memory.
+*/
+
+/*
+typedef struct unz_file_pos_s
+{
+    uLong pos_in_zip_directory;   // offset in file
+    uLong num_of_file;            // # of file
+} unz_file_pos;
+*/
+
+extern int ZEXPORT unzGetFilePos(file, file_pos)
+    unzFile file;
+    unz_file_pos* file_pos;
+{
+    unz_s* s;
+
+    if (file==NULL || file_pos==NULL)
+        return UNZ_PARAMERROR;
+    s=(unz_s*)file;
+    if (!s->current_file_ok)
+        return UNZ_END_OF_LIST_OF_FILE;
+
+    file_pos->pos_in_zip_directory  = s->pos_in_central_dir;
+    file_pos->num_of_file           = s->num_file;
+
+    return UNZ_OK;
+}
+
+extern int ZEXPORT unzGoToFilePos(file, file_pos)
+    unzFile file;
+    unz_file_pos* file_pos;
+{
+    unz_s* s;
+    int err;
+
+    if (file==NULL || file_pos==NULL)
+        return UNZ_PARAMERROR;
+    s=(unz_s*)file;
+
+    /* jump to the right spot */
+    s->pos_in_central_dir = file_pos->pos_in_zip_directory;
+    s->num_file           = file_pos->num_of_file;
+
+    /* set the current file */
+    err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info,
+                                               &s->cur_file_info_internal,
+                                               NULL,0,NULL,0,NULL,0);
+    /* return results */
+    s->current_file_ok = (err == UNZ_OK);
+    return err;
+}
+
+/*
+// Unzip Helper Functions - should be here?
+///////////////////////////////////////////
+*/
+
+/*
+  Read the local header of the current zipfile
+  Check the coherency of the local header and info in the end of central
+        directory about this file
+  store in *piSizeVar the size of extra info in local header
+        (filename and size of extra field data)
+*/
+local int unzlocal_CheckCurrentFileCoherencyHeader (s,piSizeVar,
+                                                    poffset_local_extrafield,
+                                                    psize_local_extrafield)
+    unz_s* s;
+    uInt* piSizeVar;
+    uLong *poffset_local_extrafield;
+    uInt  *psize_local_extrafield;
+{
+    uLong uMagic,uData,uFlags;
+    uLong size_filename;
+    uLong size_extra_field;
+    int err=UNZ_OK;
+
+    *piSizeVar = 0;
+    *poffset_local_extrafield = 0;
+    *psize_local_extrafield = 0;
+
+    if (ZSEEK(s->z_filefunc, s->filestream,s->cur_file_info_internal.offset_curfile +
+                                s->byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0)
+        return UNZ_ERRNO;
+
+
+    if (err==UNZ_OK)
+        if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK)
+            err=UNZ_ERRNO;
+        else if (uMagic!=0x04034b50)
+            err=UNZ_BADZIPFILE;
+
+    if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK)
+        err=UNZ_ERRNO;
+/*
+    else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion))
+        err=UNZ_BADZIPFILE;
+*/
+    if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uFlags) != UNZ_OK)
+        err=UNZ_ERRNO;
+
+    if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK)
+        err=UNZ_ERRNO;
+    else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method))
+        err=UNZ_BADZIPFILE;
+
+    if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) &&
+                         (s->cur_file_info.compression_method!=Z_DEFLATED))
+        err=UNZ_BADZIPFILE;
+
+    if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* date/time */
+        err=UNZ_ERRNO;
+
+    if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* crc */
+        err=UNZ_ERRNO;
+    else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) &&
+                              ((uFlags & 8)==0))
+        err=UNZ_BADZIPFILE;
+
+    if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size compr */
+        err=UNZ_ERRNO;
+    else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) &&
+                              ((uFlags & 8)==0))
+        err=UNZ_BADZIPFILE;
+
+    if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size uncompr */
+        err=UNZ_ERRNO;
+    else if ((err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) &&
+                              ((uFlags & 8)==0))
+        err=UNZ_BADZIPFILE;
+
+
+    if (unzlocal_getShort(&s->z_filefunc, s->filestream,&size_filename) != UNZ_OK)
+        err=UNZ_ERRNO;
+    else if ((err==UNZ_OK) && (size_filename!=s->cur_file_info.size_filename))
+        err=UNZ_BADZIPFILE;
+
+    *piSizeVar += (uInt)size_filename;
+
+    if (unzlocal_getShort(&s->z_filefunc, s->filestream,&size_extra_field) != UNZ_OK)
+        err=UNZ_ERRNO;
+    *poffset_local_extrafield= s->cur_file_info_internal.offset_curfile +
+                                    SIZEZIPLOCALHEADER + size_filename;
+    *psize_local_extrafield = (uInt)size_extra_field;
+
+    *piSizeVar += (uInt)size_extra_field;
+
+    return err;
+}
+
+/*
+  Open for reading data the current file in the zipfile.
+  If there is no error and the file is opened, the return value is UNZ_OK.
+*/
+extern int ZEXPORT unzOpenCurrentFile3 (file, method, level, raw, password)
+    unzFile file;
+    int* method;
+    int* level;
+    int raw;
+    const char* password;
+{
+    int err=UNZ_OK;
+    uInt iSizeVar;
+    unz_s* s;
+    file_in_zip_read_info_s* pfile_in_zip_read_info;
+    uLong offset_local_extrafield;  /* offset of the local extra field */
+    uInt  size_local_extrafield;    /* size of the local extra field */
+#    ifndef NOUNCRYPT
+    char source[12];
+#    else
+    if (password != NULL)
+        return UNZ_PARAMERROR;
+#    endif
+
+    if (file==NULL)
+        return UNZ_PARAMERROR;
+    s=(unz_s*)file;
+    if (!s->current_file_ok)
+        return UNZ_PARAMERROR;
+
+    if (s->pfile_in_zip_read != NULL)
+        unzCloseCurrentFile(file);
+
+    if (unzlocal_CheckCurrentFileCoherencyHeader(s,&iSizeVar,
+                &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK)
+        return UNZ_BADZIPFILE;
+
+    pfile_in_zip_read_info = (file_in_zip_read_info_s*)
+                                        ALLOC(sizeof(file_in_zip_read_info_s));
+    if (pfile_in_zip_read_info==NULL)
+        return UNZ_INTERNALERROR;
+
+    pfile_in_zip_read_info->read_buffer=(char*)ALLOC(UNZ_BUFSIZE);
+    pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield;
+    pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield;
+    pfile_in_zip_read_info->pos_local_extrafield=0;
+    pfile_in_zip_read_info->raw=raw;
+
+    if (pfile_in_zip_read_info->read_buffer==NULL)
+    {
+        TRYFREE(pfile_in_zip_read_info);
+        return UNZ_INTERNALERROR;
+    }
+
+    pfile_in_zip_read_info->stream_initialised=0;
+
+    if (method!=NULL)
+        *method = (int)s->cur_file_info.compression_method;
+
+    if (level!=NULL)
+    {
+        *level = 6;
+        switch (s->cur_file_info.flag & 0x06)
+        {
+          case 6 : *level = 1; break;
+          case 4 : *level = 2; break;
+          case 2 : *level = 9; break;
+        }
+    }
+
+    if ((s->cur_file_info.compression_method!=0) &&
+        (s->cur_file_info.compression_method!=Z_DEFLATED))
+        err=UNZ_BADZIPFILE;
+
+    pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc;
+    pfile_in_zip_read_info->crc32=0;
+    pfile_in_zip_read_info->compression_method =
+            s->cur_file_info.compression_method;
+    pfile_in_zip_read_info->filestream=s->filestream;
+    pfile_in_zip_read_info->z_filefunc=s->z_filefunc;
+    pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile;
+
+    pfile_in_zip_read_info->stream.total_out = 0;
+
+    if ((s->cur_file_info.compression_method==Z_DEFLATED) &&
+        (!raw))
+    {
+      pfile_in_zip_read_info->stream.zalloc = (alloc_func)0;
+      pfile_in_zip_read_info->stream.zfree = (free_func)0;
+      pfile_in_zip_read_info->stream.opaque = (voidpf)0;
+      pfile_in_zip_read_info->stream.next_in = (voidpf)0;
+      pfile_in_zip_read_info->stream.avail_in = 0;
+
+      err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS);
+      if (err == Z_OK)
+        pfile_in_zip_read_info->stream_initialised=1;
+      else
+      {
+        TRYFREE(pfile_in_zip_read_info);
+        return err;
+      }
+        /* windowBits is passed < 0 to tell that there is no zlib header.
+         * Note that in this case inflate *requires* an extra "dummy" byte
+         * after the compressed stream in order to complete decompression and
+         * return Z_STREAM_END.
+         * In unzip, i don't wait absolutely Z_STREAM_END because I known the
+         * size of both compressed and uncompressed data
+         */
+    }
+    pfile_in_zip_read_info->rest_read_compressed =
+            s->cur_file_info.compressed_size ;
+    pfile_in_zip_read_info->rest_read_uncompressed =
+            s->cur_file_info.uncompressed_size ;
+
+
+    pfile_in_zip_read_info->pos_in_zipfile =
+            s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER +
+              iSizeVar;
+
+    pfile_in_zip_read_info->stream.avail_in = (uInt)0;
+
+    s->pfile_in_zip_read = pfile_in_zip_read_info;
+
+#    ifndef NOUNCRYPT
+    if (password != NULL)
+    {
+        int i;
+        s->pcrc_32_tab = get_crc_table();
+        init_keys(password,s->keys,s->pcrc_32_tab);
+        if (ZSEEK(s->z_filefunc, s->filestream,
+                  s->pfile_in_zip_read->pos_in_zipfile +
+                     s->pfile_in_zip_read->byte_before_the_zipfile,
+                  SEEK_SET)!=0)
+            return UNZ_INTERNALERROR;
+        if(ZREAD(s->z_filefunc, s->filestream,source, 12)<12)
+            return UNZ_INTERNALERROR;
+
+        for (i = 0; i<12; i++)
+            zdecode(s->keys,s->pcrc_32_tab,source[i]);
+
+        s->pfile_in_zip_read->pos_in_zipfile+=12;
+        s->encrypted=1;
+    }
+#    endif
+
+
+    return UNZ_OK;
+}
+
+extern int ZEXPORT unzOpenCurrentFile (file)
+    unzFile file;
+{
+    return unzOpenCurrentFile3(file, NULL, NULL, 0, NULL);
+}
+
+extern int ZEXPORT unzOpenCurrentFilePassword (file, password)
+    unzFile file;
+    const char* password;
+{
+    return unzOpenCurrentFile3(file, NULL, NULL, 0, password);
+}
+
+extern int ZEXPORT unzOpenCurrentFile2 (file,method,level,raw)
+    unzFile file;
+    int* method;
+    int* level;
+    int raw;
+{
+    return unzOpenCurrentFile3(file, method, level, raw, NULL);
+}
+
+/*
+  Read bytes from the current file.
+  buf contain buffer where data must be copied
+  len the size of buf.
+
+  return the number of byte copied if somes bytes are copied
+  return 0 if the end of file was reached
+  return <0 with error code if there is an error
+    (UNZ_ERRNO for IO error, or zLib error for uncompress error)
+*/
+extern int ZEXPORT unzReadCurrentFile  (file, buf, len)
+    unzFile file;
+    voidp buf;
+    unsigned len;
+{
+    int err=UNZ_OK;
+    uInt iRead = 0;
+    unz_s* s;
+    file_in_zip_read_info_s* pfile_in_zip_read_info;
+    if (file==NULL)
+        return UNZ_PARAMERROR;
+    s=(unz_s*)file;
+    pfile_in_zip_read_info=s->pfile_in_zip_read;
+
+    if (pfile_in_zip_read_info==NULL)
+        return UNZ_PARAMERROR;
+
+
+    if ((pfile_in_zip_read_info->read_buffer == NULL))
+        return UNZ_END_OF_LIST_OF_FILE;
+    if (len==0)
+        return 0;
+
+    pfile_in_zip_read_info->stream.next_out = (Bytef*)buf;
+
+    pfile_in_zip_read_info->stream.avail_out = (uInt)len;
+
+    if ((len>pfile_in_zip_read_info->rest_read_uncompressed) &&
+        (!(pfile_in_zip_read_info->raw)))
+        pfile_in_zip_read_info->stream.avail_out =
+            (uInt)pfile_in_zip_read_info->rest_read_uncompressed;
+
+    if ((len>pfile_in_zip_read_info->rest_read_compressed+
+           pfile_in_zip_read_info->stream.avail_in) &&
+         (pfile_in_zip_read_info->raw))
+        pfile_in_zip_read_info->stream.avail_out =
+            (uInt)pfile_in_zip_read_info->rest_read_compressed+
+            pfile_in_zip_read_info->stream.avail_in;
+
+    while (pfile_in_zip_read_info->stream.avail_out>0)
+    {
+        if ((pfile_in_zip_read_info->stream.avail_in==0) &&
+            (pfile_in_zip_read_info->rest_read_compressed>0))
+        {
+            uInt uReadThis = UNZ_BUFSIZE;
+            if (pfile_in_zip_read_info->rest_read_compressed<uReadThis)
+                uReadThis = (uInt)pfile_in_zip_read_info->rest_read_compressed;
+            if (uReadThis == 0)
+                return UNZ_EOF;
+            if (ZSEEK(pfile_in_zip_read_info->z_filefunc,
+                      pfile_in_zip_read_info->filestream,
+                      pfile_in_zip_read_info->pos_in_zipfile +
+                         pfile_in_zip_read_info->byte_before_the_zipfile,
+                         ZLIB_FILEFUNC_SEEK_SET)!=0)
+                return UNZ_ERRNO;
+            if (ZREAD(pfile_in_zip_read_info->z_filefunc,
+                      pfile_in_zip_read_info->filestream,
+                      pfile_in_zip_read_info->read_buffer,
+                      uReadThis)!=uReadThis)
+                return UNZ_ERRNO;
+
+
+#            ifndef NOUNCRYPT
+            if(s->encrypted)
+            {
+                uInt i;
+                for(i=0;i<uReadThis;i++)
+                  pfile_in_zip_read_info->read_buffer[i] =
+                      zdecode(s->keys,s->pcrc_32_tab,
+                              pfile_in_zip_read_info->read_buffer[i]);
+            }
+#            endif
+
+
+            pfile_in_zip_read_info->pos_in_zipfile += uReadThis;
+
+            pfile_in_zip_read_info->rest_read_compressed-=uReadThis;
+
+            pfile_in_zip_read_info->stream.next_in =
+                (Bytef*)pfile_in_zip_read_info->read_buffer;
+            pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis;
+        }
+
+        if ((pfile_in_zip_read_info->compression_method==0) || (pfile_in_zip_read_info->raw))
+        {
+            uInt uDoCopy,i ;
+
+            if ((pfile_in_zip_read_info->stream.avail_in == 0) &&
+                (pfile_in_zip_read_info->rest_read_compressed == 0))
+                return (iRead==0) ? UNZ_EOF : iRead;
+
+            if (pfile_in_zip_read_info->stream.avail_out <
+                            pfile_in_zip_read_info->stream.avail_in)
+                uDoCopy = pfile_in_zip_read_info->stream.avail_out ;
+            else
+                uDoCopy = pfile_in_zip_read_info->stream.avail_in ;
+
+            for (i=0;i<uDoCopy;i++)
+                *(pfile_in_zip_read_info->stream.next_out+i) =
+                        *(pfile_in_zip_read_info->stream.next_in+i);
+
+            pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32,
+                                pfile_in_zip_read_info->stream.next_out,
+                                uDoCopy);
+            pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy;
+            pfile_in_zip_read_info->stream.avail_in -= uDoCopy;
+            pfile_in_zip_read_info->stream.avail_out -= uDoCopy;
+            pfile_in_zip_read_info->stream.next_out += uDoCopy;
+            pfile_in_zip_read_info->stream.next_in += uDoCopy;
+            pfile_in_zip_read_info->stream.total_out += uDoCopy;
+            iRead += uDoCopy;
+        }
+        else
+        {
+            uLong uTotalOutBefore,uTotalOutAfter;
+            const Bytef *bufBefore;
+            uLong uOutThis;
+            int flush=Z_SYNC_FLUSH;
+
+            uTotalOutBefore = pfile_in_zip_read_info->stream.total_out;
+            bufBefore = pfile_in_zip_read_info->stream.next_out;
+
+            /*
+            if ((pfile_in_zip_read_info->rest_read_uncompressed ==
+                     pfile_in_zip_read_info->stream.avail_out) &&
+                (pfile_in_zip_read_info->rest_read_compressed == 0))
+                flush = Z_FINISH;
+            */
+            err=inflate(&pfile_in_zip_read_info->stream,flush);
+
+            if ((err>=0) && (pfile_in_zip_read_info->stream.msg!=NULL))
+              err = Z_DATA_ERROR;
+
+            uTotalOutAfter = pfile_in_zip_read_info->stream.total_out;
+            uOutThis = uTotalOutAfter-uTotalOutBefore;
+
+            pfile_in_zip_read_info->crc32 =
+                crc32(pfile_in_zip_read_info->crc32,bufBefore,
+                        (uInt)(uOutThis));
+
+            pfile_in_zip_read_info->rest_read_uncompressed -=
+                uOutThis;
+
+            iRead += (uInt)(uTotalOutAfter - uTotalOutBefore);
+
+            if (err==Z_STREAM_END)
+                return (iRead==0) ? UNZ_EOF : iRead;
+            if (err!=Z_OK)
+                break;
+        }
+    }
+
+    if (err==Z_OK)
+        return iRead;
+    return err;
+}
+
+
+/*
+  Give the current position in uncompressed data
+*/
+extern z_off_t ZEXPORT unztell (file)
+    unzFile file;
+{
+    unz_s* s;
+    file_in_zip_read_info_s* pfile_in_zip_read_info;
+    if (file==NULL)
+        return UNZ_PARAMERROR;
+    s=(unz_s*)file;
+    pfile_in_zip_read_info=s->pfile_in_zip_read;
+
+    if (pfile_in_zip_read_info==NULL)
+        return UNZ_PARAMERROR;
+
+    return (z_off_t)pfile_in_zip_read_info->stream.total_out;
+}
+
+
+/*
+  return 1 if the end of file was reached, 0 elsewhere
+*/
+extern int ZEXPORT unzeof (file)
+    unzFile file;
+{
+    unz_s* s;
+    file_in_zip_read_info_s* pfile_in_zip_read_info;
+    if (file==NULL)
+        return UNZ_PARAMERROR;
+    s=(unz_s*)file;
+    pfile_in_zip_read_info=s->pfile_in_zip_read;
+
+    if (pfile_in_zip_read_info==NULL)
+        return UNZ_PARAMERROR;
+
+    if (pfile_in_zip_read_info->rest_read_uncompressed == 0)
+        return 1;
+    else
+        return 0;
+}
+
+
+
+/*
+  Read extra field from the current file (opened by unzOpenCurrentFile)
+  This is the local-header version of the extra field (sometimes, there is
+    more info in the local-header version than in the central-header)
+
+  if buf==NULL, it return the size of the local extra field that can be read
+
+  if buf!=NULL, len is the size of the buffer, the extra header is copied in
+    buf.
+  the return value is the number of bytes copied in buf, or (if <0)
+    the error code
+*/
+extern int ZEXPORT unzGetLocalExtrafield (file,buf,len)
+    unzFile file;
+    voidp buf;
+    unsigned len;
+{
+    unz_s* s;
+    file_in_zip_read_info_s* pfile_in_zip_read_info;
+    uInt read_now;
+    uLong size_to_read;
+
+    if (file==NULL)
+        return UNZ_PARAMERROR;
+    s=(unz_s*)file;
+    pfile_in_zip_read_info=s->pfile_in_zip_read;
+
+    if (pfile_in_zip_read_info==NULL)
+        return UNZ_PARAMERROR;
+
+    size_to_read = (pfile_in_zip_read_info->size_local_extrafield -
+                pfile_in_zip_read_info->pos_local_extrafield);
+
+    if (buf==NULL)
+        return (int)size_to_read;
+
+    if (len>size_to_read)
+        read_now = (uInt)size_to_read;
+    else
+        read_now = (uInt)len ;
+
+    if (read_now==0)
+        return 0;
+
+    if (ZSEEK(pfile_in_zip_read_info->z_filefunc,
+              pfile_in_zip_read_info->filestream,
+              pfile_in_zip_read_info->offset_local_extrafield +
+              pfile_in_zip_read_info->pos_local_extrafield,
+              ZLIB_FILEFUNC_SEEK_SET)!=0)
+        return UNZ_ERRNO;
+
+    if (ZREAD(pfile_in_zip_read_info->z_filefunc,
+              pfile_in_zip_read_info->filestream,
+              buf,read_now)!=read_now)
+        return UNZ_ERRNO;
+
+    return (int)read_now;
+}
+
+/*
+  Close the file in zip opened with unzipOpenCurrentFile
+  Return UNZ_CRCERROR if all the file was read but the CRC is not good
+*/
+extern int ZEXPORT unzCloseCurrentFile (file)
+    unzFile file;
+{
+    int err=UNZ_OK;
+
+    unz_s* s;
+    file_in_zip_read_info_s* pfile_in_zip_read_info;
+    if (file==NULL)
+        return UNZ_PARAMERROR;
+    s=(unz_s*)file;
+    pfile_in_zip_read_info=s->pfile_in_zip_read;
+
+    if (pfile_in_zip_read_info==NULL)
+        return UNZ_PARAMERROR;
+
+
+    if ((pfile_in_zip_read_info->rest_read_uncompressed == 0) &&
+        (!pfile_in_zip_read_info->raw))
+    {
+        if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait)
+            err=UNZ_CRCERROR;
+    }
+
+
+    TRYFREE(pfile_in_zip_read_info->read_buffer);
+    pfile_in_zip_read_info->read_buffer = NULL;
+    if (pfile_in_zip_read_info->stream_initialised)
+        inflateEnd(&pfile_in_zip_read_info->stream);
+
+    pfile_in_zip_read_info->stream_initialised = 0;
+    TRYFREE(pfile_in_zip_read_info);
+
+    s->pfile_in_zip_read=NULL;
+
+    return err;
+}
+
+
+/*
+  Get the global comment string of the ZipFile, in the szComment buffer.
+  uSizeBuf is the size of the szComment buffer.
+  return the number of byte copied or an error code <0
+*/
+extern int ZEXPORT unzGetGlobalComment (file, szComment, uSizeBuf)
+    unzFile file;
+    char *szComment;
+    uLong uSizeBuf;
+{
+    int err=UNZ_OK;
+    unz_s* s;
+    uLong uReadThis ;
+    if (file==NULL)
+        return UNZ_PARAMERROR;
+    s=(unz_s*)file;
+
+    uReadThis = uSizeBuf;
+    if (uReadThis>s->gi.size_comment)
+        uReadThis = s->gi.size_comment;
+
+    if (ZSEEK(s->z_filefunc,s->filestream,s->central_pos+22,ZLIB_FILEFUNC_SEEK_SET)!=0)
+        return UNZ_ERRNO;
+
+    if (uReadThis>0)
+    {
+      *szComment='\0';
+      if (ZREAD(s->z_filefunc,s->filestream,szComment,uReadThis)!=uReadThis)
+        return UNZ_ERRNO;
+    }
+
+    if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment))
+        *(szComment+s->gi.size_comment)='\0';
+    return (int)uReadThis;
+}
+
+/* Additions by RX '2004 */
+extern uLong ZEXPORT unzGetOffset (file)
+    unzFile file;
+{
+    unz_s* s;
+
+    if (file==NULL)
+          return UNZ_PARAMERROR;
+    s=(unz_s*)file;
+    if (!s->current_file_ok)
+      return 0;
+    if (s->gi.number_entry != 0 && s->gi.number_entry != 0xffff)
+      if (s->num_file==s->gi.number_entry)
+         return 0;
+    return s->pos_in_central_dir;
+}
+
+extern int ZEXPORT unzSetOffset (file, pos)
+        unzFile file;
+        uLong pos;
+{
+    unz_s* s;
+    int err;
+
+    if (file==NULL)
+        return UNZ_PARAMERROR;
+    s=(unz_s*)file;
+
+    s->pos_in_central_dir = pos;
+    s->num_file = s->gi.number_entry;      /* hack */
+    err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info,
+                                              &s->cur_file_info_internal,
+                                              NULL,0,NULL,0,NULL,0);
+    s->current_file_ok = (err == UNZ_OK);
+    return err;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/zlib/unzip.h	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,354 @@
+/* unzip.h -- IO for uncompress .zip files using zlib
+   Version 1.01e, February 12th, 2005
+
+   Copyright (C) 1998-2005 Gilles Vollant
+
+   This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g
+     WinZip, InfoZip tools and compatible.
+
+   Multi volume ZipFile (span) are not supported.
+   Encryption compatible with pkzip 2.04g only supported
+   Old compressions used by old PKZip 1.x are not supported
+
+
+   I WAIT FEEDBACK at mail info@winimage.com
+   Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution
+
+   Condition of use and distribution are the same than zlib :
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+
+*/
+
+/* for more info about .ZIP format, see
+      http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip
+      http://www.info-zip.org/pub/infozip/doc/
+   PkWare has also a specification at :
+      ftp://ftp.pkware.com/probdesc.zip
+*/
+
+#ifndef _unz_H
+#define _unz_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _ZLIB_H
+#include "zlib.h"
+#endif
+
+#ifndef _ZLIBIOAPI_H
+#include "ioapi.h"
+#endif
+
+#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
+/* like the STRICT of WIN32, we define a pointer that cannot be converted
+    from (void*) without cast */
+typedef struct TagunzFile__ { int unused; } unzFile__;
+typedef unzFile__ *unzFile;
+#else
+typedef voidp unzFile;
+#endif
+
+
+#define UNZ_OK                          (0)
+#define UNZ_END_OF_LIST_OF_FILE         (-100)
+#define UNZ_ERRNO                       (Z_ERRNO)
+#define UNZ_EOF                         (0)
+#define UNZ_PARAMERROR                  (-102)
+#define UNZ_BADZIPFILE                  (-103)
+#define UNZ_INTERNALERROR               (-104)
+#define UNZ_CRCERROR                    (-105)
+
+/* tm_unz contain date/time info */
+typedef struct tm_unz_s
+{
+    uInt tm_sec;            /* seconds after the minute - [0,59] */
+    uInt tm_min;            /* minutes after the hour - [0,59] */
+    uInt tm_hour;           /* hours since midnight - [0,23] */
+    uInt tm_mday;           /* day of the month - [1,31] */
+    uInt tm_mon;            /* months since January - [0,11] */
+    uInt tm_year;           /* years - [1980..2044] */
+} tm_unz;
+
+/* unz_global_info structure contain global data about the ZIPfile
+   These data comes from the end of central dir */
+typedef struct unz_global_info_s
+{
+    uLong number_entry;         /* total number of entries in
+                       the central dir on this disk */
+    uLong size_comment;         /* size of the global comment of the zipfile */
+} unz_global_info;
+
+
+/* unz_file_info contain information about a file in the zipfile */
+typedef struct unz_file_info_s
+{
+    uLong version;              /* version made by                 2 bytes */
+    uLong version_needed;       /* version needed to extract       2 bytes */
+    uLong flag;                 /* general purpose bit flag        2 bytes */
+    uLong compression_method;   /* compression method              2 bytes */
+    uLong dosDate;              /* last mod file date in Dos fmt   4 bytes */
+    uLong crc;                  /* crc-32                          4 bytes */
+    uLong compressed_size;      /* compressed size                 4 bytes */
+    uLong uncompressed_size;    /* uncompressed size               4 bytes */
+    uLong size_filename;        /* filename length                 2 bytes */
+    uLong size_file_extra;      /* extra field length              2 bytes */
+    uLong size_file_comment;    /* file comment length             2 bytes */
+
+    uLong disk_num_start;       /* disk number start               2 bytes */
+    uLong internal_fa;          /* internal file attributes        2 bytes */
+    uLong external_fa;          /* external file attributes        4 bytes */
+
+    tm_unz tmu_date;
+} unz_file_info;
+
+extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
+                                                 const char* fileName2,
+                                                 int iCaseSensitivity));
+/*
+   Compare two filename (fileName1,fileName2).
+   If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
+   If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
+                                or strcasecmp)
+   If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
+    (like 1 on Unix, 2 on Windows)
+*/
+
+
+extern unzFile ZEXPORT unzOpen OF((const char *path));
+/*
+  Open a Zip file. path contain the full pathname (by example,
+     on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer
+     "zlib/zlib113.zip".
+     If the zipfile cannot be opened (file don't exist or in not valid), the
+       return value is NULL.
+     Else, the return value is a unzFile Handle, usable with other function
+       of this unzip package.
+*/
+
+extern unzFile ZEXPORT unzOpen2 OF((const char *path,
+                                    zlib_filefunc_def* pzlib_filefunc_def));
+/*
+   Open a Zip file, like unzOpen, but provide a set of file low level API
+      for read/write the zip file (see ioapi.h)
+*/
+
+extern int ZEXPORT unzClose OF((unzFile file));
+/*
+  Close a ZipFile opened with unzipOpen.
+  If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
+    these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
+  return UNZ_OK if there is no problem. */
+
+extern int ZEXPORT unzGetGlobalInfo OF((unzFile file,
+                                        unz_global_info *pglobal_info));
+/*
+  Write info about the ZipFile in the *pglobal_info structure.
+  No preparation of the structure is needed
+  return UNZ_OK if there is no problem. */
+
+
+extern int ZEXPORT unzGetGlobalComment OF((unzFile file,
+                                           char *szComment,
+                                           uLong uSizeBuf));
+/*
+  Get the global comment string of the ZipFile, in the szComment buffer.
+  uSizeBuf is the size of the szComment buffer.
+  return the number of byte copied or an error code <0
+*/
+
+
+/***************************************************************************/
+/* Unzip package allow you browse the directory of the zipfile */
+
+extern int ZEXPORT unzGoToFirstFile OF((unzFile file));
+/*
+  Set the current file of the zipfile to the first file.
+  return UNZ_OK if there is no problem
+*/
+
+extern int ZEXPORT unzGoToNextFile OF((unzFile file));
+/*
+  Set the current file of the zipfile to the next file.
+  return UNZ_OK if there is no problem
+  return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
+*/
+
+extern int ZEXPORT unzLocateFile OF((unzFile file,
+                     const char *szFileName,
+                     int iCaseSensitivity));
+/*
+  Try locate the file szFileName in the zipfile.
+  For the iCaseSensitivity signification, see unzStringFileNameCompare
+
+  return value :
+  UNZ_OK if the file is found. It becomes the current file.
+  UNZ_END_OF_LIST_OF_FILE if the file is not found
+*/
+
+
+/* ****************************************** */
+/* Ryan supplied functions */
+/* unz_file_info contain information about a file in the zipfile */
+typedef struct unz_file_pos_s
+{
+    uLong pos_in_zip_directory;   /* offset in zip file directory */
+    uLong num_of_file;            /* # of file */
+} unz_file_pos;
+
+extern int ZEXPORT unzGetFilePos(
+    unzFile file,
+    unz_file_pos* file_pos);
+
+extern int ZEXPORT unzGoToFilePos(
+    unzFile file,
+    unz_file_pos* file_pos);
+
+/* ****************************************** */
+
+extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
+                         unz_file_info *pfile_info,
+                         char *szFileName,
+                         uLong fileNameBufferSize,
+                         void *extraField,
+                         uLong extraFieldBufferSize,
+                         char *szComment,
+                         uLong commentBufferSize));
+/*
+  Get Info about the current file
+  if pfile_info!=NULL, the *pfile_info structure will contain somes info about
+        the current file
+  if szFileName!=NULL, the filemane string will be copied in szFileName
+            (fileNameBufferSize is the size of the buffer)
+  if extraField!=NULL, the extra field information will be copied in extraField
+            (extraFieldBufferSize is the size of the buffer).
+            This is the Central-header version of the extra field
+  if szComment!=NULL, the comment string of the file will be copied in szComment
+            (commentBufferSize is the size of the buffer)
+*/
+
+/***************************************************************************/
+/* for reading the content of the current zipfile, you can open it, read data
+   from it, and close it (you can close it before reading all the file)
+   */
+
+extern int ZEXPORT unzOpenCurrentFile OF((unzFile file));
+/*
+  Open for reading data the current file in the zipfile.
+  If there is no error, the return value is UNZ_OK.
+*/
+
+extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file,
+                                                  const char* password));
+/*
+  Open for reading data the current file in the zipfile.
+  password is a crypting password
+  If there is no error, the return value is UNZ_OK.
+*/
+
+extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file,
+                                           int* method,
+                                           int* level,
+                                           int raw));
+/*
+  Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
+    if raw==1
+  *method will receive method of compression, *level will receive level of
+     compression
+  note : you can set level parameter as NULL (if you did not want known level,
+         but you CANNOT set method parameter as NULL
+*/
+
+extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file,
+                                           int* method,
+                                           int* level,
+                                           int raw,
+                                           const char* password));
+/*
+  Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
+    if raw==1
+  *method will receive method of compression, *level will receive level of
+     compression
+  note : you can set level parameter as NULL (if you did not want known level,
+         but you CANNOT set method parameter as NULL
+*/
+
+
+extern int ZEXPORT unzCloseCurrentFile OF((unzFile file));
+/*
+  Close the file in zip opened with unzOpenCurrentFile
+  Return UNZ_CRCERROR if all the file was read but the CRC is not good
+*/
+
+extern int ZEXPORT unzReadCurrentFile OF((unzFile file,
+                      voidp buf,
+                      unsigned len));
+/*
+  Read bytes from the current file (opened by unzOpenCurrentFile)
+  buf contain buffer where data must be copied
+  len the size of buf.
+
+  return the number of byte copied if somes bytes are copied
+  return 0 if the end of file was reached
+  return <0 with error code if there is an error
+    (UNZ_ERRNO for IO error, or zLib error for uncompress error)
+*/
+
+extern z_off_t ZEXPORT unztell OF((unzFile file));
+/*
+  Give the current position in uncompressed data
+*/
+
+extern int ZEXPORT unzeof OF((unzFile file));
+/*
+  return 1 if the end of file was reached, 0 elsewhere
+*/
+
+extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
+                                             voidp buf,
+                                             unsigned len));
+/*
+  Read extra field from the current file (opened by unzOpenCurrentFile)
+  This is the local-header version of the extra field (sometimes, there is
+    more info in the local-header version than in the central-header)
+
+  if buf==NULL, it return the size of the local extra field
+
+  if buf!=NULL, len is the size of the buffer, the extra header is copied in
+    buf.
+  the return value is the number of bytes copied in buf, or (if <0)
+    the error code
+*/
+
+/***************************************************************************/
+
+/* Get the current file offset */
+extern uLong ZEXPORT unzGetOffset (unzFile file);
+
+/* Set the current file offset */
+extern int ZEXPORT unzSetOffset (unzFile file, uLong pos);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _unz_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/zlib/zconf.h	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,332 @@
+/* zconf.h -- configuration of the zlib compression library
+ * Copyright (C) 1995-2005 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id: zconf.h,v 1.1 2009/02/05 23:03:31 stechong Exp $ */
+
+#ifndef ZCONF_H
+#define ZCONF_H
+
+/*
+ * If you *really* need a unique prefix for all types and library functions,
+ * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
+ */
+#ifdef Z_PREFIX
+#  define deflateInit_          z_deflateInit_
+#  define deflate               z_deflate
+#  define deflateEnd            z_deflateEnd
+#  define inflateInit_          z_inflateInit_
+#  define inflate               z_inflate
+#  define inflateEnd            z_inflateEnd
+#  define deflateInit2_         z_deflateInit2_
+#  define deflateSetDictionary  z_deflateSetDictionary
+#  define deflateCopy           z_deflateCopy
+#  define deflateReset          z_deflateReset
+#  define deflateParams         z_deflateParams
+#  define deflateBound          z_deflateBound
+#  define deflatePrime          z_deflatePrime
+#  define inflateInit2_         z_inflateInit2_
+#  define inflateSetDictionary  z_inflateSetDictionary
+#  define inflateSync           z_inflateSync
+#  define inflateSyncPoint      z_inflateSyncPoint
+#  define inflateCopy           z_inflateCopy
+#  define inflateReset          z_inflateReset
+#  define inflateBack           z_inflateBack
+#  define inflateBackEnd        z_inflateBackEnd
+#  define compress              z_compress
+#  define compress2             z_compress2
+#  define compressBound         z_compressBound
+#  define uncompress            z_uncompress
+#  define adler32               z_adler32
+#  define crc32                 z_crc32
+#  define get_crc_table         z_get_crc_table
+#  define zError                z_zError
+
+#  define alloc_func            z_alloc_func
+#  define free_func             z_free_func
+#  define in_func               z_in_func
+#  define out_func              z_out_func
+#  define Byte                  z_Byte
+#  define uInt                  z_uInt
+#  define uLong                 z_uLong
+#  define Bytef                 z_Bytef
+#  define charf                 z_charf
+#  define intf                  z_intf
+#  define uIntf                 z_uIntf
+#  define uLongf                z_uLongf
+#  define voidpf                z_voidpf
+#  define voidp                 z_voidp
+#endif
+
+#if defined(__MSDOS__) && !defined(MSDOS)
+#  define MSDOS
+#endif
+#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
+#  define OS2
+#endif
+#if defined(_WINDOWS) && !defined(WINDOWS)
+#  define WINDOWS
+#endif
+#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
+#  ifndef WIN32
+#    define WIN32
+#  endif
+#endif
+#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
+#  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
+#    ifndef SYS16BIT
+#      define SYS16BIT
+#    endif
+#  endif
+#endif
+
+/*
+ * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
+ * than 64k bytes at a time (needed on systems with 16-bit int).
+ */
+#ifdef SYS16BIT
+#  define MAXSEG_64K
+#endif
+#ifdef MSDOS
+#  define UNALIGNED_OK
+#endif
+
+#ifdef __STDC_VERSION__
+#  ifndef STDC
+#    define STDC
+#  endif
+#  if __STDC_VERSION__ >= 199901L
+#    ifndef STDC99
+#      define STDC99
+#    endif
+#  endif
+#endif
+#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
+#  define STDC
+#endif
+#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
+#  define STDC
+#endif
+#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
+#  define STDC
+#endif
+#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
+#  define STDC
+#endif
+
+#if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */
+#  define STDC
+#endif
+
+#ifndef STDC
+#  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
+#    define const       /* note: need a more gentle solution here */
+#  endif
+#endif
+
+/* Some Mac compilers merge all .h files incorrectly: */
+#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
+#  define NO_DUMMY_DECL
+#endif
+
+/* Maximum value for memLevel in deflateInit2 */
+#ifndef MAX_MEM_LEVEL
+#  ifdef MAXSEG_64K
+#    define MAX_MEM_LEVEL 8
+#  else
+#    define MAX_MEM_LEVEL 9
+#  endif
+#endif
+
+/* Maximum value for windowBits in deflateInit2 and inflateInit2.
+ * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
+ * created by gzip. (Files created by minigzip can still be extracted by
+ * gzip.)
+ */
+#ifndef MAX_WBITS
+#  define MAX_WBITS   15 /* 32K LZ77 window */
+#endif
+
+/* The memory requirements for deflate are (in bytes):
+            (1 << (windowBits+2)) +  (1 << (memLevel+9))
+ that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
+ plus a few kilobytes for small objects. For example, if you want to reduce
+ the default memory requirements from 256K to 128K, compile with
+     make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
+ Of course this will generally degrade compression (there's no free lunch).
+
+   The memory requirements for inflate are (in bytes) 1 << windowBits
+ that is, 32K for windowBits=15 (default value) plus a few kilobytes
+ for small objects.
+*/
+
+                        /* Type declarations */
+
+#ifndef OF /* function prototypes */
+#  ifdef STDC
+#    define OF(args)  args
+#  else
+#    define OF(args)  ()
+#  endif
+#endif
+
+/* The following definitions for FAR are needed only for MSDOS mixed
+ * model programming (small or medium model with some far allocations).
+ * This was tested only with MSC; for other MSDOS compilers you may have
+ * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
+ * just define FAR to be empty.
+ */
+#ifdef SYS16BIT
+#  if defined(M_I86SM) || defined(M_I86MM)
+     /* MSC small or medium model */
+#    define SMALL_MEDIUM
+#    ifdef _MSC_VER
+#      define FAR _far
+#    else
+#      define FAR far
+#    endif
+#  endif
+#  if (defined(__SMALL__) || defined(__MEDIUM__))
+     /* Turbo C small or medium model */
+#    define SMALL_MEDIUM
+#    ifdef __BORLANDC__
+#      define FAR _far
+#    else
+#      define FAR far
+#    endif
+#  endif
+#endif
+
+#if defined(WINDOWS) || defined(WIN32)
+   /* If building or using zlib as a DLL, define ZLIB_DLL.
+    * This is not mandatory, but it offers a little performance increase.
+    */
+#  ifdef ZLIB_DLL
+#    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
+#      ifdef ZLIB_INTERNAL
+#        define ZEXTERN extern __declspec(dllexport)
+#      else
+#        define ZEXTERN extern __declspec(dllimport)
+#      endif
+#    endif
+#  endif  /* ZLIB_DLL */
+   /* If building or using zlib with the WINAPI/WINAPIV calling convention,
+    * define ZLIB_WINAPI.
+    * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
+    */
+#  ifdef ZLIB_WINAPI
+#    ifdef FAR
+#      undef FAR
+#    endif
+#    include <windows.h>
+     /* No need for _export, use ZLIB.DEF instead. */
+     /* For complete Windows compatibility, use WINAPI, not __stdcall. */
+#    define ZEXPORT WINAPI
+#    ifdef WIN32
+#      define ZEXPORTVA WINAPIV
+#    else
+#      define ZEXPORTVA FAR CDECL
+#    endif
+#  endif
+#endif
+
+#if defined (__BEOS__)
+#  ifdef ZLIB_DLL
+#    ifdef ZLIB_INTERNAL
+#      define ZEXPORT   __declspec(dllexport)
+#      define ZEXPORTVA __declspec(dllexport)
+#    else
+#      define ZEXPORT   __declspec(dllimport)
+#      define ZEXPORTVA __declspec(dllimport)
+#    endif
+#  endif
+#endif
+
+#ifndef ZEXTERN
+#  define ZEXTERN extern
+#endif
+#ifndef ZEXPORT
+#  define ZEXPORT
+#endif
+#ifndef ZEXPORTVA
+#  define ZEXPORTVA
+#endif
+
+#ifndef FAR
+#  define FAR
+#endif
+
+#if !defined(__MACTYPES__)
+typedef unsigned char  Byte;  /* 8 bits */
+#endif
+typedef unsigned int   uInt;  /* 16 bits or more */
+typedef unsigned long  uLong; /* 32 bits or more */
+
+#ifdef SMALL_MEDIUM
+   /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
+#  define Bytef Byte FAR
+#else
+   typedef Byte  FAR Bytef;
+#endif
+typedef char  FAR charf;
+typedef int   FAR intf;
+typedef uInt  FAR uIntf;
+typedef uLong FAR uLongf;
+
+#ifdef STDC
+   typedef void const *voidpc;
+   typedef void FAR   *voidpf;
+   typedef void       *voidp;
+#else
+   typedef Byte const *voidpc;
+   typedef Byte FAR   *voidpf;
+   typedef Byte       *voidp;
+#endif
+
+#if 0           /* HAVE_UNISTD_H -- this line is updated by ./configure */
+#  include <sys/types.h> /* for off_t */
+#  include <unistd.h>    /* for SEEK_* and off_t */
+#  ifdef VMS
+#    include <unixio.h>   /* for off_t */
+#  endif
+#  define z_off_t off_t
+#endif
+#ifndef SEEK_SET
+#  define SEEK_SET        0       /* Seek from beginning of file.  */
+#  define SEEK_CUR        1       /* Seek from current position.  */
+#  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
+#endif
+#ifndef z_off_t
+#  define z_off_t long
+#endif
+
+#if defined(__OS400__)
+#  define NO_vsnprintf
+#endif
+
+#if defined(__MVS__)
+#  define NO_vsnprintf
+#  ifdef FAR
+#    undef FAR
+#  endif
+#endif
+
+/* MVS linker does not support external names larger than 8 bytes */
+#if defined(__MVS__)
+#   pragma map(deflateInit_,"DEIN")
+#   pragma map(deflateInit2_,"DEIN2")
+#   pragma map(deflateEnd,"DEEND")
+#   pragma map(deflateBound,"DEBND")
+#   pragma map(inflateInit_,"ININ")
+#   pragma map(inflateInit2_,"ININ2")
+#   pragma map(inflateEnd,"INEND")
+#   pragma map(inflateSync,"INSY")
+#   pragma map(inflateSetDictionary,"INSEDI")
+#   pragma map(compressBound,"CMBND")
+#   pragma map(inflate_table,"INTABL")
+#   pragma map(inflate_fast,"INFA")
+#   pragma map(inflate_copyright,"INCOPY")
+#endif
+
+#endif /* ZCONF_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/zlib/zlib.h	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,1357 @@
+/* zlib.h -- interface of the 'zlib' general purpose compression library
+  version 1.2.3, July 18th, 2005
+
+  Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+  Jean-loup Gailly        Mark Adler
+  jloup@gzip.org          madler@alumni.caltech.edu
+
+
+  The data format used by the zlib library is described by RFCs (Request for
+  Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt
+  (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
+*/
+
+#ifndef ZLIB_H
+#define ZLIB_H
+
+#include "zconf.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ZLIB_VERSION "1.2.3"
+#define ZLIB_VERNUM 0x1230
+
+/*
+     The 'zlib' compression library provides in-memory compression and
+  decompression functions, including integrity checks of the uncompressed
+  data.  This version of the library supports only one compression method
+  (deflation) but other algorithms will be added later and will have the same
+  stream interface.
+
+     Compression can be done in a single step if the buffers are large
+  enough (for example if an input file is mmap'ed), or can be done by
+  repeated calls of the compression function.  In the latter case, the
+  application must provide more input and/or consume the output
+  (providing more output space) before each call.
+
+     The compressed data format used by default by the in-memory functions is
+  the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
+  around a deflate stream, which is itself documented in RFC 1951.
+
+     The library also supports reading and writing files in gzip (.gz) format
+  with an interface similar to that of stdio using the functions that start
+  with "gz".  The gzip format is different from the zlib format.  gzip is a
+  gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
+
+     This library can optionally read and write gzip streams in memory as well.
+
+     The zlib format was designed to be compact and fast for use in memory
+  and on communications channels.  The gzip format was designed for single-
+  file compression on file systems, has a larger header than zlib to maintain
+  directory information, and uses a different, slower check method than zlib.
+
+     The library does not install any signal handler. The decoder checks
+  the consistency of the compressed data, so the library should never
+  crash even in case of corrupted input.
+*/
+
+typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
+typedef void   (*free_func)  OF((voidpf opaque, voidpf address));
+
+struct internal_state;
+
+typedef struct z_stream_s {
+    Bytef    *next_in;  /* next input byte */
+    uInt     avail_in;  /* number of bytes available at next_in */
+    uLong    total_in;  /* total nb of input bytes read so far */
+
+    Bytef    *next_out; /* next output byte should be put there */
+    uInt     avail_out; /* remaining free space at next_out */
+    uLong    total_out; /* total nb of bytes output so far */
+
+    char     *msg;      /* last error message, NULL if no error */
+    struct internal_state FAR *state; /* not visible by applications */
+
+    alloc_func zalloc;  /* used to allocate the internal state */
+    free_func  zfree;   /* used to free the internal state */
+    voidpf     opaque;  /* private data object passed to zalloc and zfree */
+
+    int     data_type;  /* best guess about the data type: binary or text */
+    uLong   adler;      /* adler32 value of the uncompressed data */
+    uLong   reserved;   /* reserved for future use */
+} z_stream;
+
+typedef z_stream FAR *z_streamp;
+
+/*
+     gzip header information passed to and from zlib routines.  See RFC 1952
+  for more details on the meanings of these fields.
+*/
+typedef struct gz_header_s {
+    int     text;       /* true if compressed data believed to be text */
+    uLong   time;       /* modification time */
+    int     xflags;     /* extra flags (not used when writing a gzip file) */
+    int     os;         /* operating system */
+    Bytef   *extra;     /* pointer to extra field or Z_NULL if none */
+    uInt    extra_len;  /* extra field length (valid if extra != Z_NULL) */
+    uInt    extra_max;  /* space at extra (only when reading header) */
+    Bytef   *name;      /* pointer to zero-terminated file name or Z_NULL */
+    uInt    name_max;   /* space at name (only when reading header) */
+    Bytef   *comment;   /* pointer to zero-terminated comment or Z_NULL */
+    uInt    comm_max;   /* space at comment (only when reading header) */
+    int     hcrc;       /* true if there was or will be a header crc */
+    int     done;       /* true when done reading gzip header (not used
+                           when writing a gzip file) */
+} gz_header;
+
+typedef gz_header FAR *gz_headerp;
+
+/*
+   The application must update next_in and avail_in when avail_in has
+   dropped to zero. It must update next_out and avail_out when avail_out
+   has dropped to zero. The application must initialize zalloc, zfree and
+   opaque before calling the init function. All other fields are set by the
+   compression library and must not be updated by the application.
+
+   The opaque value provided by the application will be passed as the first
+   parameter for calls of zalloc and zfree. This can be useful for custom
+   memory management. The compression library attaches no meaning to the
+   opaque value.
+
+   zalloc must return Z_NULL if there is not enough memory for the object.
+   If zlib is used in a multi-threaded application, zalloc and zfree must be
+   thread safe.
+
+   On 16-bit systems, the functions zalloc and zfree must be able to allocate
+   exactly 65536 bytes, but will not be required to allocate more than this
+   if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
+   pointers returned by zalloc for objects of exactly 65536 bytes *must*
+   have their offset normalized to zero. The default allocation function
+   provided by this library ensures this (see zutil.c). To reduce memory
+   requirements and avoid any allocation of 64K objects, at the expense of
+   compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
+
+   The fields total_in and total_out can be used for statistics or
+   progress reports. After compression, total_in holds the total size of
+   the uncompressed data and may be saved for use in the decompressor
+   (particularly if the decompressor wants to decompress everything in
+   a single step).
+*/
+
+                        /* constants */
+
+#define Z_NO_FLUSH      0
+#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
+#define Z_SYNC_FLUSH    2
+#define Z_FULL_FLUSH    3
+#define Z_FINISH        4
+#define Z_BLOCK         5
+/* Allowed flush values; see deflate() and inflate() below for details */
+
+#define Z_OK            0
+#define Z_STREAM_END    1
+#define Z_NEED_DICT     2
+#define Z_ERRNO        (-1)
+#define Z_STREAM_ERROR (-2)
+#define Z_DATA_ERROR   (-3)
+#define Z_MEM_ERROR    (-4)
+#define Z_BUF_ERROR    (-5)
+#define Z_VERSION_ERROR (-6)
+/* Return codes for the compression/decompression functions. Negative
+ * values are errors, positive values are used for special but normal events.
+ */
+
+#define Z_NO_COMPRESSION         0
+#define Z_BEST_SPEED             1
+#define Z_BEST_COMPRESSION       9
+#define Z_DEFAULT_COMPRESSION  (-1)
+/* compression levels */
+
+#define Z_FILTERED            1
+#define Z_HUFFMAN_ONLY        2
+#define Z_RLE                 3
+#define Z_FIXED               4
+#define Z_DEFAULT_STRATEGY    0
+/* compression strategy; see deflateInit2() below for details */
+
+#define Z_BINARY   0
+#define Z_TEXT     1
+#define Z_ASCII    Z_TEXT   /* for compatibility with 1.2.2 and earlier */
+#define Z_UNKNOWN  2
+/* Possible values of the data_type field (though see inflate()) */
+
+#define Z_DEFLATED   8
+/* The deflate compression method (the only one supported in this version) */
+
+#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
+
+#define zlib_version zlibVersion()
+/* for compatibility with versions < 1.0.2 */
+
+                        /* basic functions */
+
+ZEXTERN const char * ZEXPORT zlibVersion OF((void));
+/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
+   If the first character differs, the library code actually used is
+   not compatible with the zlib.h header file used by the application.
+   This check is automatically made by deflateInit and inflateInit.
+ */
+
+/*
+ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
+
+     Initializes the internal stream state for compression. The fields
+   zalloc, zfree and opaque must be initialized before by the caller.
+   If zalloc and zfree are set to Z_NULL, deflateInit updates them to
+   use default allocation functions.
+
+     The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
+   1 gives best speed, 9 gives best compression, 0 gives no compression at
+   all (the input data is simply copied a block at a time).
+   Z_DEFAULT_COMPRESSION requests a default compromise between speed and
+   compression (currently equivalent to level 6).
+
+     deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_STREAM_ERROR if level is not a valid compression level,
+   Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
+   with the version assumed by the caller (ZLIB_VERSION).
+   msg is set to null if there is no error message.  deflateInit does not
+   perform any compression: this will be done by deflate().
+*/
+
+
+ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
+/*
+    deflate compresses as much data as possible, and stops when the input
+  buffer becomes empty or the output buffer becomes full. It may introduce some
+  output latency (reading input without producing any output) except when
+  forced to flush.
+
+    The detailed semantics are as follows. deflate performs one or both of the
+  following actions:
+
+  - Compress more input starting at next_in and update next_in and avail_in
+    accordingly. If not all input can be processed (because there is not
+    enough room in the output buffer), next_in and avail_in are updated and
+    processing will resume at this point for the next call of deflate().
+
+  - Provide more output starting at next_out and update next_out and avail_out
+    accordingly. This action is forced if the parameter flush is non zero.
+    Forcing flush frequently degrades the compression ratio, so this parameter
+    should be set only when necessary (in interactive applications).
+    Some output may be provided even if flush is not set.
+
+  Before the call of deflate(), the application should ensure that at least
+  one of the actions is possible, by providing more input and/or consuming
+  more output, and updating avail_in or avail_out accordingly; avail_out
+  should never be zero before the call. The application can consume the
+  compressed output when it wants, for example when the output buffer is full
+  (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK
+  and with zero avail_out, it must be called again after making room in the
+  output buffer because there might be more output pending.
+
+    Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
+  decide how much data to accumualte before producing output, in order to
+  maximize compression.
+
+    If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
+  flushed to the output buffer and the output is aligned on a byte boundary, so
+  that the decompressor can get all input data available so far. (In particular
+  avail_in is zero after the call if enough output space has been provided
+  before the call.)  Flushing may degrade compression for some compression
+  algorithms and so it should be used only when necessary.
+
+    If flush is set to Z_FULL_FLUSH, all output is flushed as with
+  Z_SYNC_FLUSH, and the compression state is reset so that decompression can
+  restart from this point if previous compressed data has been damaged or if
+  random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
+  compression.
+
+    If deflate returns with avail_out == 0, this function must be called again
+  with the same value of the flush parameter and more output space (updated
+  avail_out), until the flush is complete (deflate returns with non-zero
+  avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
+  avail_out is greater than six to avoid repeated flush markers due to
+  avail_out == 0 on return.
+
+    If the parameter flush is set to Z_FINISH, pending input is processed,
+  pending output is flushed and deflate returns with Z_STREAM_END if there
+  was enough output space; if deflate returns with Z_OK, this function must be
+  called again with Z_FINISH and more output space (updated avail_out) but no
+  more input data, until it returns with Z_STREAM_END or an error. After
+  deflate has returned Z_STREAM_END, the only possible operations on the
+  stream are deflateReset or deflateEnd.
+
+    Z_FINISH can be used immediately after deflateInit if all the compression
+  is to be done in a single step. In this case, avail_out must be at least
+  the value returned by deflateBound (see below). If deflate does not return
+  Z_STREAM_END, then it must be called again as described above.
+
+    deflate() sets strm->adler to the adler32 checksum of all input read
+  so far (that is, total_in bytes).
+
+    deflate() may update strm->data_type if it can make a good guess about
+  the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered
+  binary. This field is only for information purposes and does not affect
+  the compression algorithm in any manner.
+
+    deflate() returns Z_OK if some progress has been made (more input
+  processed or more output produced), Z_STREAM_END if all input has been
+  consumed and all output has been produced (only when flush is set to
+  Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
+  if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
+  (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not
+  fatal, and deflate() can be called again with more input and more output
+  space to continue compressing.
+*/
+
+
+ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
+/*
+     All dynamically allocated data structures for this stream are freed.
+   This function discards any unprocessed input and does not flush any
+   pending output.
+
+     deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
+   stream state was inconsistent, Z_DATA_ERROR if the stream was freed
+   prematurely (some input or output was discarded). In the error case,
+   msg may be set but then points to a static string (which must not be
+   deallocated).
+*/
+
+
+/*
+ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
+
+     Initializes the internal stream state for decompression. The fields
+   next_in, avail_in, zalloc, zfree and opaque must be initialized before by
+   the caller. If next_in is not Z_NULL and avail_in is large enough (the exact
+   value depends on the compression method), inflateInit determines the
+   compression method from the zlib header and allocates all data structures
+   accordingly; otherwise the allocation will be deferred to the first call of
+   inflate.  If zalloc and zfree are set to Z_NULL, inflateInit updates them to
+   use default allocation functions.
+
+     inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+   version assumed by the caller.  msg is set to null if there is no error
+   message. inflateInit does not perform any decompression apart from reading
+   the zlib header if present: this will be done by inflate().  (So next_in and
+   avail_in may be modified, but next_out and avail_out are unchanged.)
+*/
+
+
+ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
+/*
+    inflate decompresses as much data as possible, and stops when the input
+  buffer becomes empty or the output buffer becomes full. It may introduce
+  some output latency (reading input without producing any output) except when
+  forced to flush.
+
+  The detailed semantics are as follows. inflate performs one or both of the
+  following actions:
+
+  - Decompress more input starting at next_in and update next_in and avail_in
+    accordingly. If not all input can be processed (because there is not
+    enough room in the output buffer), next_in is updated and processing
+    will resume at this point for the next call of inflate().
+
+  - Provide more output starting at next_out and update next_out and avail_out
+    accordingly.  inflate() provides as much output as possible, until there
+    is no more input data or no more space in the output buffer (see below
+    about the flush parameter).
+
+  Before the call of inflate(), the application should ensure that at least
+  one of the actions is possible, by providing more input and/or consuming
+  more output, and updating the next_* and avail_* values accordingly.
+  The application can consume the uncompressed output when it wants, for
+  example when the output buffer is full (avail_out == 0), or after each
+  call of inflate(). If inflate returns Z_OK and with zero avail_out, it
+  must be called again after making room in the output buffer because there
+  might be more output pending.
+
+    The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH,
+  Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much
+  output as possible to the output buffer. Z_BLOCK requests that inflate() stop
+  if and when it gets to the next deflate block boundary. When decoding the
+  zlib or gzip format, this will cause inflate() to return immediately after
+  the header and before the first block. When doing a raw inflate, inflate()
+  will go ahead and process the first block, and will return when it gets to
+  the end of that block, or when it runs out of data.
+
+    The Z_BLOCK option assists in appending to or combining deflate streams.
+  Also to assist in this, on return inflate() will set strm->data_type to the
+  number of unused bits in the last byte taken from strm->next_in, plus 64
+  if inflate() is currently decoding the last block in the deflate stream,
+  plus 128 if inflate() returned immediately after decoding an end-of-block
+  code or decoding the complete header up to just before the first byte of the
+  deflate stream. The end-of-block will not be indicated until all of the
+  uncompressed data from that block has been written to strm->next_out.  The
+  number of unused bits may in general be greater than seven, except when
+  bit 7 of data_type is set, in which case the number of unused bits will be
+  less than eight.
+
+    inflate() should normally be called until it returns Z_STREAM_END or an
+  error. However if all decompression is to be performed in a single step
+  (a single call of inflate), the parameter flush should be set to
+  Z_FINISH. In this case all pending input is processed and all pending
+  output is flushed; avail_out must be large enough to hold all the
+  uncompressed data. (The size of the uncompressed data may have been saved
+  by the compressor for this purpose.) The next operation on this stream must
+  be inflateEnd to deallocate the decompression state. The use of Z_FINISH
+  is never required, but can be used to inform inflate that a faster approach
+  may be used for the single inflate() call.
+
+     In this implementation, inflate() always flushes as much output as
+  possible to the output buffer, and always uses the faster approach on the
+  first call. So the only effect of the flush parameter in this implementation
+  is on the return value of inflate(), as noted below, or when it returns early
+  because Z_BLOCK is used.
+
+     If a preset dictionary is needed after this call (see inflateSetDictionary
+  below), inflate sets strm->adler to the adler32 checksum of the dictionary
+  chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
+  strm->adler to the adler32 checksum of all output produced so far (that is,
+  total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
+  below. At the end of the stream, inflate() checks that its computed adler32
+  checksum is equal to that saved by the compressor and returns Z_STREAM_END
+  only if the checksum is correct.
+
+    inflate() will decompress and check either zlib-wrapped or gzip-wrapped
+  deflate data.  The header type is detected automatically.  Any information
+  contained in the gzip header is not retained, so applications that need that
+  information should instead use raw inflate, see inflateInit2() below, or
+  inflateBack() and perform their own processing of the gzip header and
+  trailer.
+
+    inflate() returns Z_OK if some progress has been made (more input processed
+  or more output produced), Z_STREAM_END if the end of the compressed data has
+  been reached and all uncompressed output has been produced, Z_NEED_DICT if a
+  preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
+  corrupted (input stream not conforming to the zlib format or incorrect check
+  value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
+  if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory,
+  Z_BUF_ERROR if no progress is possible or if there was not enough room in the
+  output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
+  inflate() can be called again with more input and more output space to
+  continue decompressing. If Z_DATA_ERROR is returned, the application may then
+  call inflateSync() to look for a good compression block if a partial recovery
+  of the data is desired.
+*/
+
+
+ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
+/*
+     All dynamically allocated data structures for this stream are freed.
+   This function discards any unprocessed input and does not flush any
+   pending output.
+
+     inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
+   was inconsistent. In the error case, msg may be set but then points to a
+   static string (which must not be deallocated).
+*/
+
+                        /* Advanced functions */
+
+/*
+    The following functions are needed only in some special applications.
+*/
+
+/*
+ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
+                                     int  level,
+                                     int  method,
+                                     int  windowBits,
+                                     int  memLevel,
+                                     int  strategy));
+
+     This is another version of deflateInit with more compression options. The
+   fields next_in, zalloc, zfree and opaque must be initialized before by
+   the caller.
+
+     The method parameter is the compression method. It must be Z_DEFLATED in
+   this version of the library.
+
+     The windowBits parameter is the base two logarithm of the window size
+   (the size of the history buffer). It should be in the range 8..15 for this
+   version of the library. Larger values of this parameter result in better
+   compression at the expense of memory usage. The default value is 15 if
+   deflateInit is used instead.
+
+     windowBits can also be -8..-15 for raw deflate. In this case, -windowBits
+   determines the window size. deflate() will then generate raw deflate data
+   with no zlib header or trailer, and will not compute an adler32 check value.
+
+     windowBits can also be greater than 15 for optional gzip encoding. Add
+   16 to windowBits to write a simple gzip header and trailer around the
+   compressed data instead of a zlib wrapper. The gzip header will have no
+   file name, no extra data, no comment, no modification time (set to zero),
+   no header crc, and the operating system will be set to 255 (unknown).  If a
+   gzip stream is being written, strm->adler is a crc32 instead of an adler32.
+
+     The memLevel parameter specifies how much memory should be allocated
+   for the internal compression state. memLevel=1 uses minimum memory but
+   is slow and reduces compression ratio; memLevel=9 uses maximum memory
+   for optimal speed. The default value is 8. See zconf.h for total memory
+   usage as a function of windowBits and memLevel.
+
+     The strategy parameter is used to tune the compression algorithm. Use the
+   value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
+   filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
+   string match), or Z_RLE to limit match distances to one (run-length
+   encoding). Filtered data consists mostly of small values with a somewhat
+   random distribution. In this case, the compression algorithm is tuned to
+   compress them better. The effect of Z_FILTERED is to force more Huffman
+   coding and less string matching; it is somewhat intermediate between
+   Z_DEFAULT and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as
+   Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy
+   parameter only affects the compression ratio but not the correctness of the
+   compressed output even if it is not set appropriately.  Z_FIXED prevents the
+   use of dynamic Huffman codes, allowing for a simpler decoder for special
+   applications.
+
+      deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
+   method). msg is set to null if there is no error message.  deflateInit2 does
+   not perform any compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
+                                             const Bytef *dictionary,
+                                             uInt  dictLength));
+/*
+     Initializes the compression dictionary from the given byte sequence
+   without producing any compressed output. This function must be called
+   immediately after deflateInit, deflateInit2 or deflateReset, before any
+   call of deflate. The compressor and decompressor must use exactly the same
+   dictionary (see inflateSetDictionary).
+
+     The dictionary should consist of strings (byte sequences) that are likely
+   to be encountered later in the data to be compressed, with the most commonly
+   used strings preferably put towards the end of the dictionary. Using a
+   dictionary is most useful when the data to be compressed is short and can be
+   predicted with good accuracy; the data can then be compressed better than
+   with the default empty dictionary.
+
+     Depending on the size of the compression data structures selected by
+   deflateInit or deflateInit2, a part of the dictionary may in effect be
+   discarded, for example if the dictionary is larger than the window size in
+   deflate or deflate2. Thus the strings most likely to be useful should be
+   put at the end of the dictionary, not at the front. In addition, the
+   current implementation of deflate will use at most the window size minus
+   262 bytes of the provided dictionary.
+
+     Upon return of this function, strm->adler is set to the adler32 value
+   of the dictionary; the decompressor may later use this value to determine
+   which dictionary has been used by the compressor. (The adler32 value
+   applies to the whole dictionary even if only a subset of the dictionary is
+   actually used by the compressor.) If a raw deflate was requested, then the
+   adler32 value is not computed and strm->adler is not set.
+
+     deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
+   parameter is invalid (such as NULL dictionary) or the stream state is
+   inconsistent (for example if deflate has already been called for this stream
+   or if the compression method is bsort). deflateSetDictionary does not
+   perform any compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
+                                    z_streamp source));
+/*
+     Sets the destination stream as a complete copy of the source stream.
+
+     This function can be useful when several compression strategies will be
+   tried, for example when there are several ways of pre-processing the input
+   data with a filter. The streams that will be discarded should then be freed
+   by calling deflateEnd.  Note that deflateCopy duplicates the internal
+   compression state which can be quite large, so this strategy is slow and
+   can consume lots of memory.
+
+     deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+   (such as zalloc being NULL). msg is left unchanged in both source and
+   destination.
+*/
+
+ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
+/*
+     This function is equivalent to deflateEnd followed by deflateInit,
+   but does not free and reallocate all the internal compression state.
+   The stream will keep the same compression level and any other attributes
+   that may have been set by deflateInit2.
+
+      deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent (such as zalloc or state being NULL).
+*/
+
+ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
+                                      int level,
+                                      int strategy));
+/*
+     Dynamically update the compression level and compression strategy.  The
+   interpretation of level and strategy is as in deflateInit2.  This can be
+   used to switch between compression and straight copy of the input data, or
+   to switch to a different kind of input data requiring a different
+   strategy. If the compression level is changed, the input available so far
+   is compressed with the old level (and may be flushed); the new level will
+   take effect only at the next call of deflate().
+
+     Before the call of deflateParams, the stream state must be set as for
+   a call of deflate(), since the currently available input may have to
+   be compressed and flushed. In particular, strm->avail_out must be non-zero.
+
+     deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
+   stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR
+   if strm->avail_out was zero.
+*/
+
+ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
+                                    int good_length,
+                                    int max_lazy,
+                                    int nice_length,
+                                    int max_chain));
+/*
+     Fine tune deflate's internal compression parameters.  This should only be
+   used by someone who understands the algorithm used by zlib's deflate for
+   searching for the best matching string, and even then only by the most
+   fanatic optimizer trying to squeeze out the last compressed bit for their
+   specific input data.  Read the deflate.c source code for the meaning of the
+   max_lazy, good_length, nice_length, and max_chain parameters.
+
+     deflateTune() can be called after deflateInit() or deflateInit2(), and
+   returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
+ */
+
+ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
+                                       uLong sourceLen));
+/*
+     deflateBound() returns an upper bound on the compressed size after
+   deflation of sourceLen bytes.  It must be called after deflateInit()
+   or deflateInit2().  This would be used to allocate an output buffer
+   for deflation in a single pass, and so would be called before deflate().
+*/
+
+ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
+                                     int bits,
+                                     int value));
+/*
+     deflatePrime() inserts bits in the deflate output stream.  The intent
+  is that this function is used to start off the deflate output with the
+  bits leftover from a previous deflate stream when appending to it.  As such,
+  this function can only be used for raw deflate, and must be used before the
+  first deflate() call after a deflateInit2() or deflateReset().  bits must be
+  less than or equal to 16, and that many of the least significant bits of
+  value will be inserted in the output.
+
+      deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
+                                         gz_headerp head));
+/*
+      deflateSetHeader() provides gzip header information for when a gzip
+   stream is requested by deflateInit2().  deflateSetHeader() may be called
+   after deflateInit2() or deflateReset() and before the first call of
+   deflate().  The text, time, os, extra field, name, and comment information
+   in the provided gz_header structure are written to the gzip header (xflag is
+   ignored -- the extra flags are set according to the compression level).  The
+   caller must assure that, if not Z_NULL, name and comment are terminated with
+   a zero byte, and that if extra is not Z_NULL, that extra_len bytes are
+   available there.  If hcrc is true, a gzip header crc is included.  Note that
+   the current versions of the command-line version of gzip (up through version
+   1.3.x) do not support header crc's, and will report that it is a "multi-part
+   gzip file" and give up.
+
+      If deflateSetHeader is not used, the default gzip header has text false,
+   the time set to zero, and os set to 255, with no extra, name, or comment
+   fields.  The gzip header is returned to the default state by deflateReset().
+
+      deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
+                                     int  windowBits));
+
+     This is another version of inflateInit with an extra parameter. The
+   fields next_in, avail_in, zalloc, zfree and opaque must be initialized
+   before by the caller.
+
+     The windowBits parameter is the base two logarithm of the maximum window
+   size (the size of the history buffer).  It should be in the range 8..15 for
+   this version of the library. The default value is 15 if inflateInit is used
+   instead. windowBits must be greater than or equal to the windowBits value
+   provided to deflateInit2() while compressing, or it must be equal to 15 if
+   deflateInit2() was not used. If a compressed stream with a larger window
+   size is given as input, inflate() will return with the error code
+   Z_DATA_ERROR instead of trying to allocate a larger window.
+
+     windowBits can also be -8..-15 for raw inflate. In this case, -windowBits
+   determines the window size. inflate() will then process raw deflate data,
+   not looking for a zlib or gzip header, not generating a check value, and not
+   looking for any check values for comparison at the end of the stream. This
+   is for use with other formats that use the deflate compressed data format
+   such as zip.  Those formats provide their own check values. If a custom
+   format is developed using the raw deflate format for compressed data, it is
+   recommended that a check value such as an adler32 or a crc32 be applied to
+   the uncompressed data as is done in the zlib, gzip, and zip formats.  For
+   most applications, the zlib format should be used as is. Note that comments
+   above on the use in deflateInit2() applies to the magnitude of windowBits.
+
+     windowBits can also be greater than 15 for optional gzip decoding. Add
+   32 to windowBits to enable zlib and gzip decoding with automatic header
+   detection, or add 16 to decode only the gzip format (the zlib format will
+   return a Z_DATA_ERROR).  If a gzip stream is being decoded, strm->adler is
+   a crc32 instead of an adler32.
+
+     inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg
+   is set to null if there is no error message.  inflateInit2 does not perform
+   any decompression apart from reading the zlib header if present: this will
+   be done by inflate(). (So next_in and avail_in may be modified, but next_out
+   and avail_out are unchanged.)
+*/
+
+ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
+                                             const Bytef *dictionary,
+                                             uInt  dictLength));
+/*
+     Initializes the decompression dictionary from the given uncompressed byte
+   sequence. This function must be called immediately after a call of inflate,
+   if that call returned Z_NEED_DICT. The dictionary chosen by the compressor
+   can be determined from the adler32 value returned by that call of inflate.
+   The compressor and decompressor must use exactly the same dictionary (see
+   deflateSetDictionary).  For raw inflate, this function can be called
+   immediately after inflateInit2() or inflateReset() and before any call of
+   inflate() to set the dictionary.  The application must insure that the
+   dictionary that was used for compression is provided.
+
+     inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
+   parameter is invalid (such as NULL dictionary) or the stream state is
+   inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
+   expected one (incorrect adler32 value). inflateSetDictionary does not
+   perform any decompression: this will be done by subsequent calls of
+   inflate().
+*/
+
+ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
+/*
+    Skips invalid compressed data until a full flush point (see above the
+  description of deflate with Z_FULL_FLUSH) can be found, or until all
+  available input is skipped. No output is provided.
+
+    inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
+  if no more input was provided, Z_DATA_ERROR if no flush point has been found,
+  or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
+  case, the application may save the current current value of total_in which
+  indicates where valid compressed data was found. In the error case, the
+  application may repeatedly call inflateSync, providing more input each time,
+  until success or end of the input data.
+*/
+
+ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
+                                    z_streamp source));
+/*
+     Sets the destination stream as a complete copy of the source stream.
+
+     This function can be useful when randomly accessing a large stream.  The
+   first pass through the stream can periodically record the inflate state,
+   allowing restarting inflate at those points when randomly accessing the
+   stream.
+
+     inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+   (such as zalloc being NULL). msg is left unchanged in both source and
+   destination.
+*/
+
+ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
+/*
+     This function is equivalent to inflateEnd followed by inflateInit,
+   but does not free and reallocate all the internal decompression state.
+   The stream will keep attributes that may have been set by inflateInit2.
+
+      inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent (such as zalloc or state being NULL).
+*/
+
+ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
+                                     int bits,
+                                     int value));
+/*
+     This function inserts bits in the inflate input stream.  The intent is
+  that this function is used to start inflating at a bit position in the
+  middle of a byte.  The provided bits will be used before any bytes are used
+  from next_in.  This function should only be used with raw inflate, and
+  should be used before the first inflate() call after inflateInit2() or
+  inflateReset().  bits must be less than or equal to 16, and that many of the
+  least significant bits of value will be inserted in the input.
+
+      inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
+                                         gz_headerp head));
+/*
+      inflateGetHeader() requests that gzip header information be stored in the
+   provided gz_header structure.  inflateGetHeader() may be called after
+   inflateInit2() or inflateReset(), and before the first call of inflate().
+   As inflate() processes the gzip stream, head->done is zero until the header
+   is completed, at which time head->done is set to one.  If a zlib stream is
+   being decoded, then head->done is set to -1 to indicate that there will be
+   no gzip header information forthcoming.  Note that Z_BLOCK can be used to
+   force inflate() to return immediately after header processing is complete
+   and before any actual data is decompressed.
+
+      The text, time, xflags, and os fields are filled in with the gzip header
+   contents.  hcrc is set to true if there is a header CRC.  (The header CRC
+   was valid if done is set to one.)  If extra is not Z_NULL, then extra_max
+   contains the maximum number of bytes to write to extra.  Once done is true,
+   extra_len contains the actual extra field length, and extra contains the
+   extra field, or that field truncated if extra_max is less than extra_len.
+   If name is not Z_NULL, then up to name_max characters are written there,
+   terminated with a zero unless the length is greater than name_max.  If
+   comment is not Z_NULL, then up to comm_max characters are written there,
+   terminated with a zero unless the length is greater than comm_max.  When
+   any of extra, name, or comment are not Z_NULL and the respective field is
+   not present in the header, then that field is set to Z_NULL to signal its
+   absence.  This allows the use of deflateSetHeader() with the returned
+   structure to duplicate the header.  However if those fields are set to
+   allocated memory, then the application will need to save those pointers
+   elsewhere so that they can be eventually freed.
+
+      If inflateGetHeader is not used, then the header information is simply
+   discarded.  The header is always checked for validity, including the header
+   CRC if present.  inflateReset() will reset the process to discard the header
+   information.  The application would need to call inflateGetHeader() again to
+   retrieve the header from the next gzip stream.
+
+      inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
+                                        unsigned char FAR *window));
+
+     Initialize the internal stream state for decompression using inflateBack()
+   calls.  The fields zalloc, zfree and opaque in strm must be initialized
+   before the call.  If zalloc and zfree are Z_NULL, then the default library-
+   derived memory allocation routines are used.  windowBits is the base two
+   logarithm of the window size, in the range 8..15.  window is a caller
+   supplied buffer of that size.  Except for special applications where it is
+   assured that deflate was used with small window sizes, windowBits must be 15
+   and a 32K byte window must be supplied to be able to decompress general
+   deflate streams.
+
+     See inflateBack() for the usage of these routines.
+
+     inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
+   the paramaters are invalid, Z_MEM_ERROR if the internal state could not
+   be allocated, or Z_VERSION_ERROR if the version of the library does not
+   match the version of the header file.
+*/
+
+typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *));
+typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
+
+ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
+                                    in_func in, void FAR *in_desc,
+                                    out_func out, void FAR *out_desc));
+/*
+     inflateBack() does a raw inflate with a single call using a call-back
+   interface for input and output.  This is more efficient than inflate() for
+   file i/o applications in that it avoids copying between the output and the
+   sliding window by simply making the window itself the output buffer.  This
+   function trusts the application to not change the output buffer passed by
+   the output function, at least until inflateBack() returns.
+
+     inflateBackInit() must be called first to allocate the internal state
+   and to initialize the state with the user-provided window buffer.
+   inflateBack() may then be used multiple times to inflate a complete, raw
+   deflate stream with each call.  inflateBackEnd() is then called to free
+   the allocated state.
+
+     A raw deflate stream is one with no zlib or gzip header or trailer.
+   This routine would normally be used in a utility that reads zip or gzip
+   files and writes out uncompressed files.  The utility would decode the
+   header and process the trailer on its own, hence this routine expects
+   only the raw deflate stream to decompress.  This is different from the
+   normal behavior of inflate(), which expects either a zlib or gzip header and
+   trailer around the deflate stream.
+
+     inflateBack() uses two subroutines supplied by the caller that are then
+   called by inflateBack() for input and output.  inflateBack() calls those
+   routines until it reads a complete deflate stream and writes out all of the
+   uncompressed data, or until it encounters an error.  The function's
+   parameters and return types are defined above in the in_func and out_func
+   typedefs.  inflateBack() will call in(in_desc, &buf) which should return the
+   number of bytes of provided input, and a pointer to that input in buf.  If
+   there is no input available, in() must return zero--buf is ignored in that
+   case--and inflateBack() will return a buffer error.  inflateBack() will call
+   out(out_desc, buf, len) to write the uncompressed data buf[0..len-1].  out()
+   should return zero on success, or non-zero on failure.  If out() returns
+   non-zero, inflateBack() will return with an error.  Neither in() nor out()
+   are permitted to change the contents of the window provided to
+   inflateBackInit(), which is also the buffer that out() uses to write from.
+   The length written by out() will be at most the window size.  Any non-zero
+   amount of input may be provided by in().
+
+     For convenience, inflateBack() can be provided input on the first call by
+   setting strm->next_in and strm->avail_in.  If that input is exhausted, then
+   in() will be called.  Therefore strm->next_in must be initialized before
+   calling inflateBack().  If strm->next_in is Z_NULL, then in() will be called
+   immediately for input.  If strm->next_in is not Z_NULL, then strm->avail_in
+   must also be initialized, and then if strm->avail_in is not zero, input will
+   initially be taken from strm->next_in[0 .. strm->avail_in - 1].
+
+     The in_desc and out_desc parameters of inflateBack() is passed as the
+   first parameter of in() and out() respectively when they are called.  These
+   descriptors can be optionally used to pass any information that the caller-
+   supplied in() and out() functions need to do their job.
+
+     On return, inflateBack() will set strm->next_in and strm->avail_in to
+   pass back any unused input that was provided by the last in() call.  The
+   return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
+   if in() or out() returned an error, Z_DATA_ERROR if there was a format
+   error in the deflate stream (in which case strm->msg is set to indicate the
+   nature of the error), or Z_STREAM_ERROR if the stream was not properly
+   initialized.  In the case of Z_BUF_ERROR, an input or output error can be
+   distinguished using strm->next_in which will be Z_NULL only if in() returned
+   an error.  If strm->next is not Z_NULL, then the Z_BUF_ERROR was due to
+   out() returning non-zero.  (in() will always be called before out(), so
+   strm->next_in is assured to be defined if out() returns non-zero.)  Note
+   that inflateBack() cannot return Z_OK.
+*/
+
+ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
+/*
+     All memory allocated by inflateBackInit() is freed.
+
+     inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream
+   state was inconsistent.
+*/
+
+ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
+/* Return flags indicating compile-time options.
+
+    Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
+     1.0: size of uInt
+     3.2: size of uLong
+     5.4: size of voidpf (pointer)
+     7.6: size of z_off_t
+
+    Compiler, assembler, and debug options:
+     8: DEBUG
+     9: ASMV or ASMINF -- use ASM code
+     10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
+     11: 0 (reserved)
+
+    One-time table building (smaller code, but not thread-safe if true):
+     12: BUILDFIXED -- build static block decoding tables when needed
+     13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed
+     14,15: 0 (reserved)
+
+    Library content (indicates missing functionality):
+     16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking
+                          deflate code when not needed)
+     17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
+                    and decode gzip streams (to avoid linking crc code)
+     18-19: 0 (reserved)
+
+    Operation variations (changes in library functionality):
+     20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate
+     21: FASTEST -- deflate algorithm with only one, lowest compression level
+     22,23: 0 (reserved)
+
+    The sprintf variant used by gzprintf (zero is best):
+     24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
+     25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
+     26: 0 = returns value, 1 = void -- 1 means inferred string length returned
+
+    Remainder:
+     27-31: 0 (reserved)
+ */
+
+
+                        /* utility functions */
+
+/*
+     The following utility functions are implemented on top of the
+   basic stream-oriented functions. To simplify the interface, some
+   default options are assumed (compression level and memory usage,
+   standard memory allocation functions). The source code of these
+   utility functions can easily be modified if you need special options.
+*/
+
+ZEXTERN int ZEXPORT compress OF((Bytef *dest,   uLongf *destLen,
+                                 const Bytef *source, uLong sourceLen));
+/*
+     Compresses the source buffer into the destination buffer.  sourceLen is
+   the byte length of the source buffer. Upon entry, destLen is the total
+   size of the destination buffer, which must be at least the value returned
+   by compressBound(sourceLen). Upon exit, destLen is the actual size of the
+   compressed buffer.
+     This function can be used to compress a whole file at once if the
+   input file is mmap'ed.
+     compress returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_BUF_ERROR if there was not enough room in the output
+   buffer.
+*/
+
+ZEXTERN int ZEXPORT compress2 OF((Bytef *dest,   uLongf *destLen,
+                                  const Bytef *source, uLong sourceLen,
+                                  int level));
+/*
+     Compresses the source buffer into the destination buffer. The level
+   parameter has the same meaning as in deflateInit.  sourceLen is the byte
+   length of the source buffer. Upon entry, destLen is the total size of the
+   destination buffer, which must be at least the value returned by
+   compressBound(sourceLen). Upon exit, destLen is the actual size of the
+   compressed buffer.
+
+     compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_BUF_ERROR if there was not enough room in the output buffer,
+   Z_STREAM_ERROR if the level parameter is invalid.
+*/
+
+ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
+/*
+     compressBound() returns an upper bound on the compressed size after
+   compress() or compress2() on sourceLen bytes.  It would be used before
+   a compress() or compress2() call to allocate the destination buffer.
+*/
+
+ZEXTERN int ZEXPORT uncompress OF((Bytef *dest,   uLongf *destLen,
+                                   const Bytef *source, uLong sourceLen));
+/*
+     Decompresses the source buffer into the destination buffer.  sourceLen is
+   the byte length of the source buffer. Upon entry, destLen is the total
+   size of the destination buffer, which must be large enough to hold the
+   entire uncompressed data. (The size of the uncompressed data must have
+   been saved previously by the compressor and transmitted to the decompressor
+   by some mechanism outside the scope of this compression library.)
+   Upon exit, destLen is the actual size of the compressed buffer.
+     This function can be used to decompress a whole file at once if the
+   input file is mmap'ed.
+
+     uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_BUF_ERROR if there was not enough room in the output
+   buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.
+*/
+
+
+typedef voidp gzFile;
+
+ZEXTERN gzFile ZEXPORT gzopen  OF((const char *path, const char *mode));
+/*
+     Opens a gzip (.gz) file for reading or writing. The mode parameter
+   is as in fopen ("rb" or "wb") but can also include a compression level
+   ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for
+   Huffman only compression as in "wb1h", or 'R' for run-length encoding
+   as in "wb1R". (See the description of deflateInit2 for more information
+   about the strategy parameter.)
+
+     gzopen can be used to read a file which is not in gzip format; in this
+   case gzread will directly read from the file without decompression.
+
+     gzopen returns NULL if the file could not be opened or if there was
+   insufficient memory to allocate the (de)compression state; errno
+   can be checked to distinguish the two cases (if errno is zero, the
+   zlib error is Z_MEM_ERROR).  */
+
+ZEXTERN gzFile ZEXPORT gzdopen  OF((int fd, const char *mode));
+/*
+     gzdopen() associates a gzFile with the file descriptor fd.  File
+   descriptors are obtained from calls like open, dup, creat, pipe or
+   fileno (in the file has been previously opened with fopen).
+   The mode parameter is as in gzopen.
+     The next call of gzclose on the returned gzFile will also close the
+   file descriptor fd, just like fclose(fdopen(fd), mode) closes the file
+   descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode).
+     gzdopen returns NULL if there was insufficient memory to allocate
+   the (de)compression state.
+*/
+
+ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
+/*
+     Dynamically update the compression level or strategy. See the description
+   of deflateInit2 for the meaning of these parameters.
+     gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
+   opened for writing.
+*/
+
+ZEXTERN int ZEXPORT    gzread  OF((gzFile file, voidp buf, unsigned len));
+/*
+     Reads the given number of uncompressed bytes from the compressed file.
+   If the input file was not in gzip format, gzread copies the given number
+   of bytes into the buffer.
+     gzread returns the number of uncompressed bytes actually read (0 for
+   end of file, -1 for error). */
+
+ZEXTERN int ZEXPORT    gzwrite OF((gzFile file,
+                                   voidpc buf, unsigned len));
+/*
+     Writes the given number of uncompressed bytes into the compressed file.
+   gzwrite returns the number of uncompressed bytes actually written
+   (0 in case of error).
+*/
+
+ZEXTERN int ZEXPORTVA   gzprintf OF((gzFile file, const char *format, ...));
+/*
+     Converts, formats, and writes the args to the compressed file under
+   control of the format string, as in fprintf. gzprintf returns the number of
+   uncompressed bytes actually written (0 in case of error).  The number of
+   uncompressed bytes written is limited to 4095. The caller should assure that
+   this limit is not exceeded. If it is exceeded, then gzprintf() will return
+   return an error (0) with nothing written. In this case, there may also be a
+   buffer overflow with unpredictable consequences, which is possible only if
+   zlib was compiled with the insecure functions sprintf() or vsprintf()
+   because the secure snprintf() or vsnprintf() functions were not available.
+*/
+
+ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
+/*
+      Writes the given null-terminated string to the compressed file, excluding
+   the terminating null character.
+      gzputs returns the number of characters written, or -1 in case of error.
+*/
+
+ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
+/*
+      Reads bytes from the compressed file until len-1 characters are read, or
+   a newline character is read and transferred to buf, or an end-of-file
+   condition is encountered.  The string is then terminated with a null
+   character.
+      gzgets returns buf, or Z_NULL in case of error.
+*/
+
+ZEXTERN int ZEXPORT    gzputc OF((gzFile file, int c));
+/*
+      Writes c, converted to an unsigned char, into the compressed file.
+   gzputc returns the value that was written, or -1 in case of error.
+*/
+
+ZEXTERN int ZEXPORT    gzgetc OF((gzFile file));
+/*
+      Reads one byte from the compressed file. gzgetc returns this byte
+   or -1 in case of end of file or error.
+*/
+
+ZEXTERN int ZEXPORT    gzungetc OF((int c, gzFile file));
+/*
+      Push one character back onto the stream to be read again later.
+   Only one character of push-back is allowed.  gzungetc() returns the
+   character pushed, or -1 on failure.  gzungetc() will fail if a
+   character has been pushed but not read yet, or if c is -1. The pushed
+   character will be discarded if the stream is repositioned with gzseek()
+   or gzrewind().
+*/
+
+ZEXTERN int ZEXPORT    gzflush OF((gzFile file, int flush));
+/*
+     Flushes all pending output into the compressed file. The parameter
+   flush is as in the deflate() function. The return value is the zlib
+   error number (see function gzerror below). gzflush returns Z_OK if
+   the flush parameter is Z_FINISH and all output could be flushed.
+     gzflush should be called only when strictly necessary because it can
+   degrade compression.
+*/
+
+ZEXTERN z_off_t ZEXPORT    gzseek OF((gzFile file,
+                                      z_off_t offset, int whence));
+/*
+      Sets the starting position for the next gzread or gzwrite on the
+   given compressed file. The offset represents a number of bytes in the
+   uncompressed data stream. The whence parameter is defined as in lseek(2);
+   the value SEEK_END is not supported.
+     If the file is opened for reading, this function is emulated but can be
+   extremely slow. If the file is opened for writing, only forward seeks are
+   supported; gzseek then compresses a sequence of zeroes up to the new
+   starting position.
+
+      gzseek returns the resulting offset location as measured in bytes from
+   the beginning of the uncompressed stream, or -1 in case of error, in
+   particular if the file is opened for writing and the new starting position
+   would be before the current position.
+*/
+
+ZEXTERN int ZEXPORT    gzrewind OF((gzFile file));
+/*
+     Rewinds the given file. This function is supported only for reading.
+
+   gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
+*/
+
+ZEXTERN z_off_t ZEXPORT    gztell OF((gzFile file));
+/*
+     Returns the starting position for the next gzread or gzwrite on the
+   given compressed file. This position represents a number of bytes in the
+   uncompressed data stream.
+
+   gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
+*/
+
+ZEXTERN int ZEXPORT gzeof OF((gzFile file));
+/*
+     Returns 1 when EOF has previously been detected reading the given
+   input stream, otherwise zero.
+*/
+
+ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
+/*
+     Returns 1 if file is being read directly without decompression, otherwise
+   zero.
+*/
+
+ZEXTERN int ZEXPORT    gzclose OF((gzFile file));
+/*
+     Flushes all pending output if necessary, closes the compressed file
+   and deallocates all the (de)compression state. The return value is the zlib
+   error number (see function gzerror below).
+*/
+
+ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
+/*
+     Returns the error message for the last error which occurred on the
+   given compressed file. errnum is set to zlib error number. If an
+   error occurred in the file system and not in the compression library,
+   errnum is set to Z_ERRNO and the application may consult errno
+   to get the exact error code.
+*/
+
+ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
+/*
+     Clears the error and end-of-file flags for file. This is analogous to the
+   clearerr() function in stdio. This is useful for continuing to read a gzip
+   file that is being written concurrently.
+*/
+
+                        /* checksum functions */
+
+/*
+     These functions are not related to compression but are exported
+   anyway because they might be useful in applications using the
+   compression library.
+*/
+
+ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
+/*
+     Update a running Adler-32 checksum with the bytes buf[0..len-1] and
+   return the updated checksum. If buf is NULL, this function returns
+   the required initial value for the checksum.
+   An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
+   much faster. Usage example:
+
+     uLong adler = adler32(0L, Z_NULL, 0);
+
+     while (read_buffer(buffer, length) != EOF) {
+       adler = adler32(adler, buffer, length);
+     }
+     if (adler != original_adler) error();
+*/
+
+ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
+                                          z_off_t len2));
+/*
+     Combine two Adler-32 checksums into one.  For two sequences of bytes, seq1
+   and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
+   each, adler1 and adler2.  adler32_combine() returns the Adler-32 checksum of
+   seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.
+*/
+
+ZEXTERN uLong ZEXPORT crc32   OF((uLong crc, const Bytef *buf, uInt len));
+/*
+     Update a running CRC-32 with the bytes buf[0..len-1] and return the
+   updated CRC-32. If buf is NULL, this function returns the required initial
+   value for the for the crc. Pre- and post-conditioning (one's complement) is
+   performed within this function so it shouldn't be done by the application.
+   Usage example:
+
+     uLong crc = crc32(0L, Z_NULL, 0);
+
+     while (read_buffer(buffer, length) != EOF) {
+       crc = crc32(crc, buffer, length);
+     }
+     if (crc != original_crc) error();
+*/
+
+ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
+
+/*
+     Combine two CRC-32 check values into one.  For two sequences of bytes,
+   seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
+   calculated for each, crc1 and crc2.  crc32_combine() returns the CRC-32
+   check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
+   len2.
+*/
+
+
+                        /* various hacks, don't look :) */
+
+/* deflateInit and inflateInit are macros to allow checking the zlib version
+ * and the compiler's view of z_stream:
+ */
+ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
+                                     const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
+                                     const char *version, int stream_size));
+ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int  level, int  method,
+                                      int windowBits, int memLevel,
+                                      int strategy, const char *version,
+                                      int stream_size));
+ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int  windowBits,
+                                      const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
+                                         unsigned char FAR *window,
+                                         const char *version,
+                                         int stream_size));
+#define deflateInit(strm, level) \
+        deflateInit_((strm), (level),       ZLIB_VERSION, sizeof(z_stream))
+#define inflateInit(strm) \
+        inflateInit_((strm),                ZLIB_VERSION, sizeof(z_stream))
+#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
+        deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
+                      (strategy),           ZLIB_VERSION, sizeof(z_stream))
+#define inflateInit2(strm, windowBits) \
+        inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
+#define inflateBackInit(strm, windowBits, window) \
+        inflateBackInit_((strm), (windowBits), (window), \
+        ZLIB_VERSION, sizeof(z_stream))
+
+
+#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
+    struct internal_state {int dummy;}; /* hack for buggy compilers */
+#endif
+
+ZEXTERN const char   * ZEXPORT zError           OF((int));
+ZEXTERN int            ZEXPORT inflateSyncPoint OF((z_streamp z));
+ZEXTERN const uLongf * ZEXPORT get_crc_table    OF((void));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ZLIB_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/zlib/zutil.c	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,318 @@
+/* zutil.c -- target dependent utility functions for the compression library
+ * Copyright (C) 1995-2005 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id: zutil.c,v 1.1 2009/02/05 23:03:31 stechong Exp $ */
+
+#include "zutil.h"
+
+#ifndef NO_DUMMY_DECL
+struct internal_state      {int dummy;}; /* for buggy compilers */
+#endif
+
+const char * const z_errmsg[10] = {
+"need dictionary",     /* Z_NEED_DICT       2  */
+"stream end",          /* Z_STREAM_END      1  */
+"",                    /* Z_OK              0  */
+"file error",          /* Z_ERRNO         (-1) */
+"stream error",        /* Z_STREAM_ERROR  (-2) */
+"data error",          /* Z_DATA_ERROR    (-3) */
+"insufficient memory", /* Z_MEM_ERROR     (-4) */
+"buffer error",        /* Z_BUF_ERROR     (-5) */
+"incompatible version",/* Z_VERSION_ERROR (-6) */
+""};
+
+
+const char * ZEXPORT zlibVersion()
+{
+    return ZLIB_VERSION;
+}
+
+uLong ZEXPORT zlibCompileFlags()
+{
+    uLong flags;
+
+    flags = 0;
+    switch (sizeof(uInt)) {
+    case 2:     break;
+    case 4:     flags += 1;     break;
+    case 8:     flags += 2;     break;
+    default:    flags += 3;
+    }
+    switch (sizeof(uLong)) {
+    case 2:     break;
+    case 4:     flags += 1 << 2;        break;
+    case 8:     flags += 2 << 2;        break;
+    default:    flags += 3 << 2;
+    }
+    switch (sizeof(voidpf)) {
+    case 2:     break;
+    case 4:     flags += 1 << 4;        break;
+    case 8:     flags += 2 << 4;        break;
+    default:    flags += 3 << 4;
+    }
+    switch (sizeof(z_off_t)) {
+    case 2:     break;
+    case 4:     flags += 1 << 6;        break;
+    case 8:     flags += 2 << 6;        break;
+    default:    flags += 3 << 6;
+    }
+#ifdef DEBUG
+    flags += 1 << 8;
+#endif
+#if defined(ASMV) || defined(ASMINF)
+    flags += 1 << 9;
+#endif
+#ifdef ZLIB_WINAPI
+    flags += 1 << 10;
+#endif
+#ifdef BUILDFIXED
+    flags += 1 << 12;
+#endif
+#ifdef DYNAMIC_CRC_TABLE
+    flags += 1 << 13;
+#endif
+#ifdef NO_GZCOMPRESS
+    flags += 1L << 16;
+#endif
+#ifdef NO_GZIP
+    flags += 1L << 17;
+#endif
+#ifdef PKZIP_BUG_WORKAROUND
+    flags += 1L << 20;
+#endif
+#ifdef FASTEST
+    flags += 1L << 21;
+#endif
+#ifdef STDC
+#  ifdef NO_vsnprintf
+        flags += 1L << 25;
+#    ifdef HAS_vsprintf_void
+        flags += 1L << 26;
+#    endif
+#  else
+#    ifdef HAS_vsnprintf_void
+        flags += 1L << 26;
+#    endif
+#  endif
+#else
+        flags += 1L << 24;
+#  ifdef NO_snprintf
+        flags += 1L << 25;
+#    ifdef HAS_sprintf_void
+        flags += 1L << 26;
+#    endif
+#  else
+#    ifdef HAS_snprintf_void
+        flags += 1L << 26;
+#    endif
+#  endif
+#endif
+    return flags;
+}
+
+#ifdef DEBUG
+
+#  ifndef verbose
+#    define verbose 0
+#  endif
+int z_verbose = verbose;
+
+void z_error (m)
+    char *m;
+{
+    fprintf(stderr, "%s\n", m);
+    exit(1);
+}
+#endif
+
+/* exported to allow conversion of error code to string for compress() and
+ * uncompress()
+ */
+const char * ZEXPORT zError(err)
+    int err;
+{
+    return ERR_MSG(err);
+}
+
+#if defined(_WIN32_WCE)
+    /* The Microsoft C Run-Time Library for Windows CE doesn't have
+     * errno.  We define it as a global variable to simplify porting.
+     * Its value is always 0 and should not be used.
+     */
+    int errno = 0;
+#endif
+
+#ifndef HAVE_MEMCPY
+
+void zmemcpy(dest, source, len)
+    Bytef* dest;
+    const Bytef* source;
+    uInt  len;
+{
+    if (len == 0) return;
+    do {
+        *dest++ = *source++; /* ??? to be unrolled */
+    } while (--len != 0);
+}
+
+int zmemcmp(s1, s2, len)
+    const Bytef* s1;
+    const Bytef* s2;
+    uInt  len;
+{
+    uInt j;
+
+    for (j = 0; j < len; j++) {
+        if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;
+    }
+    return 0;
+}
+
+void zmemzero(dest, len)
+    Bytef* dest;
+    uInt  len;
+{
+    if (len == 0) return;
+    do {
+        *dest++ = 0;  /* ??? to be unrolled */
+    } while (--len != 0);
+}
+#endif
+
+
+#ifdef SYS16BIT
+
+#ifdef __TURBOC__
+/* Turbo C in 16-bit mode */
+
+#  define MY_ZCALLOC
+
+/* Turbo C malloc() does not allow dynamic allocation of 64K bytes
+ * and farmalloc(64K) returns a pointer with an offset of 8, so we
+ * must fix the pointer. Warning: the pointer must be put back to its
+ * original form in order to free it, use zcfree().
+ */
+
+#define MAX_PTR 10
+/* 10*64K = 640K */
+
+local int next_ptr = 0;
+
+typedef struct ptr_table_s {
+    voidpf org_ptr;
+    voidpf new_ptr;
+} ptr_table;
+
+local ptr_table table[MAX_PTR];
+/* This table is used to remember the original form of pointers
+ * to large buffers (64K). Such pointers are normalized with a zero offset.
+ * Since MSDOS is not a preemptive multitasking OS, this table is not
+ * protected from concurrent access. This hack doesn't work anyway on
+ * a protected system like OS/2. Use Microsoft C instead.
+ */
+
+voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
+{
+    voidpf buf = opaque; /* just to make some compilers happy */
+    ulg bsize = (ulg)items*size;
+
+    /* If we allocate less than 65520 bytes, we assume that farmalloc
+     * will return a usable pointer which doesn't have to be normalized.
+     */
+    if (bsize < 65520L) {
+        buf = farmalloc(bsize);
+        if (*(ush*)&buf != 0) return buf;
+    } else {
+        buf = farmalloc(bsize + 16L);
+    }
+    if (buf == NULL || next_ptr >= MAX_PTR) return NULL;
+    table[next_ptr].org_ptr = buf;
+
+    /* Normalize the pointer to seg:0 */
+    *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4;
+    *(ush*)&buf = 0;
+    table[next_ptr++].new_ptr = buf;
+    return buf;
+}
+
+void  zcfree (voidpf opaque, voidpf ptr)
+{
+    int n;
+    if (*(ush*)&ptr != 0) { /* object < 64K */
+        farfree(ptr);
+        return;
+    }
+    /* Find the original pointer */
+    for (n = 0; n < next_ptr; n++) {
+        if (ptr != table[n].new_ptr) continue;
+
+        farfree(table[n].org_ptr);
+        while (++n < next_ptr) {
+            table[n-1] = table[n];
+        }
+        next_ptr--;
+        return;
+    }
+    ptr = opaque; /* just to make some compilers happy */
+    Assert(0, "zcfree: ptr not found");
+}
+
+#endif /* __TURBOC__ */
+
+
+#ifdef M_I86
+/* Microsoft C in 16-bit mode */
+
+#  define MY_ZCALLOC
+
+#if (!defined(_MSC_VER) || (_MSC_VER <= 600))
+#  define _halloc  halloc
+#  define _hfree   hfree
+#endif
+
+voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
+{
+    if (opaque) opaque = 0; /* to make compiler happy */
+    return _halloc((long)items, size);
+}
+
+void  zcfree (voidpf opaque, voidpf ptr)
+{
+    if (opaque) opaque = 0; /* to make compiler happy */
+    _hfree(ptr);
+}
+
+#endif /* M_I86 */
+
+#endif /* SYS16BIT */
+
+
+#ifndef MY_ZCALLOC /* Any system without a special alloc function */
+
+#ifndef STDC
+extern voidp  malloc OF((uInt size));
+extern voidp  calloc OF((uInt items, uInt size));
+extern void   free   OF((voidpf ptr));
+#endif
+
+voidpf zcalloc (opaque, items, size)
+    voidpf opaque;
+    unsigned items;
+    unsigned size;
+{
+    if (opaque) items += size - size; /* make compiler happy */
+    return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
+                              (voidpf)calloc(items, size);
+}
+
+void  zcfree (opaque, ptr)
+    voidpf opaque;
+    voidpf ptr;
+{
+    free(ptr);
+    if (opaque) return; /* make compiler happy */
+}
+
+#endif /* MY_ZCALLOC */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/source/zlib/zutil.h	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,269 @@
+/* zutil.h -- internal interface and configuration of the compression library
+ * Copyright (C) 1995-2005 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+   part of the implementation of the compression library and is
+   subject to change. Applications should only use zlib.h.
+ */
+
+/* @(#) $Id: zutil.h,v 1.1 2009/02/05 23:03:31 stechong Exp $ */
+
+#ifndef ZUTIL_H
+#define ZUTIL_H
+
+#define ZLIB_INTERNAL
+#include "zlib.h"
+
+#ifdef STDC
+#  ifndef _WIN32_WCE
+#    include <stddef.h>
+#  endif
+#  include <string.h>
+#  include <stdlib.h>
+#endif
+#ifdef NO_ERRNO_H
+#   ifdef _WIN32_WCE
+      /* The Microsoft C Run-Time Library for Windows CE doesn't have
+       * errno.  We define it as a global variable to simplify porting.
+       * Its value is always 0 and should not be used.  We rename it to
+       * avoid conflict with other libraries that use the same workaround.
+       */
+#     define errno z_errno
+#   endif
+    extern int errno;
+#else
+#  ifndef _WIN32_WCE
+#    include <errno.h>
+#  endif
+#endif
+
+#ifndef local
+#  define local static
+#endif
+/* compile with -Dlocal if your debugger can't find static symbols */
+
+typedef unsigned char  uch;
+typedef uch FAR uchf;
+typedef unsigned short ush;
+typedef ush FAR ushf;
+typedef unsigned long  ulg;
+
+extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
+/* (size given to avoid silly warnings with Visual C++) */
+
+#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
+
+#define ERR_RETURN(strm,err) \
+  return (strm->msg = (char*)ERR_MSG(err), (err))
+/* To be used only when the state is known to be valid */
+
+        /* common constants */
+
+#ifndef DEF_WBITS
+#  define DEF_WBITS MAX_WBITS
+#endif
+/* default windowBits for decompression. MAX_WBITS is for compression only */
+
+#if MAX_MEM_LEVEL >= 8
+#  define DEF_MEM_LEVEL 8
+#else
+#  define DEF_MEM_LEVEL  MAX_MEM_LEVEL
+#endif
+/* default memLevel */
+
+#define STORED_BLOCK 0
+#define STATIC_TREES 1
+#define DYN_TREES    2
+/* The three kinds of block type */
+
+#define MIN_MATCH  3
+#define MAX_MATCH  258
+/* The minimum and maximum match lengths */
+
+#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
+
+        /* target dependencies */
+
+#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
+#  define OS_CODE  0x00
+#  if defined(__TURBOC__) || defined(__BORLANDC__)
+#    if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
+       /* Allow compilation with ANSI keywords only enabled */
+       void _Cdecl farfree( void *block );
+       void *_Cdecl farmalloc( unsigned long nbytes );
+#    else
+#      include <alloc.h>
+#    endif
+#  else /* MSC or DJGPP */
+#    include <malloc.h>
+#  endif
+#endif
+
+#ifdef AMIGA
+#  define OS_CODE  0x01
+#endif
+
+#if defined(VAXC) || defined(VMS)
+#  define OS_CODE  0x02
+#  define F_OPEN(name, mode) \
+     fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
+#endif
+
+#if defined(ATARI) || defined(atarist)
+#  define OS_CODE  0x05
+#endif
+
+#ifdef OS2
+#  define OS_CODE  0x06
+#  ifdef M_I86
+     #include <malloc.h>
+#  endif
+#endif
+
+#if defined(MACOS) || defined(TARGET_OS_MAC)
+#  define OS_CODE  0x07
+#  if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
+#    include <unix.h> /* for fdopen */
+#  else
+#    ifndef fdopen
+#      define fdopen(fd,mode) NULL /* No fdopen() */
+#    endif
+#  endif
+#endif
+
+#ifdef TOPS20
+#  define OS_CODE  0x0a
+#endif
+
+#ifdef WIN32
+#  ifndef __CYGWIN__  /* Cygwin is Unix, not Win32 */
+#    define OS_CODE  0x0b
+#  endif
+#endif
+
+#ifdef __50SERIES /* Prime/PRIMOS */
+#  define OS_CODE  0x0f
+#endif
+
+#if defined(_BEOS_) || defined(RISCOS)
+#  define fdopen(fd,mode) NULL /* No fdopen() */
+#endif
+
+#if (defined(_MSC_VER) && (_MSC_VER > 600))
+#  if defined(_WIN32_WCE)
+#    define fdopen(fd,mode) NULL /* No fdopen() */
+#    ifndef _PTRDIFF_T_DEFINED
+       typedef int ptrdiff_t;
+#      define _PTRDIFF_T_DEFINED
+#    endif
+#  else
+#    define fdopen(fd,type)  _fdopen(fd,type)
+#  endif
+#endif
+
+        /* common defaults */
+
+#ifndef OS_CODE
+#  define OS_CODE  0x03  /* assume Unix */
+#endif
+
+#ifndef F_OPEN
+#  define F_OPEN(name, mode) fopen((name), (mode))
+#endif
+
+         /* functions */
+
+#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)
+#  ifndef HAVE_VSNPRINTF
+#    define HAVE_VSNPRINTF
+#  endif
+#endif
+#if defined(__CYGWIN__)
+#  ifndef HAVE_VSNPRINTF
+#    define HAVE_VSNPRINTF
+#  endif
+#endif
+#ifndef HAVE_VSNPRINTF
+#  ifdef MSDOS
+     /* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
+        but for now we just assume it doesn't. */
+#    define NO_vsnprintf
+#  endif
+#  ifdef __TURBOC__
+#    define NO_vsnprintf
+#  endif
+#  ifdef WIN32
+     /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
+#    if !defined(vsnprintf) && !defined(NO_vsnprintf)
+#      define vsnprintf _vsnprintf
+#    endif
+#  endif
+#  ifdef __SASC
+#    define NO_vsnprintf
+#  endif
+#endif
+#ifdef VMS
+#  define NO_vsnprintf
+#endif
+
+#if defined(pyr)
+#  define NO_MEMCPY
+#endif
+#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
+ /* Use our own functions for small and medium model with MSC <= 5.0.
+  * You may have to use the same strategy for Borland C (untested).
+  * The __SC__ check is for Symantec.
+  */
+#  define NO_MEMCPY
+#endif
+#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
+#  define HAVE_MEMCPY
+#endif
+#ifdef HAVE_MEMCPY
+#  ifdef SMALL_MEDIUM /* MSDOS small or medium model */
+#    define zmemcpy _fmemcpy
+#    define zmemcmp _fmemcmp
+#    define zmemzero(dest, len) _fmemset(dest, 0, len)
+#  else
+#    define zmemcpy memcpy
+#    define zmemcmp memcmp
+#    define zmemzero(dest, len) memset(dest, 0, len)
+#  endif
+#else
+   extern void zmemcpy  OF((Bytef* dest, const Bytef* source, uInt len));
+   extern int  zmemcmp  OF((const Bytef* s1, const Bytef* s2, uInt len));
+   extern void zmemzero OF((Bytef* dest, uInt len));
+#endif
+
+/* Diagnostic functions */
+#ifdef DEBUG
+#  include <stdio.h>
+   extern int z_verbose;
+   extern void z_error    OF((char *m));
+#  define Assert(cond,msg) {if(!(cond)) z_error(msg);}
+#  define Trace(x) {if (z_verbose>=0) fprintf x ;}
+#  define Tracev(x) {if (z_verbose>0) fprintf x ;}
+#  define Tracevv(x) {if (z_verbose>1) fprintf x ;}
+#  define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
+#  define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
+#else
+#  define Assert(cond,msg)
+#  define Trace(x)
+#  define Tracev(x)
+#  define Tracevv(x)
+#  define Tracec(c,x)
+#  define Tracecv(c,x)
+#endif
+
+
+voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
+void   zcfree  OF((voidpf opaque, voidpf ptr));
+
+#define ZALLOC(strm, items, size) \
+           (*((strm)->zalloc))((strm)->opaque, (items), (size))
+#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
+#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
+
+#endif /* ZUTIL_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/support/_mountzlib.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,22 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+import archive, iu, sys
+iu._globalownertypes.insert(0, archive.PYZOwner)
+sys.importManager = iu.ImportManager()
+sys.importManager.install()
+if not hasattr(sys, 'frozen'):
+    sys.frozen = 1
Binary file srcanamdw/codescanner/pyinstaller/support/loader/inprocsrvr_6dc.dll has changed
Binary file srcanamdw/codescanner/pyinstaller/support/loader/inprocsrvr_6dw.dll has changed
Binary file srcanamdw/codescanner/pyinstaller/support/loader/inprocsrvr_6rc.dll has changed
Binary file srcanamdw/codescanner/pyinstaller/support/loader/inprocsrvr_6rw.dll has changed
Binary file srcanamdw/codescanner/pyinstaller/support/loader/inprocsrvr_7dc.dll has changed
Binary file srcanamdw/codescanner/pyinstaller/support/loader/inprocsrvr_7dw.dll has changed
Binary file srcanamdw/codescanner/pyinstaller/support/loader/inprocsrvr_7rc.dll has changed
Binary file srcanamdw/codescanner/pyinstaller/support/loader/inprocsrvr_7rw.dll has changed
Binary file srcanamdw/codescanner/pyinstaller/support/loader/run_6dc.exe has changed
Binary file srcanamdw/codescanner/pyinstaller/support/loader/run_6dw.exe has changed
Binary file srcanamdw/codescanner/pyinstaller/support/loader/run_6rc.exe has changed
Binary file srcanamdw/codescanner/pyinstaller/support/loader/run_6rw.exe has changed
Binary file srcanamdw/codescanner/pyinstaller/support/loader/run_7dc.exe has changed
Binary file srcanamdw/codescanner/pyinstaller/support/loader/run_7dw.exe has changed
Binary file srcanamdw/codescanner/pyinstaller/support/loader/run_7rc.exe has changed
Binary file srcanamdw/codescanner/pyinstaller/support/loader/run_7rw.exe has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/support/removeTK.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,43 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+import sys, os
+
+def empty(dir):
+    try:
+        fnms = os.listdir(dir)
+    except OSError:
+        return
+    for fnm in fnms:
+        path = os.path.join(dir, fnm)
+        if os.path.isdir(path):
+            empty(path)
+            try:
+                os.rmdir(path)
+            except:
+                pass
+        else:
+            try:
+                os.remove(path)
+            except:
+                pass
+
+tcldir = os.environ['TCL_LIBRARY']
+prvtdir = os.path.dirname(tcldir)
+if os.path.basename(prvtdir) == '_MEI':
+    empty(prvtdir)
+    os.rmdir(prvtdir)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/support/rthooks/opengl.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,48 @@
+# Copyright (C) 2005, Giovanni Bajo
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# In addition to the permissions in the GNU General Public License, the
+# authors give you unlimited permission to link or embed the compiled
+# version of this file into combinations with other programs, and to
+# distribute those combinations without any restriction coming from the
+# use of this file. (The General Public License restrictions do apply in
+# other respects; for example, they cover modification of the file, and
+# distribution when not linked into a combine executable.)
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+# PyOpenGL (specifically, OpenGL.__init__) reads a "version" text file
+# containing the version number to export it as OpenGL.__version__. When
+# packaging with PyInstaller, the 'version' file does not exist, and importing
+# PyOpenGL results in an IOError.
+# The (convoluted) solution is to override Python's builtin "open" with our
+# own function which detects when "version" is opened and returns some fake
+# content stream (through cStringIO).
+
+__realopen__ = open
+
+def myopen(fn, *args):
+    import os
+    lastdir = os.path.basename(os.path.dirname(fn))
+    if os.path.basename(fn) == "version" and os.path.splitext(lastdir)[1] == ".pyz":
+        import cStringIO
+        # Restore original open, since we're almost done
+        __builtins__.__dict__["open"] = __realopen__
+        # Report a fake revision number. Anything would do since it's not
+        # used by the library, but it needs to be made of four numbers
+        # separated by dots.
+        return cStringIO.StringIO("0.0.0.0")
+    return __realopen__(fn, *args)
+
+__builtins__.__dict__["open"] = myopen
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/support/rthooks/versioneddll.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,44 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# In addition to the permissions in the GNU General Public License, the
+# authors give you unlimited permission to link or embed the compiled
+# version of this file into combinations with other programs, and to
+# distribute those combinations without any restriction coming from the
+# use of this file. (The General Public License restrictions do apply in
+# other respects; for example, they cover modification of the file, and
+# distribution when not linked into a combine executable.)
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+import os, sys, iu, imp
+class Win32ImportDirector(iu.ImportDirector):
+    def __init__(self):
+        self.path = sys.path[0] # since I run as a hook, sys.path probably hasn't been mucked with
+        if hasattr(sys, 'version_info'):
+            self.suffix = '%d%d'%(sys.version_info[0],sys.version_info[1])
+        else:
+            self.suffix = '%s%s' % (sys.version[0], sys.version[2])
+    def getmod(self, nm):
+        fnm = os.path.join(self.path, nm+self.suffix+'.dll')
+        try:
+            fp = open(fnm, 'rb')
+        except:
+            return None
+        else:
+            mod = imp.load_module(nm, fp, fnm, ('.dll', 'rb', imp.C_EXTENSION))
+            mod.__file__ = fnm
+            return mod
+sys.importManager.metapath.insert(1, Win32ImportDirector())
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/support/rthooks/win32comgenpy.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,39 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# In addition to the permissions in the GNU General Public License, the
+# authors give you unlimited permission to link or embed the compiled
+# version of this file into combinations with other programs, and to
+# distribute those combinations without any restriction coming from the
+# use of this file. (The General Public License restrictions do apply in
+# other respects; for example, they cover modification of the file, and
+# distribution when not linked into a combine executable.)
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+import os, sys
+supportdir = os.path.join(sys.path[0], 'support')
+genpydir = os.path.join(supportdir, 'gen_py')
+initmod = os.path.join(genpydir, '__init__.py')
+if not os.path.exists(genpydir):
+    os.makedirs(genpydir)
+if not os.path.exists(initmod):
+    open(initmod, 'w')
+import win32com
+win32com.__gen_path__ = genpydir
+win32com.__path__.insert(0, supportdir)
+# for older Pythons
+import copy_reg
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/support/unpackTK.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,32 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2002 McMillan Enterprises, Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+import carchive
+import sys
+import os
+
+this = carchive.CArchive(sys.executable)
+tk = this.openEmbedded('tk.pkg')
+targetdir = os.environ['_MEIPASS2']
+for fnm in tk.contents():
+    stuff = tk.extract(fnm)[1]
+    outnm = os.path.join(targetdir, fnm)
+    dirnm = os.path.dirname(outnm)
+    if not os.path.exists(dirnm):
+        os.makedirs(dirnm)
+    open(outnm, 'wb').write(stuff)
+tk = None
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/support/useTK.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,13 @@
+# Generated by Configure.py
+# This file is public domain
+import os, sys
+try:
+    basedir = os.environ['_MEIPASS2']
+except KeyError:
+    basedir = sys.path[0]
+tcldir = os.path.join(basedir, '_MEI', 'tcl8.4')
+tkdir = os.path.join(basedir, '_MEI', 'tk8.4')
+os.environ["TCL_LIBRARY"] = tcldir
+os.environ["TK_LIBRARY"] = tkdir
+os.putenv("TCL_LIBRARY", tcldir)
+os.putenv("TK_LIBRARY", tkdir)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/support/useUnicode.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,3 @@
+# Generated by Configure.py
+# This file is public domain
+import encodings
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/pyinstaller/versionInfo.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,531 @@
+# Copyright (C) 2005, Giovanni Bajo
+# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+import win32api
+import struct
+import pywintypes
+import string
+import pprint
+
+TEST=0
+
+LOAD_LIBRARY_AS_DATAFILE = 2
+RT_VERSION = 16
+
+def getRaw0(o):
+    return o.raw
+def getRaw1(o):
+    return str(buffer(o))
+import sys
+if hasattr(sys, "version_info"):
+    pyvers = sys.version_info[0]*10 + sys.version_info[1]
+else:
+    toks = string.split(sys.version, '.', 2)
+    pyvers = int(toks[0])*10 + int(toks[1])
+if pyvers < 20:
+    getRaw = getRaw0
+else:
+    getRaw = getRaw1
+
+
+##VS_VERSION_INFO {
+##    WORD  wLength;        // Specifies the length of the VS_VERSION_INFO structure
+##    WORD  wValueLength;   // Specifies the length of the Value member
+##    WORD  wType;          // 1 means text, 0 means binary
+##    WCHAR szKey[];        // Contains the Unicode string "VS_VERSION_INFO".
+##    WORD  Padding1[];
+##    VS_FIXEDFILEINFO Value;
+##    WORD  Padding2[];
+##    WORD  Children[];     // Specifies a list of zero or more StringFileInfo or VarFileInfo structures (or both) that are children of the current version structure.
+##};
+def decode(pathnm):
+    h = win32api.LoadLibraryEx(pathnm, 0, LOAD_LIBRARY_AS_DATAFILE)
+    nm = win32api.EnumResourceNames(h, RT_VERSION)[0]
+    data = win32api.LoadResource(h, RT_VERSION, nm)
+    vs = VSVersionInfo()
+    j = vs.fromRaw(data)
+    if TEST:
+        print vs
+        if data[:j] != vs.toRaw():
+            print "AAAAAGGHHHH"
+        txt = repr(vs)
+        glbls = {}
+        glbls['VSVersionInfo'] = VSVersionInfo
+        glbls['FixedFileInfo'] = FixedFileInfo
+        glbls['StringFileInfo'] = StringFileInfo
+        glbls['StringTable'] = StringTable
+        glbls['StringStruct'] = StringStruct
+        glbls['VarFileInfo'] = VarFileInfo
+        glbls['VarStruct'] = VarStruct
+        vs2 = eval(txt+'\n', glbls)
+        if vs.toRaw() != vs2.toRaw():
+            print
+            print 'reconstruction not the same!'
+            print vs2
+    win32api.FreeLibrary(h)
+    return vs
+
+class VSVersionInfo:
+    def __init__(self, ffi=None, kids=None):
+        self.ffi = ffi
+        self.kids = kids
+        if kids is None:
+            self.kids = []
+    def fromRaw(self, data):
+        i, (sublen, vallen, wType, nm) = parseCommon(data)
+        #vallen is length of the ffi, typ is 0, nm is 'VS_VERSION_INFO'
+        i = ((i + 3) / 4) * 4
+        # now a VS_FIXEDFILEINFO
+        self.ffi = FixedFileInfo()
+        j = self.ffi.fromRaw(data, i)
+        #print ffi
+        if TEST:
+            if data[i:j] != self.ffi.toRaw():
+                print "raw:", `data[i:j]`
+                print "ffi:", `self.ffi.toRaw()`
+        i = j
+        while i < sublen:
+            j = i
+            i, (csublen, cvallen, ctyp, nm) = parseCommon(data, i)
+            if string.strip(str(nm)) == "StringFileInfo":
+                sfi = StringFileInfo()
+                k = sfi.fromRaw(csublen, cvallen, nm, data, i, j+csublen)
+                if TEST:
+                    if data[j:k] != sfi.toRaw():
+                        rd = data[j:k]
+                        sd = sfi.toRaw()
+                        for x in range(0, len(rd), 16):
+                            rds = rd[x:x+16]
+                            sds = sd[x:x+16]
+                            if rds != sds:
+                                print "rd[%s:%s+16]: %s" % (x, x, `rds`)
+                                print "sd[%s:%s+16]: %s" % (x, x, `sds`)
+                                print
+                        print "raw: len %d, wLength %d" % (len(rd), struct.unpack('h', rd[:2])[0])
+                        print "sfi: len %d, wLength %d" % (len(sd), struct.unpack('h', sd[:2])[0])
+                self.kids.append(sfi)
+                i = k
+            else:
+                vfi = VarFileInfo()
+                k = vfi.fromRaw(csublen, cvallen, nm, data, i, j+csublen)
+                self.kids.append(vfi)
+                if TEST:
+                    if data[j:k] != vfi.toRaw():
+                        print "raw:", `data[j:k]`
+                        print "vfi:", `vfi.toRaw()`
+                i = k
+            i = j + csublen
+            i = ((i + 3) / 4) * 4
+        return i
+    def toRaw(self):
+        nm = pywintypes.Unicode('VS_VERSION_INFO')
+        rawffi = self.ffi.toRaw()
+        vallen = len(rawffi)
+        typ = 0
+        sublen = 6 + 2*len(nm) + 2
+        pad = ''
+        if sublen % 4:
+            pad = '\000\000'
+        sublen = sublen + len(pad) + vallen
+        pad2 = ''
+        if sublen % 4:
+            pad2 = '\000\000'
+        tmp = []
+        for kid in self.kids:
+            tmp.append(kid.toRaw())
+        tmp = string.join(tmp, '')
+        sublen = sublen + len(pad2) + len(tmp)
+        return struct.pack('hhh', sublen, vallen, typ) + getRaw(nm) + '\000\000' + pad + rawffi + pad2 + tmp
+    def __repr__(self, indent=''):
+        tmp = []
+        newindent = indent + '  '
+        for kid in self.kids:
+            tmp.append(kid.__repr__(newindent+'  '))
+        tmp = string.join(tmp, ', \n')
+        return "VSVersionInfo(\n%sffi=%s,\n%skids=[\n%s\n%s]\n)" % (newindent, self.ffi.__repr__(newindent), newindent, tmp, newindent)
+
+def parseCommon(data, start=0):
+    i = start + 6
+    (wLength, wValueLength, wType) = struct.unpack('3h', data[start:i])
+    #print "wLength, wValueLength, wType, i:", wLength, wValueLength, wType, i
+    i, szKey = parseUString(data, i, i+wLength)
+    #i = ((i + 3) / 4) * 4
+    #print `data[start+6:start+wLength]`
+    return i, (wLength, wValueLength, wType, szKey)
+
+def parseUString(data, start, limit):
+    i = start
+    while i < limit:
+        if data[i:i+2] == '\000\000':
+            break
+        i = i + 2
+    szKey = pywintypes.UnicodeFromRaw(data[start:i])
+    i = i + 2
+    #print "szKey:", '"'+str(szKey)+'"', "(consumed", i-start, "bytes - to", i, ")"
+    return i, szKey
+
+##VS_FIXEDFILEINFO {  // vsffi
+##    DWORD dwSignature;        //Contains the value 0xFEEFO4BD
+##    DWORD dwStrucVersion;     //Specifies the binary version number of this structure. The high-order word of this member contains the major version number, and the low-order word contains the minor version number.
+##    DWORD dwFileVersionMS;    // Specifies the most significant 32 bits of the file's binary version number
+##    DWORD dwFileVersionLS;    //
+##    DWORD dwProductVersionMS; // Specifies the most significant 32 bits of the binary version number of the product with which this file was distributed
+##    DWORD dwProductVersionLS; //
+##    DWORD dwFileFlagsMask;    // Contains a bitmask that specifies the valid bits in dwFileFlags. A bit is valid only if it was defined when the file was created.
+##    DWORD dwFileFlags;        // VS_FF_DEBUG, VS_FF_PATCHED etc.
+##    DWORD dwFileOS;           // VOS_NT, VOS_WINDOWS32 etc.
+##    DWORD dwFileType;         // VFT_APP etc.
+##    DWORD dwFileSubtype;      // 0 unless VFT_DRV or VFT_FONT or VFT_VXD
+##    DWORD dwFileDateMS;
+##    DWORD dwFileDateLS;
+##};
+
+class FixedFileInfo:
+    def __init__(self, filevers=(0, 0, 0, 0), prodvers=(0, 0, 0, 0), mask=0x3f, flags=0x0, OS=0x40004, fileType=0x1, subtype=0x0, date=(0, 0)):
+        self.sig = 0xfeef04bdL
+        self.strucVersion = 0x10000
+        self.fileVersionMS = (filevers[0] << 16) | (filevers[1] & 0xffff)
+        self.fileVersionLS = (filevers[2] << 16) | (filevers[3] & 0xffff)
+        self.productVersionMS = (prodvers[0] << 16) | (prodvers[1] & 0xffff)
+        self.productVersionLS = (prodvers[2] << 16) | (prodvers[3] & 0xffff)
+        self.fileFlagsMask = mask
+        self.fileFlags = flags
+        self.fileOS = OS
+        self.fileType = fileType
+        self.fileSubtype = subtype
+        self.fileDateMS = date[0]
+        self.fileDateLS = date[1]
+    def fromRaw(self, data, i):
+        (self.sig,
+         self.strucVersion,
+         self.fileVersionMS,
+         self.fileVersionLS,
+         self.productVersionMS,
+         self.productVersionLS,
+         self.fileFlagsMask,
+         self.fileFlags,
+         self.fileOS,
+         self.fileType,
+         self.fileSubtype,
+         self.fileDateMS,
+         self.fileDateLS) = struct.unpack('13l', data[i:i+52])
+        return i+52
+    def toRaw(self):
+        return struct.pack('L12l', self.sig,
+                             self.strucVersion,
+                             self.fileVersionMS,
+                             self.fileVersionLS,
+                             self.productVersionMS,
+                             self.productVersionLS,
+                             self.fileFlagsMask,
+                             self.fileFlags,
+                             self.fileOS,
+                             self.fileType,
+                             self.fileSubtype,
+                             self.fileDateMS,
+                             self.fileDateLS)
+    def __repr__(self, indent=''):
+        fv = (self.fileVersionMS >> 16, self.fileVersionMS & 0xffff, self.fileVersionLS >> 16, self.fileVersionLS & 0xFFFF)
+        pv = (self.productVersionMS >> 16, self.productVersionMS & 0xffff, self.productVersionLS >> 16, self.productVersionLS & 0xFFFF)
+        fd = (self.fileDateMS, self.fileDateLS)
+        tmp = ["FixedFileInfo(",
+               "filevers=%s," % (fv,),
+               "prodvers=%s," % (pv,),
+               "mask=%s," % hex(self.fileFlagsMask),
+               "flags=%s," % hex(self.fileFlags),
+               "OS=%s," % hex(self.fileOS),
+               "fileType=%s," % hex(self.fileType),
+               "subtype=%s," % hex(self.fileSubtype),
+               "date=%s" % (fd,),
+               ")"
+              ]
+        return string.join(tmp, '\n'+indent+'  ')
+
+##StringFileInfo {
+##    WORD        wLength;      // Specifies the length of the version resource
+##    WORD        wValueLength; // Specifies the length of the Value member in the current VS_VERSION_INFO structure
+##    WORD        wType;        // 1 means text, 0 means binary
+##    WCHAR       szKey[];      // Contains the Unicode string "StringFileInfo".
+##    WORD        Padding[];
+##    StringTable Children[];   // Specifies a list of zero or more String structures
+##};
+
+class StringFileInfo:
+    def __init__(self, kids=None):
+        self.name = "StringFileInfo"
+        if kids is None:
+            self.kids = []
+        else:
+            self.kids = kids
+    def fromRaw(self, sublen, vallen, name, data, i, limit):
+        self.name = name
+        while i < limit:
+            st = StringTable()
+            j = st.fromRaw(data, i, limit)
+            if TEST:
+                if data[i:j] != st.toRaw():
+                    rd = data[i:j]
+                    sd = st.toRaw()
+                    for x in range(0, len(rd), 16):
+                        rds = rd[x:x+16]
+                        sds = sd[x:x+16]
+                        if rds != sds:
+                            print "rd[%s:%s+16]: %s" % (x, x, `rds`)
+                            print "sd[%s:%s+16]: %s" % (x, x, `sds`)
+                            print
+                    print "raw: len %d, wLength %d" % (len(rd), struct.unpack('h', rd[:2])[0])
+                    print " st: len %d, wLength %d" % (len(sd), struct.unpack('h', sd[:2])[0])
+            self.kids.append(st)
+            i = j
+        return i
+    def toRaw(self):
+        if type(self.name) is STRINGTYPE:
+            self.name = pywintypes.Unicode(self.name)
+        vallen = 0
+        typ = 1
+        sublen = 6 + 2*len(self.name) + 2
+        pad = ''
+        if sublen % 4:
+            pad = '\000\000'
+        tmp = []
+        for kid in self.kids:
+            tmp.append(kid.toRaw())
+        tmp = string.join(tmp, '')
+        sublen = sublen + len(pad) + len(tmp)
+        if tmp[-2:] == '\000\000':
+            sublen = sublen - 2
+        return struct.pack('hhh', sublen, vallen, typ) + getRaw(self.name) + '\000\000' + pad + tmp
+    def __repr__(self, indent=''):
+        tmp = []
+        newindent = indent + '  '
+        for kid in self.kids:
+            tmp.append(kid.__repr__(newindent))
+        tmp = string.join(tmp, ', \n')
+        return "%sStringFileInfo(\n%s[\n%s\n%s])" % (indent, newindent, tmp, newindent)
+
+##StringTable {
+##    WORD   wLength;
+##    WORD   wValueLength;
+##    WORD   wType;
+##    WCHAR  szKey[];
+##    String Children[];    // Specifies a list of zero or more String structures.
+##};
+
+class StringTable:
+    def __init__(self, name=None, kids=None):
+        self.name = name
+        self.kids = kids
+        if name is None:
+            self.name = ''
+        if kids is None:
+            self.kids = []
+    def fromRaw(self, data, i, limit):
+        #print "Parsing StringTable"
+        i, (cpsublen, cpwValueLength, cpwType, self.name) = parseCodePage(data, i, limit) # should be code page junk
+        #i = ((i + 3) / 4) * 4
+        while i < limit:
+            ss = StringStruct()
+            j = ss.fromRaw(data, i, limit)
+            if TEST:
+                if data[i:j] != ss.toRaw():
+                    print "raw:", `data[i:j]`
+                    print " ss:", `ss.toRaw()`
+            i = j
+            self.kids.append(ss)
+            i = ((i + 3) / 4) * 4
+        return i
+    def toRaw(self):
+        if type(self.name) is STRINGTYPE:
+            self.name = pywintypes.Unicode(self.name)
+        vallen = 0
+        typ = 1
+        sublen = 6 + 2*len(self.name) + 2
+        tmp = []
+        for kid in self.kids:
+            raw = kid.toRaw()
+            if len(raw) % 4:
+                raw = raw + '\000\000'
+            tmp.append(raw)
+        tmp = string.join(tmp, '')
+        sublen = sublen + len(tmp)
+        if tmp[-2:] == '\000\000':
+            sublen = sublen - 2
+        return struct.pack('hhh', sublen, vallen, typ) + getRaw(self.name) + '\000\000' + tmp
+    def __repr__(self, indent=''):
+        tmp = []
+        newindent = indent + '  '
+        for kid in self.kids:
+            tmp.append(repr(kid))
+        tmp = string.join(tmp, ',\n%s' % newindent)
+        return "%sStringTable(\n%s'%s', \n%s[%s])" % (indent, newindent, str(self.name), newindent, tmp)
+
+##String {
+##    WORD   wLength;
+##    WORD   wValueLength;
+##    WORD   wType;
+##    WCHAR  szKey[];
+##    WORD   Padding[];
+##    String Value[];
+##};
+
+class StringStruct:
+    def __init__(self, name=None, val=None):
+        self.name = name
+        self.val = val
+        if name is None:
+            self.name = ''
+        if val is None:
+            self.val = ''
+    def fromRaw(self, data, i, limit):
+        i, (sublen, vallen, typ, self.name) = parseCommon(data, i)
+        limit = i + sublen
+        i = ((i + 3) / 4) * 4
+        i, self.val = parseUString(data, i, limit)
+        return i
+    def toRaw(self):
+        if type(self.name) is STRINGTYPE:
+            self.name = pywintypes.Unicode(self.name)
+        if type(self.val) is STRINGTYPE:
+            self.val = pywintypes.Unicode(self.val)
+        vallen = len(self.val) + 1
+        typ = 1
+        sublen = 6 + 2*len(self.name) + 2
+        pad = ''
+        if sublen % 4:
+            pad = '\000\000'
+        sublen = sublen + len(pad) + 2*vallen
+        return struct.pack('hhh', sublen, vallen, typ) + getRaw(self.name) + '\000\000' + pad + getRaw(self.val) + '\000\000'
+    def __repr__(self, indent=''):
+        if pyvers < 20:
+            return "StringStruct('%s', '%s')" % (str(self.name), str(self.val))
+        else:
+            return "StringStruct('%s', '%s')" % (self.name, self.val)
+
+def parseCodePage(data, i, limit):
+    #print "Parsing CodePage"
+    i, (sublen, wValueLength, wType, nm) = parseCommon(data, i)
+    #i = ((i + 3) / 4) * 4
+    return i, (sublen, wValueLength, wType, nm)
+
+##VarFileInfo {
+##    WORD  wLength;        // Specifies the length of the version resource
+##    WORD  wValueLength;   // Specifies the length of the Value member in the current VS_VERSION_INFO structure
+##    WORD  wType;          // 1 means text, 0 means binary
+##    WCHAR szKey[];        // Contains the Unicode string "VarFileInfo".
+##    WORD  Padding[];
+##    Var   Children[];     // Specifies a list of zero or more Var structures
+##};
+
+class VarFileInfo:
+    def __init__(self, kids=None):
+        if kids is None:
+            self.kids = []
+        else:
+            self.kids = kids
+    def fromRaw(self, sublen, vallen, name, data, i, limit):
+        self.sublen = sublen
+        self.vallen = vallen
+        self.name = name
+        i = ((i + 3) / 4) * 4
+        while i < limit:
+            vs = VarStruct()
+            j = vs.fromRaw(data, i, limit)
+            self.kids.append(vs)
+            if TEST:
+                if data[i:j] != vs.toRaw():
+                    print "raw:", `data[i:j]`
+                    print "cmp:", `vs.toRaw()`
+            i = j
+        return i
+    def toRaw(self):
+        self.vallen = 0
+        self.wType = 1
+        self.name = pywintypes.Unicode('VarFileInfo')
+        sublen = 6 + 2*len(self.name) + 2
+        pad = ''
+        if sublen % 4:
+            pad = '\000\000'
+        tmp = []
+        for kid in self.kids:
+            tmp.append(kid.toRaw())
+        tmp = string.join(tmp, '')
+        self.sublen = sublen + len(pad) + len(tmp)
+        return struct.pack('hhh', self.sublen, self.vallen, self.wType) + getRaw(self.name) + '\000\000' + pad + tmp
+    def __repr__(self, indent=''):
+        tmp = map(repr, self.kids)
+        return "%sVarFileInfo([%s])" % (indent, string.join(tmp, ', '))
+
+##Var {
+##    WORD  wLength;        // Specifies the length of the version resource
+##    WORD  wValueLength;   // Specifies the length of the Value member in the current VS_VERSION_INFO structure
+##    WORD  wType;          // 1 means text, 0 means binary
+##    WCHAR szKey[];        // Contains the Unicode string "Translation" or a user-defined key string value
+##    WORD  Padding[];      //
+##    WORD  Value[];        // Specifies a list of one or more values that are language and code-page identifiers
+##};
+
+STRINGTYPE = type('')
+
+class VarStruct:
+    def __init__(self, name=None, kids=None):
+        self.name = name
+        self.kids = kids
+        if name is None:
+            self.name = ''
+        if kids is None:
+            self.kids = []
+    def fromRaw(self, data, i, limit):
+        i, (self.sublen, self.wValueLength, self.wType, self.name) = parseCommon(data, i)
+        i = ((i + 3) / 4) * 4
+        for j in range(self.wValueLength/2):
+            kid = struct.unpack('h', data[i:i+2])[0]
+            self.kids.append(kid)
+            i = i + 2
+        return i
+    def toRaw(self):
+        self.wValueLength = len(self.kids) * 2
+        self.wType = 0
+        if type(self.name) is STRINGTYPE:
+            self.name = pywintypes.Unicode(self.name)
+        sublen = 6 + 2*len(self.name) + 2
+        pad = ''
+        if sublen % 4:
+            pad = '\000\000'
+        self.sublen = sublen + len(pad) + self.wValueLength
+        tmp = []
+        for kid in self.kids:
+            tmp.append(struct.pack('h', kid))
+        tmp = string.join(tmp, '')
+        return struct.pack('hhh', self.sublen, self.wValueLength, self.wType) + getRaw(self.name) + '\000\000' + pad + tmp
+    def __repr__(self, indent=''):
+        return "VarStruct('%s', %s)" % (str(self.name), repr(self.kids))
+
+def SetVersion(exenm, versionfile):
+    txt = open(versionfile, 'r').read()
+    vs = eval(txt+'\n', globals())
+    hdst = win32api.BeginUpdateResource(exenm, 0)
+    win32api.UpdateResource(hdst, RT_VERSION, 1, vs.toRaw())
+    win32api.EndUpdateResource (hdst, 0)
+
+if __name__ == '__main__':
+    import sys
+    TEST = 1
+    if len(sys.argv) < 2:
+        decode('c:/Program Files/Netscape/Communicator/Program/netscape.exe')
+    else:
+        print "Examining", sys.argv[1]
+        decode(sys.argv[1])
+
Binary file srcanamdw/codescanner/pyinstaller/versionInfo.pyc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/python 2_5_1 licenses.txt	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,2006 @@
+Copyright 1995-1996 by Fred L. Drake, Jr., Reston, Virginia, USA, and
+Virginia Polytechnic Institute and State University, Blacksburg,
+Virginia, USA.  Portions of the software copyright 1991-1995 by
+Stichting Mathematisch Centrum, Amsterdam, The Netherlands.  Copying is
+permitted under the terms associated with the main Python distribution,
+with the additional restriction that this additional notice be included
+and maintained on all distributed copies.
+
+                        All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the names of Fred L. Drake, Jr. and
+Virginia Polytechnic Institute and State University not be used in
+advertising or publicity pertaining to distribution of the software
+without specific, written prior permission.
+
+FRED L. DRAKE, JR. AND VIRGINIA POLYTECHNIC INSTITUTE AND STATE
+UNIVERSITY DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+EVENT SHALL FRED L. DRAKE, JR. OR VIRGINIA POLYTECHNIC INSTITUTE AND
+STATE UNIVERSITY BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+
+--
+
+Copyright notice
+================
+
+The Python source is copyrighted, but you can freely use and copy it
+as long as you don't change or remove the copyright notice:
+
+----------------------------------------------------------------------
+Copyright (c) 2000-2007 Python Software Foundation.
+All rights reserved.
+
+Copyright (c) 2000 BeOpen.com.
+All rights reserved.
+
+Copyright (c) 1995-2000 Corporation for National Research Initiatives.
+All rights reserved.
+
+Copyright (c) 1991-1995 Stichting Mathematisch Centrum.
+All rights reserved.
+
+See the file "commontex/license.tex" for information on usage and
+redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+----------------------------------------------------------------------
+
+--
+\section{History of the software}
+
+Python was created in the early 1990s by Guido van Rossum at Stichting
+Mathematisch Centrum (CWI, see \url{http://www.cwi.nl/}) in the Netherlands
+as a successor of a language called ABC.  Guido remains Python's
+principal author, although it includes many contributions from others.
+
+In 1995, Guido continued his work on Python at the Corporation for
+National Research Initiatives (CNRI, see \url{http://www.cnri.reston.va.us/})
+in Reston, Virginia where he released several versions of the
+software.
+
+In May 2000, Guido and the Python core development team moved to
+BeOpen.com to form the BeOpen PythonLabs team.  In October of the same
+year, the PythonLabs team moved to Digital Creations (now Zope
+Corporation; see \url{http://www.zope.com/}).  In 2001, the Python
+Software Foundation (PSF, see \url{http://www.python.org/psf/}) was
+formed, a non-profit organization created specifically to own
+Python-related Intellectual Property.  Zope Corporation is a
+sponsoring member of the PSF.
+
+All Python releases are Open Source (see
+\url{http://www.opensource.org/} for the Open Source Definition).
+Historically, most, but not all, Python releases have also been
+GPL-compatible; the table below summarizes the various releases.
+
+\begin{tablev}{c|c|c|c|c}{textrm}%
+  {Release}{Derived from}{Year}{Owner}{GPL compatible?}
+  \linev{0.9.0 thru 1.2}{n/a}{1991-1995}{CWI}{yes}
+  \linev{1.3 thru 1.5.2}{1.2}{1995-1999}{CNRI}{yes}
+  \linev{1.6}{1.5.2}{2000}{CNRI}{no}
+  \linev{2.0}{1.6}{2000}{BeOpen.com}{no}
+  \linev{1.6.1}{1.6}{2001}{CNRI}{no}
+  \linev{2.1}{2.0+1.6.1}{2001}{PSF}{no}
+  \linev{2.0.1}{2.0+1.6.1}{2001}{PSF}{yes}
+  \linev{2.1.1}{2.1+2.0.1}{2001}{PSF}{yes}
+  \linev{2.2}{2.1.1}{2001}{PSF}{yes}
+  \linev{2.1.2}{2.1.1}{2002}{PSF}{yes}
+  \linev{2.1.3}{2.1.2}{2002}{PSF}{yes}
+  \linev{2.2.1}{2.2}{2002}{PSF}{yes}
+  \linev{2.2.2}{2.2.1}{2002}{PSF}{yes}
+  \linev{2.2.3}{2.2.2}{2002-2003}{PSF}{yes}
+  \linev{2.3}{2.2.2}{2002-2003}{PSF}{yes}
+  \linev{2.3.1}{2.3}{2002-2003}{PSF}{yes}
+  \linev{2.3.2}{2.3.1}{2003}{PSF}{yes}
+  \linev{2.3.3}{2.3.2}{2003}{PSF}{yes}
+  \linev{2.3.4}{2.3.3}{2004}{PSF}{yes}
+  \linev{2.3.5}{2.3.4}{2005}{PSF}{yes}
+  \linev{2.4}{2.3}{2004}{PSF}{yes}
+  \linev{2.4.1}{2.4}{2005}{PSF}{yes}
+  \linev{2.4.2}{2.4.1}{2005}{PSF}{yes}
+  \linev{2.4.3}{2.4.2}{2006}{PSF}{yes}
+  \linev{2.5}{2.4}{2006}{PSF}{yes}
+  \linev{2.5.1}{2.5}{2007}{PSF}{yes}
+\end{tablev}
+
+\note{GPL-compatible doesn't mean that we're distributing
+Python under the GPL.  All Python licenses, unlike the GPL, let you
+distribute a modified version without making your changes open source.
+The GPL-compatible licenses make it possible to combine Python with
+other software that is released under the GPL; the others don't.}
+
+Thanks to the many outside volunteers who have worked under Guido's
+direction to make these releases possible.
+
+
+\section{Terms and conditions for accessing or otherwise using Python}
+
+\centerline{\strong{PSF LICENSE AGREEMENT FOR PYTHON \version}}
+
+\begin{enumerate}
+\item
+This LICENSE AGREEMENT is between the Python Software Foundation
+(``PSF''), and the Individual or Organization (``Licensee'') accessing
+and otherwise using Python \version{} software in source or binary
+form and its associated documentation.
+
+\item
+Subject to the terms and conditions of this License Agreement, PSF
+hereby grants Licensee a nonexclusive, royalty-free, world-wide
+license to reproduce, analyze, test, perform and/or display publicly,
+prepare derivative works, distribute, and otherwise use Python
+\version{} alone or in any derivative version, provided, however, that
+PSF's License Agreement and PSF's notice of copyright, i.e.,
+``Copyright \copyright{} 2001-2006 Python Software Foundation; All
+Rights Reserved'' are retained in Python \version{} alone or in any
+derivative version prepared by Licensee.
+
+\item
+In the event Licensee prepares a derivative work that is based on
+or incorporates Python \version{} or any part thereof, and wants to
+make the derivative work available to others as provided herein, then
+Licensee hereby agrees to include in any such work a brief summary of
+the changes made to Python \version.
+
+\item
+PSF is making Python \version{} available to Licensee on an ``AS IS''
+basis.  PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
+IMPLIED.  BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON \version{} WILL
+NOT INFRINGE ANY THIRD PARTY RIGHTS.
+
+\item
+PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
+\version{} FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR
+LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON
+\version, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE
+POSSIBILITY THEREOF.
+
+\item
+This License Agreement will automatically terminate upon a material
+breach of its terms and conditions.
+
+\item
+Nothing in this License Agreement shall be deemed to create any
+relationship of agency, partnership, or joint venture between PSF and
+Licensee.  This License Agreement does not grant permission to use PSF
+trademarks or trade name in a trademark sense to endorse or promote
+products or services of Licensee, or any third party.
+
+\item
+By copying, installing or otherwise using Python \version, Licensee
+agrees to be bound by the terms and conditions of this License
+Agreement.
+\end{enumerate}
+
+
+\centerline{\strong{BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0}}
+
+\centerline{\strong{BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1}}
+
+\begin{enumerate}
+\item
+This LICENSE AGREEMENT is between BeOpen.com (``BeOpen''), having an
+office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the
+Individual or Organization (``Licensee'') accessing and otherwise
+using this software in source or binary form and its associated
+documentation (``the Software'').
+
+\item
+Subject to the terms and conditions of this BeOpen Python License
+Agreement, BeOpen hereby grants Licensee a non-exclusive,
+royalty-free, world-wide license to reproduce, analyze, test, perform
+and/or display publicly, prepare derivative works, distribute, and
+otherwise use the Software alone or in any derivative version,
+provided, however, that the BeOpen Python License is retained in the
+Software, alone or in any derivative version prepared by Licensee.
+
+\item
+BeOpen is making the Software available to Licensee on an ``AS IS''
+basis.  BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
+IMPLIED.  BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND
+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT
+INFRINGE ANY THIRD PARTY RIGHTS.
+
+\item
+BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE
+SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS
+AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY
+DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
+
+\item
+This License Agreement will automatically terminate upon a material
+breach of its terms and conditions.
+
+\item
+This License Agreement shall be governed by and interpreted in all
+respects by the law of the State of California, excluding conflict of
+law provisions.  Nothing in this License Agreement shall be deemed to
+create any relationship of agency, partnership, or joint venture
+between BeOpen and Licensee.  This License Agreement does not grant
+permission to use BeOpen trademarks or trade names in a trademark
+sense to endorse or promote products or services of Licensee, or any
+third party.  As an exception, the ``BeOpen Python'' logos available
+at http://www.pythonlabs.com/logos.html may be used according to the
+permissions granted on that web page.
+
+\item
+By copying, installing or otherwise using the software, Licensee
+agrees to be bound by the terms and conditions of this License
+Agreement.
+\end{enumerate}
+
+
+\centerline{\strong{CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1}}
+
+\begin{enumerate}
+\item
+This LICENSE AGREEMENT is between the Corporation for National
+Research Initiatives, having an office at 1895 Preston White Drive,
+Reston, VA 20191 (``CNRI''), and the Individual or Organization
+(``Licensee'') accessing and otherwise using Python 1.6.1 software in
+source or binary form and its associated documentation.
+
+\item
+Subject to the terms and conditions of this License Agreement, CNRI
+hereby grants Licensee a nonexclusive, royalty-free, world-wide
+license to reproduce, analyze, test, perform and/or display publicly,
+prepare derivative works, distribute, and otherwise use Python 1.6.1
+alone or in any derivative version, provided, however, that CNRI's
+License Agreement and CNRI's notice of copyright, i.e., ``Copyright
+\copyright{} 1995-2001 Corporation for National Research Initiatives;
+All Rights Reserved'' are retained in Python 1.6.1 alone or in any
+derivative version prepared by Licensee.  Alternately, in lieu of
+CNRI's License Agreement, Licensee may substitute the following text
+(omitting the quotes): ``Python 1.6.1 is made available subject to the
+terms and conditions in CNRI's License Agreement.  This Agreement
+together with Python 1.6.1 may be located on the Internet using the
+following unique, persistent identifier (known as a handle):
+1895.22/1013.  This Agreement may also be obtained from a proxy server
+on the Internet using the following URL:
+\url{http://hdl.handle.net/1895.22/1013}.''
+
+\item
+In the event Licensee prepares a derivative work that is based on
+or incorporates Python 1.6.1 or any part thereof, and wants to make
+the derivative work available to others as provided herein, then
+Licensee hereby agrees to include in any such work a brief summary of
+the changes made to Python 1.6.1.
+
+\item
+CNRI is making Python 1.6.1 available to Licensee on an ``AS IS''
+basis.  CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
+IMPLIED.  BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND
+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT
+INFRINGE ANY THIRD PARTY RIGHTS.
+
+\item
+CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
+1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
+A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1,
+OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
+
+\item
+This License Agreement will automatically terminate upon a material
+breach of its terms and conditions.
+
+\item
+This License Agreement shall be governed by the federal
+intellectual property law of the United States, including without
+limitation the federal copyright law, and, to the extent such
+U.S. federal law does not apply, by the law of the Commonwealth of
+Virginia, excluding Virginia's conflict of law provisions.
+Notwithstanding the foregoing, with regard to derivative works based
+on Python 1.6.1 that incorporate non-separable material that was
+previously distributed under the GNU General Public License (GPL), the
+law of the Commonwealth of Virginia shall govern this License
+Agreement only as to issues arising under or with respect to
+Paragraphs 4, 5, and 7 of this License Agreement.  Nothing in this
+License Agreement shall be deemed to create any relationship of
+agency, partnership, or joint venture between CNRI and Licensee.  This
+License Agreement does not grant permission to use CNRI trademarks or
+trade name in a trademark sense to endorse or promote products or
+services of Licensee, or any third party.
+
+\item
+By clicking on the ``ACCEPT'' button where indicated, or by copying,
+installing or otherwise using Python 1.6.1, Licensee agrees to be
+bound by the terms and conditions of this License Agreement.
+\end{enumerate}
+
+\centerline{ACCEPT}
+
+
+
+\centerline{\strong{CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2}}
+
+Copyright \copyright{} 1991 - 1995, Stichting Mathematisch Centrum
+Amsterdam, The Netherlands.  All rights reserved.
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Stichting Mathematisch
+Centrum or CWI not be used in advertising or publicity pertaining to
+distribution of the software without specific, written prior
+permission.
+
+STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
+THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
+FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+\section{Licenses and Acknowledgements for Incorporated Software}
+
+This section is an incomplete, but growing list of licenses and
+acknowledgements for third-party software incorporated in the
+Python distribution.
+
+
+\subsection{Mersenne Twister}
+
+The \module{_random} module includes code based on a download from
+\url{http://www.math.keio.ac.jp/~matumoto/MT2002/emt19937ar.html}.
+The following are the verbatim comments from the original code:
+
+\begin{verbatim}
+A C-program for MT19937, with initialization improved 2002/1/26.
+Coded by Takuji Nishimura and Makoto Matsumoto.
+
+Before using, initialize the state by using init_genrand(seed)
+or init_by_array(init_key, key_length).
+
+Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+
+ 3. The names of its contributors may not be used to endorse or promote
+    products derived from this software without specific prior written
+    permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+Any feedback is very welcome.
+http://www.math.keio.ac.jp/matumoto/emt.html
+email: matumoto@math.keio.ac.jp
+\end{verbatim}
+
+
+
+\subsection{Sockets}
+
+The \module{socket} module uses the functions, \function{getaddrinfo},
+and \function{getnameinfo}, which are coded in separate source files
+from the WIDE Project, \url{http://www.wide.ad.jp/about/index.html}.
+
+\begin{verbatim}      
+Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
+All rights reserved.
+ 
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+GAI_ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR GAI_ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON GAI_ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN GAI_ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+\end{verbatim}
+
+
+
+\subsection{Floating point exception control}
+
+The source for the \module{fpectl} module includes the following notice:
+
+\begin{verbatim}
+     ---------------------------------------------------------------------  
+    /                       Copyright (c) 1996.                           \ 
+   |          The Regents of the University of California.                 |
+   |                        All rights reserved.                           |
+   |                                                                       |
+   |   Permission to use, copy, modify, and distribute this software for   |
+   |   any purpose without fee is hereby granted, provided that this en-   |
+   |   tire notice is included in all copies of any software which is or   |
+   |   includes  a  copy  or  modification  of  this software and in all   |
+   |   copies of the supporting documentation for such software.           |
+   |                                                                       |
+   |   This  work was produced at the University of California, Lawrence   |
+   |   Livermore National Laboratory under  contract  no.  W-7405-ENG-48   |
+   |   between  the  U.S.  Department  of  Energy and The Regents of the   |
+   |   University of California for the operation of UC LLNL.              |
+   |                                                                       |
+   |                              DISCLAIMER                               |
+   |                                                                       |
+   |   This  software was prepared as an account of work sponsored by an   |
+   |   agency of the United States Government. Neither the United States   |
+   |   Government  nor the University of California nor any of their em-   |
+   |   ployees, makes any warranty, express or implied, or  assumes  any   |
+   |   liability  or  responsibility  for the accuracy, completeness, or   |
+   |   usefulness of any information,  apparatus,  product,  or  process   |
+   |   disclosed,   or  represents  that  its  use  would  not  infringe   |
+   |   privately-owned rights. Reference herein to any specific  commer-   |
+   |   cial  products,  process,  or  service  by trade name, trademark,   |
+   |   manufacturer, or otherwise, does not  necessarily  constitute  or   |
+   |   imply  its endorsement, recommendation, or favoring by the United   |
+   |   States Government or the University of California. The views  and   |
+   |   opinions  of authors expressed herein do not necessarily state or   |
+   |   reflect those of the United States Government or  the  University   |
+   |   of  California,  and shall not be used for advertising or product   |
+    \  endorsement purposes.                                              / 
+     ---------------------------------------------------------------------
+\end{verbatim}
+
+
+
+\subsection{MD5 message digest algorithm}
+
+The source code for the \module{md5} module contains the following notice:
+
+\begin{verbatim}
+  Copyright (C) 1999, 2002 Aladdin Enterprises.  All rights reserved.
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+  L. Peter Deutsch
+  ghost@aladdin.com
+
+  Independent implementation of MD5 (RFC 1321).
+
+  This code implements the MD5 Algorithm defined in RFC 1321, whose
+  text is available at
+http://www.ietf.org/rfc/rfc1321.txt
+  The code is derived from the text of the RFC, including the test suite
+  (section A.5) but excluding the rest of Appendix A.  It does not include
+  any code or documentation that is identified in the RFC as being
+  copyrighted.
+
+  The original and principal author of md5.h is L. Peter Deutsch
+  <ghost@aladdin.com>.  Other authors are noted in the change history
+  that follows (in reverse chronological order):
+
+  2002-04-13 lpd Removed support for non-ANSI compilers; removed
+references to Ghostscript; clarified derivation from RFC 1321;
+now handles byte order either statically or dynamically.
+  1999-11-04 lpd Edited comments slightly for automatic TOC extraction.
+  1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5);
+added conditionalization for C++ compilation from Martin
+Purschke <purschke@bnl.gov>.
+  1999-05-03 lpd Original version.
+\end{verbatim}
+
+
+
+\subsection{Asynchronous socket services}
+
+The \module{asynchat} and \module{asyncore} modules contain the
+following notice:
+
+\begin{verbatim}      
+ Copyright 1996 by Sam Rushing
+
+                         All Rights Reserved
+
+ Permission to use, copy, modify, and distribute this software and
+ its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that copyright notice and this permission
+ notice appear in supporting documentation, and that the name of Sam
+ Rushing not be used in advertising or publicity pertaining to
+ distribution of the software without specific, written prior
+ permission.
+
+ SAM RUSHING DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ NO EVENT SHALL SAM RUSHING BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+\end{verbatim}
+
+
+\subsection{Cookie management}
+
+The \module{Cookie} module contains the following notice:
+
+\begin{verbatim}
+ Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu>
+
+                All Rights Reserved
+
+ Permission to use, copy, modify, and distribute this software
+ and its documentation for any purpose and without fee is hereby
+ granted, provided that the above copyright notice appear in all
+ copies and that both that copyright notice and this permission
+ notice appear in supporting documentation, and that the name of
+ Timothy O'Malley  not be used in advertising or publicity
+ pertaining to distribution of the software without specific, written
+ prior permission.
+
+ Timothy O'Malley DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+ SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS, IN NO EVENT SHALL Timothy O'Malley BE LIABLE FOR
+ ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ PERFORMANCE OF THIS SOFTWARE.
+\end{verbatim}      
+
+
+
+\subsection{Profiling}
+
+The \module{profile} and \module{pstats} modules contain
+the following notice:
+
+\begin{verbatim}
+ Copyright 1994, by InfoSeek Corporation, all rights reserved.
+ Written by James Roskind
+
+ Permission to use, copy, modify, and distribute this Python software
+ and its associated documentation for any purpose (subject to the
+ restriction in the following sentence) without fee is hereby granted,
+ provided that the above copyright notice appears in all copies, and
+ that both that copyright notice and this permission notice appear in
+ supporting documentation, and that the name of InfoSeek not be used in
+ advertising or publicity pertaining to distribution of the software
+ without specific, written prior permission.  This permission is
+ explicitly restricted to the copying and modification of the software
+ to remain in Python, compiled Python, or other languages (such as C)
+ wherein the modified or derived code is exclusively imported into a
+ Python module.
+
+ INFOSEEK CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+ SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS. IN NO EVENT SHALL INFOSEEK CORPORATION BE LIABLE FOR ANY
+ SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+\end{verbatim}
+
+
+
+\subsection{Execution tracing}
+
+The \module{trace} module contains the following notice:
+
+\begin{verbatim}
+ portions copyright 2001, Autonomous Zones Industries, Inc., all rights...
+ err...  reserved and offered to the public under the terms of the
+ Python 2.2 license.
+ Author: Zooko O'Whielacronx
+ http://zooko.com/
+ mailto:zooko@zooko.com
+
+ Copyright 2000, Mojam Media, Inc., all rights reserved.
+ Author: Skip Montanaro
+
+ Copyright 1999, Bioreason, Inc., all rights reserved.
+ Author: Andrew Dalke
+
+ Copyright 1995-1997, Automatrix, Inc., all rights reserved.
+ Author: Skip Montanaro
+
+ Copyright 1991-1995, Stichting Mathematisch Centrum, all rights reserved.
+
+
+ Permission to use, copy, modify, and distribute this Python software and
+ its associated documentation for any purpose without fee is hereby
+ granted, provided that the above copyright notice appears in all copies,
+ and that both that copyright notice and this permission notice appear in
+ supporting documentation, and that the name of neither Automatrix,
+ Bioreason or Mojam Media be used in advertising or publicity pertaining to
+ distribution of the software without specific, written prior permission.
+\end{verbatim} 
+
+
+
+\subsection{UUencode and UUdecode functions}
+
+The \module{uu} module contains the following notice:
+
+\begin{verbatim}
+ Copyright 1994 by Lance Ellinghouse
+ Cathedral City, California Republic, United States of America.
+                        All Rights Reserved
+ Permission to use, copy, modify, and distribute this software and its
+ documentation for any purpose and without fee is hereby granted,
+ provided that the above copyright notice appear in all copies and that
+ both that copyright notice and this permission notice appear in
+ supporting documentation, and that the name of Lance Ellinghouse
+ not be used in advertising or publicity pertaining to distribution
+ of the software without specific, written prior permission.
+ LANCE ELLINGHOUSE DISCLAIMS ALL WARRANTIES WITH REGARD TO
+ THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS, IN NO EVENT SHALL LANCE ELLINGHOUSE CENTRUM BE LIABLE
+ FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+ Modified by Jack Jansen, CWI, July 1995:
+ - Use binascii module to do the actual line-by-line conversion
+   between ascii and binary. This results in a 1000-fold speedup. The C
+   version is still 5 times faster, though.
+ - Arguments more compliant with python standard
+\end{verbatim}
+
+
+
+\subsection{XML Remote Procedure Calls}
+
+The \module{xmlrpclib} module contains the following notice:
+
+\begin{verbatim}
+     The XML-RPC client interface is
+
+ Copyright (c) 1999-2002 by Secret Labs AB
+ Copyright (c) 1999-2002 by Fredrik Lundh
+
+ By obtaining, using, and/or copying this software and/or its
+ associated documentation, you agree that you have read, understood,
+ and will comply with the following terms and conditions:
+
+ Permission to use, copy, modify, and distribute this software and
+ its associated documentation for any purpose and without fee is
+ hereby granted, provided that the above copyright notice appears in
+ all copies, and that both that copyright notice and this permission
+ notice appear in supporting documentation, and that the name of
+ Secret Labs AB or the author not be used in advertising or publicity
+ pertaining to distribution of the software without specific, written
+ prior permission.
+
+ SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
+ TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
+ ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
+ BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
+ DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ OF THIS SOFTWARE.
+\end{verbatim}
+
+--
+
+python2.5-2.5.1/Doc/html/about.dat
+
+<p> <a
+    href="http://saftsack.fs.uni-bayreuth.de/;SPMtilde;latex2ht/">
+    <strong>LaTeX</strong>2<tt>HTML</tt></a> is Copyright &copy;
+  1993, 1994, 1995, 1996, 1997, <a
+    href="http://cbl.leeds.ac.uk/nikos/personal.html">Nikos
+    Drakos</a>, Computer Based Learning Unit, University of
+  Leeds, and Copyright &copy; 1997, 1998, <a
+    href="http://www.maths.mq.edu.au/;SPMtilde;ross/">Ross
+    Moore</a>, Mathematics Department, Macquarie University,
+  Sydney.
+
+
+python2.5-2.5.1/Doc/html/stdabout.dat
+
+<p> <a
+    href="http://saftsack.fs.uni-bayreuth.de/;SPMtilde;latex2ht/">
+    <strong>LaTeX</strong>2<tt>HTML</tt></a> is Copyright &copy;
+  1993, 1994, 1995, 1996, 1997, <a
+    href="http://cbl.leeds.ac.uk/nikos/personal.html">Nikos
+    Drakos</a>, Computer Based Learning Unit, University of
+  Leeds, and Copyright &copy; 1997, 1998, <a
+    href="http://www.maths.mq.edu.au/;SPMtilde;ross/">Ross
+    Moore</a>, Mathematics Department, Macquarie University,
+  Sydney.
+
+--
+
+% Copyright 1995 Virginia Polytechnic Institute and State University
+% and Fred L. Drake, Jr.  This copyright notice must be distributed on
+% all copies, but this document otherwise may be distributed as part
+% of the Python distribution.  No fee may be charged for this document
+% in any representation, either on paper or electronically.  This
+% restriction does not affect other elements in a distributed package
+% in any way.
+
+--
+
+Written by James Roskind.\footnote{
+  Updated and converted to \LaTeX\ by Guido van Rossum.
+  Further updated by Armin Rigo to integrate the documentation for the new
+  \module{cProfile} module of Python 2.5.}
+
+Permission to use, copy, modify, and distribute this Python software
+and its associated documentation for any purpose (subject to the
+restriction in the following sentence) without fee is hereby granted,
+provided that the above copyright notice appears in all copies, and
+that both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of InfoSeek not be used in
+advertising or publicity pertaining to distribution of the software
+without specific, written prior permission.  This permission is
+explicitly restricted to the copying and modification of the software
+to remain in Python, compiled Python, or other languages (such as C)
+wherein the modified or derived code is exclusively imported into a
+Python module.
+
+INFOSEEK CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS. IN NO EVENT SHALL INFOSEEK CORPORATION BE LIABLE FOR ANY
+SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+--
+
+% Piet van Oostrum, Dept of Computer Science, University of Utrecht
+% Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands
+% Telephone: +31 30 2532180. Email: piet@cs.ruu.nl
+% ========================================================================
+% LICENCE: This is free software. You are allowed to use and distribute
+% this software in any way you like. You are also allowed to make modified
+% versions of it, but you can distribute a modified version only if you
+% clearly indicate that it is a modified version and the person(s) who
+% modified it. This indication should be in a prominent place, e.g. in the
+% top of the file. If possible a contact address, preferably by email,
+% should be given for these persons. If that is feasible the modifications
+% should be indicated in the source code.
+% ========================================================================
+
+--
+
+ Copyright (C) 1997-1998 Greg Stein. All Rights Reserved.
+
+ This module is provided under a BSD-ish license. See
+   http://www.opensource.org/licenses/bsd-license.html
+ and replace OWNER, ORGANIZATION, and YEAR as appropriate.
+
+--
+
+License: Any components of the py2app suite may be distributed under
+the MIT or PSF open source licenses.
+
+--
+
+python2.5-2.5.1/Lib/robotparser.py
+""" robotparser.py
+
+    Copyright (C) 2000  Bastian Kleineidam
+
+    You can choose between two licenses when using this package:
+    1) GNU GPLv2
+    2) PSF license for Python 2.2
+
+    The robots.txt Exclusion Protocol is implemented as specified in
+    http://info.webcrawler.com/mak/projects/robots/norobots-rfc.html
+
+--
+
+ Copyright (C) 1986 Gary S. Brown.  You may use this program, or
+ code or tables extracted from it, as desired without restriction.
+
+--
+
+python2.5-2.5.1/Modules/expat/ascii.h
+/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
+   See the file COPYING for copying permission.
+*/
+
+--
+
+python2.5-2.5.1/Modules/expat/macconfig.h
+/*================================================================
+** Copyright 2000, Clark Cooper
+** All rights reserved.
+**
+** This is free software. You are permitted to copy, distribute, or modify
+** it under the terms of the MIT/X license (contained in the COPYING file
+** with this distribution.)
+**
+*/
+
+--
+
+python2.5-2.5.1/Modules/expat/pyexpatns.h
+/* Copyright (c) 2005-2006 ActiveState Software Inc.
+
+--
+
+python2.5-2.5.1/Modules/zlib/Makefile.in
+ Makefile for zlib
+ Copyright (C) 1995-2005 Jean-loup Gailly.
+ For conditions of distribution and use, see copyright notice in zlib.h
+
+python 2.5.1 - python2.5-2.5.1/Modules/zlib/zlib.h
+
+/* zlib.h -- interface of the 'zlib' general purpose compression library
+  version 1.2.3, July 18th, 2005
+
+  Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+  Jean-loup Gailly        Mark Adler
+  jloup@gzip.org          madler@alumni.caltech.edu
+
+
+--
+
+%%% Copyright   Ulf A. Lindgren
+%%%             Department of Applied Electronics
+%%%             Chalmers University of Technology
+%%%             S-412 96 Gothenburg, Sweden
+%%%             E-mail lindgren@ae.chalmers.se
+%%%
+%%% Note        Permission is granted to modify this file under
+%%%             the condition that it is saved using another
+%%%             file and package name.
+
+--
+
+% Copyright 1998,2001 Donald Arseneau;  Distribute freely if unchanged.
+% Instructions follow after the definitions.
+
+--
+
+  Copyright (C) 2000  Luke Kenneth Casson Leighton <lkcl@samba.org>
+
+--
+
+----------------------------------------------------------------------
+  Copyright (c) 1999-2001, Digital Creations, Fredericksburg, VA, USA
+  and Andrew Kuchling. All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions are
+  met:
+
+    o Redistributions of source code must retain the above copyright
+      notice, this list of conditions, and the disclaimer that follows.
+
+    o Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions, and the following disclaimer in
+      the documentation and/or other materials provided with the
+      distribution.
+
+    o Neither the name of Digital Creations nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+  THIS SOFTWARE IS PROVIDED BY DIGITAL CREATIONS AND CONTRIBUTORS *AS
+  IS* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+  PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL DIGITAL
+  CREATIONS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+  DAMAGE.
+----------------------------------------------------------------------
+
+--
+
+ (C) Copyright 2001  Autonomous Zone Industries
+
+ License:  This is free software.  You may use this software for any
+           purpose including modification/redistribution, so long as
+           this header remains intact and that you do not claim any
+           rights of ownership or authorship of this software.  This
+           software has been tested, but no warranty is expressed or
+           implied.
+
+--
+
+------------------------------------------------------------------------
+           Copyright (c) 1997-2001 by Total Control Software
+                         All Rights Reserved
+------------------------------------------------------------------------
+
+ Module Name:  dbShelve.py
+
+ Description:  A reimplementation of the standard shelve.py that
+               forces the use of cPickle, and DB.
+
+ Creation Date:    11/3/97 3:39:04PM
+
+ License:      This is free software.  You may use this software for any
+               purpose including modification/redistribution, so long as
+               this header remains intact and that you do not claim any
+               rights of ownership or authorship of this software.  This
+               software has been tested, but no warranty is expressed or
+               implied.
+
+--
+-----------------------------------------------------------------------
+
+ Copyright (C) 2000, 2001 by Autonomous Zone Industries
+ Copyright (C) 2002 Gregory P. Smith
+
+ License:      This is free software.  You may use this software for any
+               purpose including modification/redistribution, so long as
+               this header remains intact and that you do not claim any
+               rights of ownership or authorship of this software.  This
+               software has been tested, but no warranty is expressed or
+               implied.
+
+--
+
+(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
+(c) Copyright 2000 Guido van Rossum.
+
+--
+
+ Copyright (c) 1997 by Fredrik Lundh
+
+ fredrik@pythonware.com
+ http://www.pythonware.com
+
+
+ --------------------------------------------------------------------
+
+--
+
+ Copyright 2001-2007 by Vinay Sajip. All Rights Reserved.
+
+ Permission to use, copy, modify, and distribute this software and its
+ documentation for any purpose and without fee is hereby granted,
+ provided that the above copyright notice appear in all copies and that
+ both that copyright notice and this permission notice appear in
+ supporting documentation, and that the name of Vinay Sajip
+ not be used in advertising or publicity pertaining to distribution
+ of the software without specific, written prior permission.
+ VINAY SAJIP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+ VINAY SAJIP BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
+ IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+--
+
+Copyright (c) 2001-2006 Gregory P. Ward.  All rights reserved.
+Copyright (c) 2002-2006 Python Software Foundation.  All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+  * Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+  * Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+
+  * Neither the name of the author nor the names of its
+    contributors may be used to endorse or promote products derived from
+    this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+--
+
+    Copyright (c) 1999-2000, Marc-Andre Lemburg; mailto:mal@lemburg.com
+    Copyright (c) 2000-2003, eGenix.com Software GmbH; mailto:info@egenix.com
+
+    Permission to use, copy, modify, and distribute this software and its
+    documentation for any purpose and without fee or royalty is hereby granted,
+    provided that the above copyright notice appear in all copies and that
+    both that copyright notice and this permission notice appear in
+    supporting documentation or portions thereof, including modifications,
+    that you make.
+
+    EGENIX.COM SOFTWARE GMBH DISCLAIMS ALL WARRANTIES WITH REGARD TO
+    THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+    FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
+    INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+    FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+    NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+    WITH THE USE OR PERFORMANCE OF THIS SOFTWARE !
+
+--
+
+ Copyright (C) 2002 Lars Gust?bel <lars@gustaebel.de>
+ All rights reserved.
+
+ Permission  is  hereby granted,  free  of charge,  to  any person
+ obtaining a  copy of  this software  and associated documentation
+ files  (the  "Software"),  to   deal  in  the  Software   without
+ restriction,  including  without limitation  the  rights to  use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies  of  the  Software,  and to  permit  persons  to  whom the
+ Software  is  furnished  to  do  so,  subject  to  the  following
+ conditions:
+
+ The above copyright  notice and this  permission notice shall  be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS  IS", WITHOUT WARRANTY OF ANY  KIND,
+ EXPRESS OR IMPLIED, INCLUDING  BUT NOT LIMITED TO  THE WARRANTIES
+ OF  MERCHANTABILITY,  FITNESS   FOR  A  PARTICULAR   PURPOSE  AND
+ NONINFRINGEMENT.  IN  NO  EVENT SHALL  THE  AUTHORS  OR COPYRIGHT
+ HOLDERS  BE LIABLE  FOR ANY  CLAIM, DAMAGES  OR OTHER  LIABILITY,
+ WHETHER  IN AN  ACTION OF  CONTRACT, TORT  OR OTHERWISE,  ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+
+--
+
+ Copyright 1994 by Lance Ellinghouse
+ Cathedral City, California Republic, United States of America.
+                        All Rights Reserved
+ Permission to use, copy, modify, and distribute this software and its
+ documentation for any purpose and without fee is hereby granted,
+ provided that the above copyright notice appear in all copies and that
+ both that copyright notice and this permission notice appear in
+ supporting documentation, and that the name of Lance Ellinghouse
+ not be used in advertising or publicity pertaining to distribution
+ of the software without specific, written prior permission.
+ LANCE ELLINGHOUSE DISCLAIMS ALL WARRANTIES WITH REGARD TO
+ THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS, IN NO EVENT SHALL LANCE ELLINGHOUSE CENTRUM BE LIABLE
+ FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+--
+
+Metadata-Version: 1.0
+Name: wsgiref
+Version: 0.1.2
+Summary: WSGI (PEP 333) Reference Library
+Author: Phillip J. Eby
+Author-email: web-sig@python.org
+License: PSF or ZPL
+Platform: UNKNOWN
+
+--
+
+python 2.5.1 - python2.5-2.5.1/Lib/wsgiref/validate.py
+
+ (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
+ Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
+ Also licenced under the Apache License, 2.0: http://opensource.org/licenses/apache2.0.php
+ Licensed to PSF under a Contributor Agreement
+
+--
+
+/******************************************************************
+Copyright 1998 by Just van Rossum, Den Haag, The Netherlands.
+
+                        All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Just van Rossum not be 
+used in advertising or publicity pertaining to distribution of the 
+software without specific, written prior permission.
+
+JUST VAN ROSSUM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 
+EVENT SHALL JUST VAN ROSSUM BE LIABLE FOR ANY SPECIAL, INDIRECT OR 
+CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF 
+USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+
+******************************************************************/
+
+--
+
+;; Copyright (C) 1992,1993,1994  Tim Peters
+
+;; Author: 1995-2002 Barry A. Warsaw
+;;         1992-1994 Tim Peters
+;; Maintainer: python-mode@python.org
+;; Created:    Feb 1992
+;; Keywords:   python languages oop
+
+(defconst py-version "$Revision: 1.1 $"
+  "`python-mode' version number.")
+
+;; This software is provided as-is, without express or implied
+;; warranty.  Permission to use, copy, modify, distribute or sell this
+;; software, without fee, for any purpose and by any individual or
+;; organization, is hereby granted, provided that the above copyright
+;; notice and this paragraph appear in all copies.
+
+--
+
+/*----------------------------------------------------------------------
+  Copyright (c) 1999-2001, Digital Creations, Fredericksburg, VA, USA
+  and Andrew Kuchling. All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions are
+  met:
+
+    o Redistributions of source code must retain the above copyright
+      notice, this list of conditions, and the disclaimer that follows.
+
+    o Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions, and the following disclaimer in
+      the documentation and/or other materials provided with the
+      distribution.
+
+    o Neither the name of Digital Creations nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+  THIS SOFTWARE IS PROVIDED BY DIGITAL CREATIONS AND CONTRIBUTORS *AS
+  IS* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+  PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL DIGITAL
+  CREATIONS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+  DAMAGE.
+------------------------------------------------------------------------*/
+
+--
+
+Copyright (c) 2002 Jorge Acereda  <jacereda@users.sourceforge.net> &
+                   Peter O'Gorman <ogorman@users.sourceforge.net>
+                   
+Portions may be copyright others, see the AUTHORS file included with this
+distribution.
+
+Maintained by Peter O'Gorman <ogorman@users.sourceforge.net>
+
+Bug Reports and other queries should go to <ogorman@users.sourceforge.net>
+
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+--
+
+/*
+Copyright (c) 2002 Peter O'Gorman <ogorman@users.sourceforge.net>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+--
+
+libffi - Copyright (c) 1996-2003  Red Hat, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+``Software''), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+--
+
+/* -----------------------------------------------------------------------
+   ffi.c - Copyright (c) 1998 Cygnus Solutions
+           Copyright (c) 2004 Simon Posnjak
+   Copyright (c) 2005 Axis Communications AB
+
+   CRIS Foreign Function Interface
+
+   Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this software and associated documentation files (the
+   ``Software''), to deal in the Software without restriction, including
+   without limitation the rights to use, copy, modify, merge, publish,
+   distribute, sublicense, and/or sell copies of the Software, and to
+   permit persons to whom the Software is furnished to do so, subject to
+   the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+   IN NO EVENT SHALL SIMON POSNJAK BE LIABLE FOR ANY CLAIM, DAMAGES OR
+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
+   ----------------------------------------------------------------------- */
+
+--
+
+/* -----------------------------------------------------------------------
+   eabi.S - Copyright (c) 2004  Anthony Green
+   
+   FR-V Assembly glue.
+
+   $Id: python\0402_5_1\040licenses.txt,v 1.1 2009/02/05 23:03:30 stechong Exp $
+
+   Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this software and associated documentation files (the
+   ``Software''), to deal in the Software without restriction, including
+   without limitation the rights to use, copy, modify, merge, publish,
+   distribute, sublicense, and/or sell copies of the Software, and to
+   permit persons to whom the Software is furnished to do so, subject to
+   the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+   IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
+   ----------------------------------------------------------------------- */
+
+--
+
+/* -----------------------------------------------------------------------
+   ffi.c - Copyright (c) 1998 Red Hat, Inc.
+   Copyright (c) 2000 Hewlett Packard Company
+   
+   IA64 Foreign Function Interface 
+
+   Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this software and associated documentation files (the
+   ``Software''), to deal in the Software without restriction, including
+   without limitation the rights to use, copy, modify, merge, publish,
+   distribute, sublicense, and/or sell copies of the Software, and to
+   permit persons to whom the Software is furnished to do so, subject to
+   the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+   IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
+   ----------------------------------------------------------------------- */
+
+--
+
+/* -----------------------------------------------------------------------
+   ffi.c - Copyright (c) 2004  Renesas Technology
+   
+   M32R Foreign Function Interface 
+
+   Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this software and associated documentation files (the
+   ``Software''), to deal in the Software without restriction, including
+   without limitation the rights to use, copy, modify, merge, publish,
+   distribute, sublicense, and/or sell copies of the Software, and to
+   permit persons to whom the Software is furnished to do so, subject to
+   the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+   IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR
+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
+   ----------------------------------------------------------------------- */
+
+--
+
+/* -----------------------------------------------------------------------
+   asm.h - Copyright (c) 1998 Geoffrey Keating
+
+   PowerPC Assembly glue.
+
+   Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this software and associated documentation files (the
+   ``Software''), to deal in the Software without restriction, including
+   without limitation the rights to use, copy, modify, merge, publish,
+   distribute, sublicense, and/or sell copies of the Software, and to
+   permit persons to whom the Software is furnished to do so, subject to
+   the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+   IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
+   ----------------------------------------------------------------------- */
+
+--
+
+/* -----------------------------------------------------------------------
+   darwin.S - Copyright (c) 2000 John Hornkvist
+      Copyright (c) 2004 Free Software Foundation, Inc.
+
+   PowerPC Assembly glue.
+
+   Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this software and associated documentation files (the
+   ``Software''), to deal in the Software without restriction, including
+   without limitation the rights to use, copy, modify, merge, publish,
+   distribute, sublicense, and/or sell copies of the Software, and to
+   permit persons to whom the Software is furnished to do so, subject to
+   the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+   IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
+   ----------------------------------------------------------------------- */
+
+--
+
+/* -----------------------------------------------------------------------
+   darwin_closure.S - Copyright (c) 2002, 2003, 2004, Free Software Foundation,
+   Inc. based on ppc_closure.S
+
+   PowerPC Assembly glue.
+
+   Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this software and associated documentation files (the
+   ``Software''), to deal in the Software without restriction, including
+   without limitation the rights to use, copy, modify, merge, publish,
+   distribute, sublicense, and/or sell copies of the Software, and to
+   permit persons to whom the Software is furnished to do so, subject to
+   the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+   IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
+   ----------------------------------------------------------------------- */
+
+--
+
+/* -----------------------------------------------------------------------
+   ffi.c - Copyright (c) 1998 Geoffrey Keating
+
+   PowerPC Foreign Function Interface
+
+   Darwin ABI support (c) 2001 John Hornkvist
+   AIX ABI support (c) 2002 Free Software Foundation, Inc.
+
+   Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this software and associated documentation files (the
+   ``Software''), to deal in the Software without restriction, including
+   without limitation the rights to use, copy, modify, merge, publish,
+   distribute, sublicense, and/or sell copies of the Software, and to
+   permit persons to whom the Software is furnished to do so, subject to
+   the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+   IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
+   ----------------------------------------------------------------------- */
+
+--
+
+/* -----------------------------------------------------------------------
+   sysv.h - Copyright (c) 2003 Jakub Jelinek <jakub@redhat.com>
+
+   PowerPC64 Assembly glue.
+
+   Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this software and associated documentation files (the
+   ``Software''), to deal in the Software without restriction, including
+   without limitation the rights to use, copy, modify, merge, publish,
+   distribute, sublicense, and/or sell copies of the Software, and to
+   permit persons to whom the Software is furnished to do so, subject to
+   the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+   IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
+   ----------------------------------------------------------------------- */
+
+--
+
+/* -----------------------------------------------------------------------
+   ffi.c - Copyright (c) 2000 Software AG
+ 
+   S390 Foreign Function Interface
+ 
+   Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this software and associated documentation files (the
+   ``Software''), to deal in the Software without restriction, including
+   without limitation the rights to use, copy, modify, merge, publish,
+   distribute, sublicense, and/or sell copies of the Software, and to
+   permit persons to whom the Software is furnished to do so, subject to
+   the following conditions:
+ 
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+ 
+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+   IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
+   ----------------------------------------------------------------------- */
+
+--
+
+/* -----------------------------------------------------------------------
+   ffi.c - Copyright (c) 2002, 2003, 2004, 2005 Kaz Kojima
+   
+   SuperH Foreign Function Interface 
+
+   Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this software and associated documentation files (the
+   ``Software''), to deal in the Software without restriction, including
+   without limitation the rights to use, copy, modify, merge, publish,
+   distribute, sublicense, and/or sell copies of the Software, and to
+   permit persons to whom the Software is furnished to do so, subject to
+   the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+   IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
+   ----------------------------------------------------------------------- */
+
+--
+
+/* -----------------------------------------------------------------------
+   ffi.c - Copyright (c) 1996, 1998, 1999, 2001  Red Hat, Inc.
+           Copyright (c) 2002  Ranjit Mathew
+           Copyright (c) 2002  Bo Thorsen
+           Copyright (c) 2002  Roger Sayle
+   
+   x86 Foreign Function Interface 
+
+   Permission is hereby granted, free of charge, to any person obtaining
+   a copy of this software and associated documentation files (the
+   ``Software''), to deal in the Software without restriction, including
+   without limitation the rights to use, copy, modify, merge, publish,
+   distribute, sublicense, and/or sell copies of the Software, and to
+   permit persons to whom the Software is furnished to do so, subject to
+   the following conditions:
+
+   The above copyright notice and this permission notice shall be included
+   in all copies or substantial portions of the Software.
+
+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+   IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
+   ----------------------------------------------------------------------- */
+
+--
+
+/***********************************************************
+Copyright (C) 1997, 2002, 2003 Martin von Loewis
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies.
+
+This software comes with no warranty. Use at your own risk.
+
+******************************************************************/
+
+--
+
+   The code in this module was based on a download from:
+  http://www.math.keio.ac.jp/~matumoto/MT2002/emt19937ar.html
+
+   It was modified in 2002 by Raymond Hettinger as follows:
+
+* the principal computational lines untouched except for tabbing.
+
+* renamed genrand_res53() to random_random() and wrapped
+  in python calling/return code.
+
+* genrand_int32() and the helper functions, init_genrand()
+  and init_by_array(), were declared static, wrapped in
+  Python calling/return code.  also, their global data
+  references were replaced with structure references.
+
+* unused functions from the original were deleted.
+  new, original C python code was added to implement the
+  Random() interface.
+
+   The following are the verbatim comments from the original code:
+
+   A C-program for MT19937, with initialization improved 2002/1/26.
+   Coded by Takuji Nishimura and Makoto Matsumoto.
+
+   Before using, initialize the state by using init_genrand(seed)
+   or init_by_array(init_key, key_length).
+
+   Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+     1. Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+
+     2. Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+
+     3. The names of its contributors may not be used to endorse or promote
+products derived from this software without specific prior written
+permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+--
+
+ * Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org>
+ *
+ * This file is part of psycopg and was adapted for pysqlite. Federico Di
+ * Gregorio gave the permission to use it within pysqlite under the following
+ * license:
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty.  In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ *    claim that you wrote the original software. If you use this software
+ *    in a product, an acknowledgment in the product documentation would be
+ *    appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ *    misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+
+--
+
+/***********************************************************
+Copyright (C) 1994 Steen Lumholt.
+
+                        All Rights Reserved
+
+******************************************************************/
+
+--
+
+/*
+ * Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+--
+
+ * Copyright 1992-1994, David Gottner
+ *
+ *                    All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its 
+ * documentation for any purpose and without fee is hereby granted, 
+ * provided that the above copyright notice, this permission notice and
+ * the following disclaimer notice appear unmodified in all copies.
+ *
+ * I DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL I
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
+ * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA, OR PROFITS, WHETHER
+ * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Nevertheless, I would like to know about bugs in this library or
+ * suggestions for improvment.  Send bug reports and feedback to
+ * davegottner@delphi.com.
+
+--
+
+Copyright (c), 1997-2006, Marc-Andre Lemburg (mal@lemburg.com)
+Copyright (c), 2000-2006, eGenix.com Software GmbH (info@egenix.com)
+
+                   All Rights Reserved.
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee or royalty is hereby
+granted, provided that the above copyright notice appear in all copies
+and that both that copyright notice and this permission notice appear
+in supporting documentation or portions thereof, including
+modifications, that you make.
+
+THE AUTHOR MARC-ANDRE LEMBURG DISCLAIMS ALL WARRANTIES WITH REGARD TO
+THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
+INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+WITH THE USE OR PERFORMANCE OF THIS SOFTWARE !
+
+--
+
+/***********************************************************
+Copyright 1994 by Lance Ellinghouse,
+Cathedral City, California Republic, United States of America.
+
+                        All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its 
+documentation for any purpose and without fee is hereby granted, 
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in 
+supporting documentation, and that the name of Lance Ellinghouse
+not be used in advertising or publicity pertaining to distribution 
+of the software without specific, written prior permission.
+
+LANCE ELLINGHOUSE DISCLAIMS ALL WARRANTIES WITH REGARD TO
+THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS, IN NO EVENT SHALL LANCE ELLINGHOUSE BE LIABLE FOR ANY SPECIAL, 
+INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING 
+FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 
+NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 
+WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+******************************************************************/
+
+--
+
+Copyright:Copyright ? 1999 by Apple Computer, Inc., all rights reserved.
+
+You may incorporate this Apple sample source code into your program(s) without
+restriction. This Apple sample source code has been provided "AS IS" and the
+responsibility for its operation is yours. You are not permitted to redistribute
+this Apple sample source code as "Apple sample source code" after having made
+changes. If you're going to re-distribute the source, we require that you make
+it clear in the source that the code was descended from Apple sample source
+code, but that you've made changes.
+
+--
+
+  Copyright (C) 1999, 2000, 2002 Aladdin Enterprises.  All rights reserved.
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+--
+
+/*
+ * Copyright (c) 1993 George V. Neville-Neil
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *This product includes software developed by George V. Neville-Neil
+ * 4. The name, George Neville-Neil may not be used to endorse or promote 
+ *    products derived from this software without specific prior 
+ *    written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+--
+
+ Copyright 2000, Mojam Media, Inc., all rights reserved.
+ Author: Skip Montanaro
+
+ Copyright 1999, Bioreason, Inc., all rights reserved.
+ Author: Andrew Dalke
+
+ Copyright 1995-1997, Automatrix, Inc., all rights reserved.
+ Author: Skip Montanaro
+
+ Copyright 1991-1995, Stichting Mathematisch Centrum, all rights reserved.
+
+
+ Permission to use, copy, modify, and distribute this Python software and
+ its associated documentation for any purpose without fee is hereby
+ granted, provided that the above copyright notice appears in all copies,
+ and that both that copyright notice and this permission notice appear in
+ supporting documentation, and that the name of neither Automatrix,
+ Bioreason or Mojam Media be used in advertising or publicity pertaining to
+ distribution of the software without specific, written prior permission.
+
+--
+/* Author: Toby Dickenson <htrd90@zepler.org>
+ *
+ * Copyright (c) 1999 Toby Dickenson
+ *
+ * Permission to use this software in any way is granted without
+ * fee, provided that the copyright notice above appears in all
+ * copies. This software is provided "as is" without any warranty.
+ */
+
+--
+python2.5-2.5.1/Modules/linuxaudiodev.c
+ ******************************************************************************
+ * linuxaudiodev.c -- Linux audio device for python.
+ * 
+ * Author          : Peter Bosch
+ * Created On      : Thu Mar  2 21:10:33 2000
+ * Status          : Unknown, Use with caution!
+ * 
+linuxaudiodev.c
+ * (C) 2000 Peter Bosch, all rights reserved.
+ ******************************************************************************
+ */
+
+--
+
+
+python2.5-2.5.1/Modules/ossaudiodev.c
+ *                flavours of BSD [XXX which ones?]; it is also available
+ *                for a wide range of commercial Unices.
+ *
+ * Originally written by Peter Bosch, March 2000, as linuxaudiodev.
+ *
+ * Renamed to ossaudiodev and rearranged/revised/hacked up
+ * by Greg Ward <gward@python.net>, November 2002.
+ossaudiodev.c
+ * (c) 2000 Peter Bosch.  All Rights Reserved.
+ * (c) 2002 Gregory P. Ward.  All Rights Reserved.
+ * (c) 2002 Python Software Foundation.  All Rights Reserved.
+  Copyright (c) 1998-2002 John Aycock
+
+  Permission is hereby granted, free of charge, to any person obtaining
+  a copy of this software and associated documentation files (the
+  "Software"), to deal in the Software without restriction, including
+  without limitation the rights to use, copy, modify, merge, publish,
+  distribute, sublicense, and/or sell copies of the Software, and to
+  permit persons to whom the Software is furnished to do so, subject to
+  the following conditions:
+
+  The above copyright notice and this permission notice shall be
+  included in all copies or substantial portions of the Software.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.W s9AL
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/release_notes.txt	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,498 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# #################################################################
+
+Nokia CodeScanner Command Line Tool Release Notes
+=================================================
+
+Version 2.1.4
+=============
+- Copyright changes done.
+
+Version 2.1.3
+=============
+- Updated the function parser in CodeScanner to improve check for
+leaving functions called in non-leaving functions. There should
+be less false positives now.
+
+
+Version 2.1.2
+=============
+- Added new IAD rule to check flag usage. IA must not use R&D flags 
+nor feature flags via preprocessor statements in the source code. 
+This means bldvariant.hrh and productvariant.hrh should not be used.
+This new rule is set to low severity in the "Other" category by 
+default. It can be configured by adding a <flags> script element 
+in the configuration file. 
+Example :
+<codescannerConfig>
+  <scripts>
+    <flags category="other" 
+           enable="true" 
+           severity="low"/>
+  </scripts>
+</codescannerConfig>
+
+- Added new IAD rule to check Central Repository usage. IA cannot 
+assume that the Central Repository is set up fully. This means the 
+return value of CRepository::get() cannot be ignored.
+This new rule is set to low severity in the "Other" category by 
+default. It can be configured by adding a <crepository> script 
+element in the configuration file. 
+Example :
+<codescannerConfig>
+  <scripts>
+    <crepository category="other" 
+                 enable="true" 
+                 severity="low"/>
+  </scripts>
+</codescannerConfig>
+
+- Added new IAD rule to check customizable icons. Due to device 
+customization requirements, IA must not remove any customization 
+done by the variant team. This means IA cannot include customizable 
+icons.
+This new rule is set to low severity in the "Other" category by 
+default. It can be configured by adding a <customizableicons> 
+script element in the configuration file. Names of icons can be 
+specified in the <iconsRE> element.
+Example :
+<codescannerConfig>
+  <scripts>
+    <customizableicons category="other" 
+                       enable="true" 
+                       severity="low">
+      <iconsRE>iconA.bmp|iconB.svg|iconC</iconsRE>
+    </customizableicons>
+  </scripts>
+</codescannerConfig>
+
+
+Version 2.1.1
+=============
+- Added support for user-defined rules. This can be done by
+adding a <customrules> element to the configuration file.
+Example :
+<codescannerConfig>
+  <customrules>
+    <customrule>
+      <name>myOwnRule</name>
+      <keyword type=”class”>CMyOwnClass</keyword>
+      <filetype>h</filetype>
+      <severity>low</severity>
+      <title>My CodeScanner rule targeting CMyOwnClass</title>
+      <description>Locate definition of CMyOwnClass</description>
+    </customrule>
+  </customrules>
+</codescannerConfig>
+More information on the syntax of this new element can be found in 
+the document "CodeScanner_XML_ConfigFile_Spec.doc".
+
+- When scanning with low severity rules, CodeScanner now 
+generates informative messages instead of warnings when the 
+StdOut output format is selected.
+
+- Added support to disable individual error/warning via
+CodeScanner commands embedded in comments. The command has the 
+following format : 
+  codescanner(::<rule name>)+
+Example :
+void CTestCase::Foo()
+{
+  array->At(a); // codescanner::accessArrayElementWithoutCheck
+  User::Leave(KErrNone); /* codescanner::LeaveNoError */
+}
+A complete list of CodeScanner rule names can be found in the 
+document "CodeScanner_Rules.doc".
+
+- Added new rule to check whether Cancel() function is called 
+in active object's destructor.
+Cancel() should always be called in active object's destructor 
+to cancel an outstanding request if there is one. If there is 
+no request pending then Cancel() just does nothing, but if we 
+do not call Cancel() when having an outstanding request a panic 
+will be raised.
+This new rule is set to low severity in the "Coding Standards"
+category by default. It can be configured by adding a 
+<missingcancel> script element in the configuration
+file. 
+Example :
+<codescannerConfig>
+  <scripts>
+    <missingcancel category="codingstandards" 
+                   enable="true" 
+                   severity="low"/>
+  </scripts>
+</codescannerConfig>
+
+-Updated the function parser in CodeScanner to filter out constant 
+initialization.
+
+- Updated active object checking rule to ignore After() from 
+RTimer type member variables.
+
+- Updated to skip excluded folders specified in configuration file 
+when generating component summary reports.
+
+
+Version 2.1.0
+=============
+- Previously CodeScanner has been distributed as a single-file
+executable which packs all the DLLs and library modules it needed 
+into an archive attached to itself. During runtime, it creates a 
+directory (_MEI<id>) in the user's temp directory, and extract 
+these files there. When execution is complete, it recursively 
+removes the entire directory it created. 
+Unfortunately the cleanup process sometimes fail. So over time 
+user's temp directory can be littered with these directories, 
+which can cause CodeScanner to fail if it tries to reuse a 
+directory that was created from a previous run.
+To address this problem, we separated all these modules from 
+CodeScanner.exe and shipping them "as is". This change should be
+transparent from user's point of view, except when copying
+CodeScanner to other locations on user's system.
+
+- Updated configuration file format to allow passing arguments 
+to CodeScanner. One can now add an <arguments> element to the 
+configuration file with one or more of the following 
+child elements :
+<input> - specify additional directory/file to scan
+<outputformat> (html|xml|std) - specify output format
+<lxr> - url to lxr site
+<lxrversion> - lxr version
+<timestampedoutput> (on/off) - create time-stamped output directory 
+Example:
+<codescannerConfig>
+  <arguments>
+    <input>C:\Testing\CodeScanner_Tests\Bug_6393\Includes</input>
+    <outputformat>html|xml</outputformat>
+    <lxr>http://s60lxr/source/</lxr>
+    <lxrversion>S60_3_2_200736</lxrversion>
+    <timestampedoutput>on</timestampedoutput>
+  </arguments>
+</codescannerConfig>
+
+- Added new rule to check stack-based resource objects not put 
+on the cleanup stack.
+If a stack-based resource object is not put on the cleanup stack 
+with CleanupClosePushL() or CleanupResetAndDestroyPushL(), and 
+a leaving function or ELeave is called, a memory leak occurs. 
+CodeScanner occasionally gives false positives for this issue. 
+Individual cases should be investigated.
+This new rule is set to low severity in the "Code Review"
+category by default. It can be configured by adding a 
+<resourcenotoncleanupstack> script element in the configuration
+file. 
+Example :
+<codescannerConfig>
+  <scripts>
+    <resourcenotoncleanupstack category="codereview" 
+                               enable="true" 
+                               severity="low"/>
+  </scripts>
+</codescannerConfig>
+
+- Added new rule to check inheritance order of M and C classes. 
+If a C class inherits first from an M class and then a C class,
+a panic can occur when trying to pop a CBase pointer pointing 
+to such a class from the cleanup stack when in fact a pointer 
+pointing to the first predecessor, the mixin class, was popped 
+instead.
+This new rule is set to high severity in the "Can Panic"
+category by default. It can be configured by adding a 
+<inheritanceorder> script element in the configuration file. 
+Example :
+<codescannerConfig>
+  <scripts>
+    <inheritanceorder category="canpanic" 
+                      enable="true" 
+                      severity="high"/>
+  </scripts>
+</codescannerConfig>
+
+- Updated rule for L-functions that cannot leave. It is now
+possible to specify functions to be ignored by this rule in the
+configuration file. This is done by adding a <LFunctionIgnoreRE> 
+element to the <LFunctionCantLeave> script element.
+Example:
+<codescannerConfig>
+  <scripts>
+    <LFunctionCantLeave enable="true">
+      <LFunctionIgnoreRE>RunL</LFunctionIgnoreRE>
+    </LFunctionCantLeave>
+  </scripts>
+</codescannerConfig>
+
+- Updated description of rule for badly-named enum members.
+
+- Updated NULL equality check rule to ignore pointer comparisons 
+with NULL inside various __ASSERT_XXX() macros.
+
+- Removed duplicate rule for hard-coded external drive letters. 
+There is now only 1 rule that check for this problem and it is 
+a low severity rule in the Coding Standard category.
+
+- Improved rule for accessing array element by [] without 
+checking range.
+
+
+Version 2.0.9
+=============
+- Updated check for Open() to allow assignment of return value on 
+a different line.
+Example :
+  TInt error = 
+    myFile.Open();
+
+
+Version 2.0.8
+=============
+- Updated check for C class not inheriting from another C class.
+It is now possible to specify C class that does not inherit from
+another C class in the configuration file. This is done by adding
+a <cclassIgnoreRE> element to the <missingcclass> script element.
+Example :
+<missingcclass enable="true">
+  <cclassIgnoreRE>CLogger|CKeypadData</cclassIgnoreRE>
+</missingcclass>
+
+- Updated check for ignored Open() return value.
+It is now possible to specify object or class with Open() method
+that does not return any value in the configuration file. 
+This is done by adding an <openIgnoreRE> element to the 
+<open> script element. For a local variable, one can specify 
+either the type or variable name in the <openIgnoreRE> element. 
+For other types of object, one should specify the object name in 
+the <openIgnoreRE> element. 
+Example:
+<open enable="true">
+  <openIgnoreRE>CKeyStore|iKeyStore|lKeyStore</openIgnoreRE>
+</open>
+
+- Fixed a bug where some scripts cannot be disabled from the
+configuration file.
+
+
+Version 2.0.7
+=============
+- Updated standard console output to include severity level and
+category information in the error/warning messages.
+
+- Incorporated Psyco module to improve scanning performance. Please
+refer to the document "MIT license.txt" for licensing info.
+
+
+Version 2.0.6
+=============
+- Updated check for CleanupStack::Pop(AndDestroy)() to ignore
+CleanupStack::Pop(TInt, TAny*) and 
+CleanupStack::PopAndDestroy(TInt, TAny*)
+
+- Updated check for Open() to allow handler of return value on a 
+different line.
+Example :
+  User::LeaveIfError(
+    myFile.Open());
+
+- Updated check for At() to ignore timer objects.
+Example :
+  TTime now;
+  iTimer.At(iStatus, now);
+
+- Improved handling of scanning of code with #ifdef/#else/#endif
+preprocessor commands. CodeScanner sometimes can be confused by
+code surrounded by these preprocessor commands, e.g. generating
+warnings on member variable deleted incorrectly, even when it 
+happens inside a destructor. This has been fixed.
+
+
+Version 2.0.5
+=============
+- Added new option to specify additional source directory/file :
+"-i <source dir/file>" -- specify additional directory/file to scan
+Example : codescanner -i C:\resources -i C:\includes
+          C:\sources C:\results
+
+
+Version 2.0.4
+=============
+- Updated HTML generation to use '/' instead of '\' when generating
+links; this change is needed for Mozilla Firefox compatibility.
+
+- Added new option to toggle creation of time-stamped directory for
+results :
+"-t on/off" -- create a time-stamped directory for results; default
+               is on
+Example : codescanner -t off C:\sources C:\results
+
+- Added new option to configure output format of results:
+"-o html|xml|std" -- specify output format : HTML, XML or StdOut;
+                     default output format is HTML
+Multiple output formats can be specified at the same time.
+Example : codescanner -o xml,html C:\sources C:\results
+
+- Updated configuration file format to allow user setting the
+category and severity of scripts individually. Each <scripts> element
+contains one or more Script elements, each of which corresponds to a
+CodeScanner rule. Each Script element has the following attributes:
+enable (boolean) – specifies whether a script is enabled by CodeScanner.
+severity (string) – specifies the severity level of a script.
+category (string) – specifies the category of a script.
+Example :
+<codescannerConfig>
+  <scripts>
+    <baddefines enable="true" severity="low" category="codingstandards"/>
+    <friend enable="true" severity="low" category="codereview"/>
+    <leave enable="true" severity="high" category="canpanic"/>
+  </scripts>
+</codescannerConfig>
+
+
+Version 2.0.3
+=============
+- Updated HTML generation so that links with the '#' character can be
+opened by Mozilla Firefox correctly.
+
+- Added new options to generate links to LXR server instead of local 
+file system. The new options are :
+"-x" -- specify URL of LXR site
+"-r" -- specify LXR version
+
+Example : codescanner -x http://some.lxr.server/sources/ -r S60_3_2_12
+C:\sources C:\results
+
+Once scanning is completed, the results will point to the remote 
+LXR server instead of the local "C:\sources" folder.
+*****This new feature has been contributed by James Uther of Nokia*****
+
+
+Version 2.0.2
+=============
+- Updated HTML generation so that source file links can be opened by
+Mozilla Firefox.
+
+- Improved handling of function parameter list spanning multiple lines.
+Example :
+void CMenuBar::MyMenu (const HBufC* a,
+                       const TDesC& b)
+{ ... }
+
+- Improved handling of TRAP block spanning multiple lines.
+Example :
+  TRAPD(
+    err,
+    WaitDialogL(aErrorCode)
+  );
+
+- Updated handling of NULL equality check to allow comparison with NULL
+in return statement. 
+Example :
+  return (ptr != NULL);
+
+- Updated handling of hard-coded numbers so that '2' is no longer 
+considered a 'magic number'.
+
+
+Version 2.0.1b
+==============
+- When checking for leaving functions called in non-leaving functions,
+Cases where macros are used for class declarations are now filtered out.
+Example :
+NONSHARABLE_CLASS(CMyClass) : public CActive 
+{ ... }
+
+- When generating individual component report, text containing HTML tags
+(eg. <s>, <i>) are now cleaned up before written to file. This
+prevents unintended text formatting.
+
+- Corrected spelling mistake in usage info.
+
+
+Version 2.0.0a
+==============
+- This is the first development release of Nokia's version of CodeScanner CLI. 
+Our goals for this release are to :
+1) support feature-functions available in Mobile Innovation's CodeScanner v 1.11
+2) address reported issues
+
+The following are known issues from CodeScanner v 1.11 :
+1) CodeScanner output is not entirely compatible with Mozilla Firefox. 
+For security reasons, Mozila Firefox and Mozilla Suite do not allow links to 
+local files (and directories). This includes linking to files on the hard drive, 
+on mapped network drives, and those accessible via UNC paths.
+2) CodeScanner treats 2 as a ‘magic number’. In User Interface code, '2' is 
+often used to calculate offsets and should not always be replaced by variable.
+3) CodeScanner does not ignore CleanupStack::Pop() without parameters 
+if CleanupClosePushL() or similar utility is used.
+4) CodeScanner flags all use of #if in .h files irrespective of context.
+
+Licensing Notes
+===============
+CodeScanner is built with Python 2.5.1 but does NOT use any of the following
+files or modules :
+python2.5-2.5.1/Lib/test/decimaltestdata/abs.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/add.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/base.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/clamp.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/compare.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/decimal128.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/decimal32.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/decimal64.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/divide.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/divideint.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/inexact.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/max.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/min.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/minus.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/multiply.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/normalize.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/plus.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/power.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/quantize.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/randomBound32.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/randoms.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/remainder.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/remainderNear.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/rescale.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/rounding.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/samequantum.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/squareroot.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/subtract.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/testall.decTest 
+python2.5-2.5.1/Lib/test/decimaltestdata/tointegral.decTest 
+/Demo/curses/tclock.py python2.5-2.5.1/Modules/expat/ascii.h 
+python2.5-2.5.1/Modules/expat/asciitab.h 
+python2.5-2.5.1/Modules/expat/expat.h 
+python2.5-2.5.1/Modules/expat/expat_external.h 
+python2.5-2.5.1/Modules/expat/iasciitab.h 
+python2.5-2.5.1/Modules/expat/latin1tab.h 
+python2.5-2.5.1/Modules/expat/utf8tab.h 
+python2.5-2.5.1/Modules/expat/xmlparse.c 
+python2.5-2.5.1/Modules/expat/xmlrole.c 
+python2.5-2.5.1/Modules/expat/xmlrole.h 
+python2.5-2.5.1/Modules/expat/xmltok.c 
+python2.5-2.5.1/Modules/expat/xmltok.h 
+python2.5-2.5.1/Modules/expat/xmltok_impl.c 
+python2.5-2.5.1/Modules/expat/xmltok_impl.h 
+python2.5-2.5.1/Doc/html/about.dat 
+python2.5-2.5.1/Doc/html/stdabout.dat 
+python2.5-2.5.1/Modules/expat/pyexpatns.h 
+python2.5-2.5.1/Lib/robotparser.py 
+python2.5-2.5.1/Lib/ctypes/macholib/README.ctypes 
+python2.5-2.5.1/Lib/wsgiref.egg-info
+
+Please refer to the document "python 2_5_1 licenses.txt" for licensing info.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/renderers_poc/renderer.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,155 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# #################################################################
+#!/usr/bin/python
+
+
+# experimentation
+
+# #############################################################
+class CRendererBase:
+    def RegisterSelf( self, aName, aDescription, aRendererManager ):
+        self.iName = aName
+        self.iDescription = aDescription
+        aRendererManager.AddRenderer( self )
+        
+    def DoBeginTest( self, aTestName ):
+        return
+
+    def DoEndTest( self, aTestName ):
+        return
+
+    def DoReportError( self, aFile, aLine, aResult ):
+        return
+
+    iName = "CRendererBase!"
+    iDescription = ""
+
+
+class CRendererManager:
+    def __init__( self ):
+        # declare associative list of renderers
+        self.iRendererList = {}
+
+    def AddRenderer( self, aRenderer ):
+        self.iRendererList[ aRenderer.iName ] = aRenderer
+        print( "Added " + aRenderer.iName )
+
+    def ListRenderers( self ):
+        print( "Renderers:" )        
+        for name, renderer in self.iRendererList.items():
+            print( "\t" + name + "\t" + renderer.iDescription  )
+
+        print( "" )
+
+
+    def BeginTest( self, aTestName ):
+        for name, renderer in self.iRendererList.items():
+            renderer.DoBeginTest( aTestName )
+
+    def EndTest( self, aTestName ):
+        for name, renderer in self.iRendererList.items():
+            renderer.DoEndTest( aTestName )
+
+    def ReportError( self, aFile, aLine, aResult ):
+        for name, renderer in self.iRendererList.items():
+            renderer.DoReportError( aFile, aLine, aResult )
+
+
+# #############################################################
+
+
+# renderers are to be dropped in arbitarily, much like test scripts, images and embedded files
+# rest of linescanners uses them via the RendererManager instance.
+
+# #############################################################
+class CHtmlRenderer( CRendererBase ):
+    def __init__( self, aRendererManager ):
+        self.RegisterSelf( "html", "Classic CodeScanner browsable HTML tree", aRendererManager )
+        
+    def DoBeginTest( self, aTestName ):
+        self.iFileHandle = open( aTestName + ".html", "w" )
+        self.iFileHandle.write( "<html>\n<body>\n<h1>" + aTestName + "</h1>\n" )
+
+    def DoEndTest( self, aTestName ):
+        self.iFileHandle.write( "</body>\n</html>\n" )
+        self.iFileHandle.close()
+
+    def DoReportError( self, aFile, aLine, aResult ):
+        self.iFileHandle.write( "<i>" + aResult + "</i> at " + str( aLine ) + "<br/>\n" )
+
+# #############################################################
+
+
+
+# #############################################################
+class CMsdevRenderer( CRendererBase ):
+    def __init__( self, aRendererManager ):
+        self.RegisterSelf( "msdev", "Classic MIScan plugin for MSDEV", aRendererManager )
+
+    def DoBeginTest( self, aTestName ):
+        self.iErrorCount = 0
+        return
+    
+    def DoEndTest( self, aTestName ):
+        print( "\n\n" + str( self.iErrorCount ) + " total errors" )
+        return
+    
+    def DoReportError( self, aFile, aLine, aResult ):
+        self.iErrorCount += 1
+        # :\Series60Ex\menu\src\aknexmenusubcontainer.cpp(126) : warning: to do comment
+        print( aFile + "(" + str( aLine ) + ") : " + aResult )
+    
+
+# #############################################################
+
+# objects register themselves with rendererManager
+rendererManager = CRendererManager()
+
+CHtmlRenderer( rendererManager )
+CMsdevRenderer( rendererManager )
+
+rendererManager.ListRenderers()
+
+
+errorCasesFiles = [ "moose.cpp",
+                    "lama.cpp",
+                    "underflow.cpp",
+                    "wankers.cpp" ]
+
+errorCasesLines = [ 56,
+                    23,
+                    67,
+                    42 ]
+
+errorCasesMessages = [ "moose farmer in field",
+                       "lama shags sheep",
+                       "out of budget",
+                       "DELL are bad people" ]
+
+
+
+rendererManager.BeginTest( "arbitarytest case" )
+for file, line, error in zip( errorCasesFiles, errorCasesLines, errorCasesMessages ):
+    rendererManager.ReportError( file, line, error )
+
+rendererManager.EndTest( "test harness" )
+    
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/CommonFunctions.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,95 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# CommonFunctions.py
+#
+# Some commonly used functions.
+#
+# #################################################################
+
+KReStringLeavingLine = "(\w*[a-z]\w*L(C*|D|P))\s*\(|ELeave|User::Leave|tream\s+<<|tream\s+>>"
+
+KReLeavingLine = re.compile(KReStringLeavingLine, re.VERBOSE)
+
+def isNonAlpha(char):
+	if (char >= 'A'):
+		if (char <= 'Z'):
+			return 0
+	if (char >= 'a'):
+		if (char <= 'z'):
+			return 0
+	if (char >= '0'):
+		if (char <= '9'):
+			return 0
+	return 1
+
+def TrimVariableName(var):
+	while (len(var) > 0) and (isNonAlpha(var[0])):
+		var = var[1:len(var)]
+	while (len(var) > 0) and (isNonAlpha(var[len(var)-1])):
+		var = var[0:len(var)-1]
+
+	if (len(var) > 0):
+		spaceIndex = var.find(" ")
+		if (spaceIndex <> -1):
+			cutVar = var[spaceIndex:]
+			return TrimVariableName(cutVar)
+	return var
+
+def GetBracketDepth(lines, currentline):
+	i = scanner.iCurrentMethodStart
+	bracketdepth = 0
+	while (i < currentline):
+		thisline = lines[i]
+		commentBegin = thisline.find("//")
+		if (commentBegin != -1):
+			thisline = thisline[:commentBegin]
+		bracketdepth += thisline.count("{")
+		bracketdepth -= thisline.count("}")
+		i = i + 1
+
+	return bracketdepth	
+
+varDeclaration = re.compile("""
+	\s*					# whitespace
+	([A-Z]\w*)			# variable type
+	\s*             	# whitespace
+	(<.*>)?				# optional class in angle brackets
+	\s*[\*&\s]\s*		# optional "*" or "&" plus at least one whitespace char
+	(\w+)				# variable name
+	\s*             	# whitespace
+	[;\(=]				# ";" or "(" or "="
+	""", re.VERBOSE)
+
+def GetLocalVariableType(lines, currentline, varname):
+	# skip non-local object
+	if (len(varname) > 2):
+		if (varname[0] == 'i'):
+			return ""
+
+	# lookup type of local variable or function parameter
+	if (scanner.iCurrentMethodStart <> -1):
+		i = scanner.iCurrentMethodStart
+		while (i < currentline):
+			line = lines[i]
+			if (line.find(varname) <> -1):
+				# look up variable declaration
+				m = varDeclaration.search(line)
+				if m:
+					# return variable type
+					return m.group(1)
+			i = i + 1
+	return ""
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/ConnectAndDontCloseMemberVariable.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,118 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# ConnectAndDontCloseMemberVariable.py
+#
+# Checks : Calling Connect() or Open() on a member variable without 
+# calling Close() in the destructor.
+#
+# Reason : If Connect() or Open() is called on any member variable, 
+# then Close() must be called in the destructor.
+#
+# #################################################################
+
+script = CScript("ConnectAndDontCloseMemberVariable")
+script.iReString = r"""
+	^\s*				# start of line plus optional whitespace
+	i[A-Z]\w+			# member variable name
+	(\.|->)				# "." or "->"
+	(Connect|Open)
+	\s*\(\s*\)
+	\s*;
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryWrongFunctionality
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+ConnectAndDontCloseLeavingFunction = re.compile("""
+	[A-Za-z0-9]+
+	L
+	(C|D|P)*
+	\s*
+	\(
+	""", re.VERBOSE)
+
+def ConnectNotCloseCompare(lines, currentline, rematch, filename):
+	line = lines[currentline]
+	m = rematch.search(line)
+
+	if m:
+		# get the variable name, between the '*' and the '='
+		startindex = line.find("i")
+		if (startindex == -1):
+			startindex = 0
+		endindex = line.find("Connect")
+		if (endindex == -1):
+			endindex = line.find("Open")
+		variable = line[startindex:endindex]
+		if (len(variable) < 1):
+			return 0
+		variable = TrimVariableName(variable)
+
+		# see if variable is closed within this function before a Leave
+		i = currentline
+		bracketdepth = GetBracketDepth(lines, i)
+		while (i < len(lines)) and (bracketdepth  > 0):
+			line = lines[i]
+			if (line.find(variable) >= 0):
+				if (line.find("Close") >= 0):
+					return 0
+
+			bracketdepth += line.count("{")
+			bracketdepth -= line.count("}")
+
+			if (line.find("User::Leave") >= 0):
+				bracketdepth = 0
+			if (line.find("ELeave") >= 0):
+				bracketdepth = 0
+			if (ConnectAndDontCloseLeavingFunction.search(line)):
+				bracketdepth = 0
+				
+			i = i + 1
+		
+		# look for destructor and see if variable is closed there
+		stringToFind = "~" + scanner.iCurrentClassName
+		i = 1
+		foundDestructor = 0
+		bracketdepth = 0
+		while (i < len(lines)):
+			thisLine = lines[i]
+			if (thisLine.find(stringToFind) >= 0) and (foundDestructor == 0):
+				while (i < len(lines)) and (foundDestructor == 0):
+					thisLine = lines[i]
+					if (thisLine.find('{') >= 0):
+						foundDestructor = 1
+					else:
+						i = i + 1
+
+			if (foundDestructor):
+				bracketdepth += thisLine.count("{")
+				bracketdepth -= thisLine.count("}")
+				if (bracketdepth == 0):
+					return 1
+				
+				if (thisLine.find(variable) >= 0):
+					if (thisLine.find("Close") >= 0):
+						return 0
+			i = i + 1
+
+		if (foundDestructor):
+			return 1
+	return 0
+
+script.iCompare	= ConnectNotCloseCompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/LFunctionCantLeave.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,123 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# LFunctionCantLeave.py
+#
+# Checks : L-functions that cannot leave.
+#
+# Reason : A function should not be named with an 'L' if it cannot 
+# leave. The only exception is in virtual functions where the 
+# function name is defined in the base class so the L cannot be 
+# emoved. For example, RunL().
+#
+# #################################################################
+
+script = CScript("LFunctionCantLeave")
+script.iReString = r"""
+	[A-Za-z0-9]+			# return type
+	\s+
+	[C|T|R][A-Za-z0-9]+		# class name
+	::
+	([A-Za-z0-9]+L(C|D)*)	# leaving function name (possible LC or LD function)
+	\s*						# optional whitespace
+	\(						# open bracket
+	.*						# parameters
+	\)						# close bracket
+	\s*
+	[^;]					# no semicolon after function definition
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+lfunctioncantleaveLeavingMethod = re.compile("""
+	[A-Za-z0-9]+
+	L
+	(C|D)*
+	\(
+""", re.VERBOSE)
+
+lfunctioncantleaveUserLeave = re.compile("""
+	User::Leave
+	""", re.VERBOSE)
+
+lfunctioncantleaveNewELeave = re.compile("""
+	new
+	\s*
+	\(
+	\s*
+	ELeave
+	\s*
+	\)
+""", re.VERBOSE)
+
+reLFunctionIgnoreStr = "RunL"
+scriptNode = script.ScriptConfig()
+if (scriptNode <> None):
+	for wordNode in scriptNode.getElementsByTagName("LFunctionIgnoreRE"):
+		reLFunctionIgnoreStr = wordNode.firstChild.nodeValue
+		print "Note: ignoring the following functions when checking for L-functions that cannot leave: " + reLFunctionIgnoreStr
+		break
+if len(reLFunctionIgnoreStr) > 0:
+	reLFunctionIgnores = re.compile(reLFunctionIgnoreStr, re.IGNORECASE)
+else :
+	reLFunctionIgnores = None
+
+def lfunctioncantleavecompare(lines, currentline, rematch, filename):
+	line = lines[currentline]
+	m = rematch.search(line)
+
+	if m:
+		#ignore functions on the ignored list
+		functionName = m.group(1)
+		if reLFunctionIgnores:
+			if reLFunctionIgnores.match(functionName):
+				return 0
+
+		i = currentline
+
+		# find opening { in function
+		while (line.count("{") == 0):
+			i = i + 1
+			if (i >= len(lines)):
+				return 1
+			line = lines[i]
+
+		# if empty function (or one-line function?)
+		if (line.count("}") > 0):
+			return 1
+
+		i = i + 1
+		bracketDepth = 1
+
+		while (i < len(lines)):
+			line = lines[i]
+			if lfunctioncantleaveLeavingMethod.search(line):
+				return 0
+			if lfunctioncantleaveUserLeave.search(line):
+				return 0
+			if lfunctioncantleaveNewELeave.search(line):
+				return 0 
+
+			bracketDepth += line.count("{") - line.count("}")
+			if (bracketDepth == 0):
+				return 1
+			i = i + 1
+	return 0
+
+script.iCompare = lfunctioncantleavecompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/LeaveNoError.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,34 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# LeaveNoError.py
+#
+# Checks : Leaving with KErrNone.
+#
+# Reason : Leaving with KErrNone usually indicates that there is a 
+# makeshift way around a design issue rather than a true and proper 
+# fix to the architecture.
+#
+# #################################################################
+
+script = CScript("LeaveNoError")
+script.iReString = "User\s*::\s*Leave\(\s*KErrNone\s*\)"
+script.iFileExts = ["cpp", "h", "c", "inl"]
+script.iCategory = KCategoryWrongFunctionality
+script.iIgnore = KIgnoreComments
+script.iSeverity = KSeverityMedium
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/accessArrayElementWithoutCheck.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,188 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# accessArrayElementWithoutCheck.py
+#
+# Checks : Array element accessed by At() function without checking 
+# index is within array range.
+#
+# Reason : Whenever an element in an array is accessed, the index 
+# should be checked to ensure that it is less than array.Count(). 
+# CodeScanner checks for explicit calls to a Count() function; so 
+# if the array index is checked in a different way, it gives 
+# false positives. Accessing an invalid index can cause a panic.
+#
+# #################################################################
+
+script = CScript("accessArrayElementWithoutCheck")
+script.iReString = r"""
+	(->|\.)		# pointer/instance of array
+	\s*			# optional whitespace
+	At
+	\s*			# optional whitespace
+	\(			# opening bracket
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+accessArrayCountFn = re.compile("""
+	(\.|->)
+	\s*
+	Count
+	\s*
+	\(
+	\s*
+	\)
+	""", re.VERBOSE)
+
+accessArrayDeclaration = re.compile("""
+	\w+			# array type
+	[0-9<>*& ]*	# optional array element
+	\w+			# array name
+	\s*
+	\[
+	.*			# array size
+	\]
+	\s*
+	;
+	""", re.VERBOSE)
+
+def isTimerObject(lines, currentline, varname):
+	if (varname.lower().find("array") <> -1) or (varname.lower().find("list") <> -1):
+		return False
+	if (varname.lower().find("heartbeat") <> -1):
+		return True
+	if (varname.lower().find("periodic") <> -1):
+		return True
+	if (varname.lower().find("timer") <> -1):
+		return True
+
+	vartype = GetLocalVariableType(lines, currentline, varname)
+	if (len(vartype) > 0):
+		if (vartype.lower().find("array") <> -1) or (vartype.lower().find("list") <> -1):
+			return False
+		if (vartype.lower().find("heartbeat") <> -1):
+			return True
+		if (vartype.lower().find("periodic") <> -1):
+			return True
+		if (vartype.lower().find("timer") <> -1):
+			return True
+
+	return False
+
+def arrayAccessCompare(lines, currentline, rematch, filename):
+	line = lines[currentline]
+	m = rematch.search(line)
+
+	if m:
+		if (line.count("At") == 1):
+			openBracketPos = line.find("At")
+		else:
+			openBracketPos = line.find("At(")
+		cutLine = line[openBracketPos+1:]
+		closeBracketPos = cutLine.find(")") + len(line) - len(cutLine)
+		if (closeBracketPos > openBracketPos) and (openBracketPos >= 0):
+			variable = line[openBracketPos+3:closeBracketPos]
+			variable = TrimVariableName(variable)
+
+			if (len(variable) == 0):
+				return 0
+
+			# if a constant index assume it's going to be ok!
+			if (variable[0] == "E") or (variable[0] == "K"):
+				return 0
+
+			variableIsNumeric = 1
+			varPos = 0
+			while (varPos < len(variable)):
+				if (variable[varPos] < '0') or (variable[varPos] > '9'):
+					variableIsNumeric = 0
+					break
+				varPos = varPos + 1
+
+			linePos = openBracketPos - 1
+			while (linePos > 0) and (isNonAlpha(line[linePos])):
+				linePos = linePos - 1
+			arrayNameEnd = linePos + 1
+			while (linePos >= 0) and (isNonAlpha(line[linePos]) == 0):
+				linePos = linePos - 1
+			arrayNameStart = linePos + 1
+		
+			arrayName = ""
+			if (arrayNameStart >= 0):
+				arrayName = line[arrayNameStart:arrayNameEnd]
+				arrayName = TrimVariableName(arrayName)
+
+				if (len(arrayName) > 0):
+					# if a constant array assume it's going to be ok!
+					if (arrayName[0] == "E") or (arrayName[0] == "K"):
+						return 0
+
+					# ignore any heartbeat/periodic/timer object that is not an array or list
+					if isTimerObject(lines, currentline, arrayName):
+						return 0
+
+			if (variableIsNumeric):
+				if (len(arrayName) > 2):
+					if (arrayName[0] == "i") and (arrayName[1] >= 'A') and (arrayName[1] <= 'Z'):
+						return 0 
+
+			i = currentline
+
+			while (i >= 0) and (i >= scanner.iCurrentMethodStart):
+				line = lines[i]
+
+				# check to see if index is compared to array size
+				if (len(arrayName) > 0):
+					arrayNamePos = line.find(arrayName)
+					if (arrayNamePos >= 0):
+						cutLine = line[arrayNamePos + len(arrayName):]
+						if (accessArrayCountFn.search(cutLine)):
+							return 0
+
+					if (variableIsNumeric == 1):
+						if (accessArrayDeclaration.search(line)):
+							openBracketPos = line.find("[")
+							cutLine = line[openBracketPos:]
+							closeBracketPos = cutLine.find("]") + len(line) - len(cutLine)
+							if (closeBracketPos > openBracketPos) and (openBracketPos >= 0):
+								declVariable = line[openBracketPos:closeBracketPos]
+								declVariable = TrimVariableName(declVariable)
+								if (len(declVariable) > 0):
+									# if a constant index assume it's going to be ok!
+									if (declVariable[0] == "E") or (declVariable[0] == "K"):
+										return 0
+
+								declVariableIsNumeric = 1
+								varPos = 0
+								while (varPos < len(declVariable)):
+									if (declVariable[varPos] < '0') or (declVariable[varPos] > '9'):
+										declVariableIsNumeric = 0
+										break
+									varPos = varPos + 1
+								if (declVariableIsNumeric == 1):
+									if (int(variable) < int(declVariable)):
+										return 0
+
+				i = i - 1
+			return 1
+
+	return 0
+
+script.iCompare	= arrayAccessCompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/accessArrayElementWithoutCheck2.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,229 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# accessArrayElementWithoutCheck2.py
+#
+# Checks : Array element accessed by [] without checking range.
+#
+# Reason : Whenever an element in an array is accessed, the index 
+# should first be checked to ensure that it is within range. 
+# CodeScanner checks for explicit calls to a Count() or Length() 
+# function; so if the array index is checked in a different way, 
+# it gives false positives. Accessing an invalid index can cause 
+# a panic.
+#
+# #################################################################
+
+script = CScript("accessArrayElementWithoutCheck2")
+script.iReString = r"""
+	\w+
+	\s*		# optional whitespace
+	\)*		# optional closing bracket
+	\s*		# optional whitespace
+	\[
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+accessArrayCountFn = re.compile("""
+	(\.|->)
+	\s*
+	Count
+	\s*
+	\(
+	\s*
+	\)
+	""", re.VERBOSE)
+
+accessArrayLengthFn = re.compile("""
+	(\.|->)
+	\s*
+	Length
+	\s*
+	\(
+	\s*
+	\)
+	""", re.VERBOSE)
+
+accessArrayDeclareNew = re.compile("""
+	\s*
+	=
+	\s*
+	new
+	\s*
+	""", re.VERBOSE)
+
+bufferArrayDeclaration = re.compile("""
+	\w+		# array type
+	\s*
+	<
+	\s*
+	[0-9]+
+	\s*
+	>
+	\s*
+	\w+		# array name
+	\s*
+	;
+	""", re.VERBOSE)
+
+accessArrayDeclaration = re.compile("""
+	\w+		# array type
+	\s*
+	(\*|&)*
+	\s*
+	\[
+	.*		# array size
+	\]
+	\s*
+	;
+	""", re.VERBOSE)
+
+constArrayDeclaration = re.compile("""
+	\w+		# array type
+	[0-9<>*& ]*	# optional array element
+	\s+
+	\w+		# array name
+	\s*
+	\[
+	.*		# array size
+	\]
+	\s*
+	=
+	[^=]
+	""", re.VERBOSE)
+
+def arrayAccessCompare2(lines, currentline, rematch, filename):
+	line = lines[currentline]
+	m = rematch.search(line)
+
+	if m:
+		if (accessArrayDeclareNew.search(line)):
+			return 0
+
+		if (accessArrayDeclaration.search(line)):
+			return 0
+
+		if (constArrayDeclaration.search(line)):
+			return 0
+
+		openBracketPos = line.find("[")
+		cutLine = line[openBracketPos:]
+		closeBracketPos = cutLine.find("]") + len(line) - len(cutLine)
+		if (closeBracketPos > openBracketPos) and (openBracketPos >= 0):
+			variable = line[openBracketPos:closeBracketPos]
+			variable = TrimVariableName(variable)
+
+			if (len(variable) == 0):
+				return 0
+
+			# if a constant index assume it's going to be ok!
+			if (variable[0] == "E") or (variable[0] == "K"):
+				return 0
+
+			variableIsNumeric = 1
+			varPos = 0
+			while (varPos < len(variable)):
+				if (variable[varPos] < '0') or (variable[varPos] > '9'):
+					variableIsNumeric = 0
+					break
+				varPos = varPos + 1
+
+			linePos = openBracketPos
+			while (linePos > 0) and (isNonAlpha(line[linePos])):
+				linePos = linePos - 1
+			arrayNameEnd = linePos + 1
+			while (linePos >= 0) and (isNonAlpha(line[linePos]) == 0):
+				linePos = linePos - 1
+			arrayNameStart = linePos + 1
+		
+			arrayName = ""
+			if (arrayNameStart >= 0):
+				arrayName = line[arrayNameStart:arrayNameEnd]
+				arrayName = TrimVariableName(arrayName)
+
+				if (len(arrayName) > 0):
+					# if a constant array assume it's going to be ok!
+					if (arrayName[0] == "E") or (arrayName[0] == "K"):
+						return 0
+
+			if (variableIsNumeric):
+				if (len(arrayName) > 2):
+					if (arrayName[0] == "i") and (arrayName[1] >= 'A') and (arrayName[1] <= 'Z'):
+						return 0 
+
+			i = currentline
+
+			while (i >= 0) and (i >= scanner.iCurrentMethodStart):
+				line = lines[i]
+				
+				# check to see if index is compared to array size
+				if (len(arrayName) > 0):
+					arrayNamePos = line.find(arrayName)
+					if (arrayNamePos >= 0):
+						cutLine = line[arrayNamePos + len(arrayName):]
+						if (accessArrayCountFn.search(cutLine)):
+							return 0
+						if (accessArrayLengthFn.search(cutLine)):
+							return 0
+
+					if (variableIsNumeric == 1):
+						doCheck = 0
+						if (accessArrayDeclaration.search(line)):
+							openBracketPos = line.find("[")
+							cutLine = line[openBracketPos:]
+							closeBracketPos = cutLine.find("]") + len(line) - len(cutLine)
+							if (closeBracketPos > openBracketPos) and (openBracketPos >= 0):
+								declVariable = line[openBracketPos:closeBracketPos]
+								declVariable = TrimVariableName(declVariable)
+								if (len(declVariable) > 0):
+									doCheck = 1
+
+						if (bufferArrayDeclaration.search(line)):
+							openBracketPos = line.find("<")
+							cutLine = line[openBracketPos:]
+							closeBracketPos = cutLine.find(">") + len(line) - len(cutLine)
+							if (closeBracketPos > openBracketPos) and (openBracketPos >= 0):
+								declVariable = line[openBracketPos:closeBracketPos]
+								declVariable = TrimVariableName(declVariable)
+								if (len(declVariable) > 0):
+									doCheck = 1
+
+						if (doCheck == 1):
+							# if a constant index assume it's going to be ok!
+							if (declVariable[0] == "E") or (declVariable[0] == "K"):
+								return 0
+
+							declVariableIsNumeric = 1
+							varPos = 0
+							while (varPos < len(declVariable)):
+								if (declVariable[varPos] < '0') or (declVariable[varPos] > '9'):
+									declVariableIsNumeric = 0
+									break
+								varPos = varPos + 1
+							if (declVariableIsNumeric == 1):
+								if (int(variable) < int(declVariable)):
+									return 0
+
+				i = i - 1
+			return 1
+
+	return 0
+
+script.iCompare	= arrayAccessCompare2
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/activestart.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,34 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# activestart.py
+#
+# Checks : Using CActiveScheduler::Start.
+#
+# Reason : Using CActiveScheduler::Start() can mean that something 
+# asynchronous is being made synchronous. Instead, use active 
+# objects correctly in an asynchronous way.
+#
+# #################################################################
+
+script = CScript("activestart")
+script.iReString = "CActiveScheduler::Start"
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/activestop.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,34 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# activestop.py
+#
+# Checks : Using CActiveScheduler::Stop.
+#
+# Reason : Using CActiveScheduler::Stop() can mean that something 
+# asynchronous is being made synchronous. Instead, use active 
+# objects correctly in an asynchronous way.
+#
+# #################################################################
+
+script = CScript("activestop")
+script.iReString = "CActiveScheduler::Stop"
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/arraypassing.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,45 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# arraypassing.py
+#
+# Checks : Passing arrays by value rather than reference.
+#
+# Reason : Passing arrays by value causes the array to be copied 
+# needlessly, which takes up time and memory. For efficiency, 
+# references should be used.
+#
+# #################################################################
+
+script = CScript("arraypassing")
+script.iReString = r"""
+    (\(|,)?         # open bracket or preceeding comma
+    \s*             # whitespace
+	(R|C)\w*Array	# skip to a parameter type containing "R...Array..." or "C...Array..."
+    \s*				# whitespace
+	(<.*>)?			# optional class in angle brackets
+	\s+				# whitespace
+	(\w+)			# parameter name
+    (=|\w|\s)*      # optional parameter initialization or whitespace
+    (\)|,)			# close bracket or trailing comma
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryPerformance
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+script.iCompare = DefaultFuncParamCompare
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/arrayptrcleanup.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,65 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# arrayptrcleanup.py
+#
+# Checks : Using local CArrayPtr classes without cleanup items.
+#
+# Reason : It is not enough to push a local CArrayPtr class onto 
+# the cleanup stack. A TCleanupItem and callback function must be 
+# used to avoid leaking the elements.
+#
+# #################################################################
+
+script = CScript("arrayptrcleanup")
+script.iReString = r"""
+	\s+
+	(
+	\w+
+	)
+	\s*
+	=
+	\s*
+	new
+	\s*
+	\(
+	\s*
+	ELeave
+	\s*
+	\)
+	\s*
+	CArrayPtr
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+def arrayptrcleanupcompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		varName = m.group(1)
+		if (len(varName) == 1) or (varName[0] not in "ai") or varName[1].islower():
+			for i in range(currentline, currentline + 10):
+				if i >= len(lines):
+					break
+				elif (lines[i].find("TCleanupItem") <> -1) and (lines[i].find(varName) <> -1):
+					return 0
+			return 1
+	return 0
+
+script.iCompare = arrayptrcleanupcompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/assertdebuginvariant.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,34 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# assertdebuginvariant.py
+#
+# Checks : __ASSERT_DEBUG with User::Invariant.
+#
+# Reason : Replace __ASSERT_DEBUG(<condition>, User::Invariant()) 
+# with ASSERT(<condition>), because it is easier to read.
+#
+# #################################################################
+
+script = CScript("assertdebuginvariant")
+	
+script.iReString = "__ASSERT_DEBUG\s*\(\w*\s*,\s*User::Invariant\s*\(\s*\)\s*\)\s*;"
+script.iFileExts = ["h", "cpp", ".inl", "c"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/baddefines.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,37 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# baddefines.py
+#
+# Checks : Lowercase definition names.
+#
+# Reason : Badly-named definitions makes the code harder to 
+# maintain and can lead to defects.
+#
+# #################################################################
+
+script = CScript("baddefines")
+script.iReString = r"""
+	\#define
+	\s+					# at least one whitespace char
+	[A-Z0-9_]*[a-z]+	# find a lower case character
+	"""
+script.iFileExts = ["h", "cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/baseconstruct.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,52 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# baseconstruct.py
+#
+# Checks : Leaving function called before BaseConstructL().
+#
+# Reason : If a leave occurs before BaseConstructL() is called, 
+# the system can panic because it is trying to clean up an 
+# application that has not been fully initialised.
+#
+# #################################################################
+
+script = CScript("baseconstruct")
+script.iReString = r"""
+	^
+	\s*
+	BaseConstructL
+	\s*
+	\(
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+def baseconstructcompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		if scanner.iCurrentMethodStart >= 0:
+			for i in range(scanner.iCurrentMethodStart, currentline):
+				line = lines[i]
+				n = KReLeavingLine.search(line)
+				if n:
+					return 1
+	return 0
+
+script.iCompare = baseconstructcompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/callActiveObjectWithoutCheckingOrStopping.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,220 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# callActiveObjectWithoutCheckingOrStopping.py
+#
+# Checks : Active object called without checking whether it is 
+# active or canceling it first.
+#
+# Reason : If an active object is started twice, a panic occurs. 
+# CodeScanner picks out places where there is a call to a Start(), 
+# Queue(), or After() function on a member variable, without a 
+# previous call to IsActive(), Cancel(), or Stop(). In general, 
+# if starting a timer, there should at least be a call to IsActive() 
+# to ensure that the timer is not already running.
+#
+# #################################################################
+
+script = CScript("callActiveObjectWithoutCheckingOrStopping")
+script.iReString = r"""\("""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+activeObjectIsActive = re.compile("""
+	(\.|->)
+	\s*
+	IsActive
+	\s*
+	\(
+	\s*
+	\)
+	""", re.VERBOSE)
+
+activeObjectCancel = re.compile("""
+	(\.|->)
+	\s*
+	Cancel
+	\s*
+	\(
+	\s*
+	\)
+	""", re.VERBOSE)
+
+activeObjectStop = re.compile("""
+	(\.|->)
+	\s*
+	Stop
+	\s*
+	\(
+	\s*
+	\)
+	""", re.VERBOSE)
+
+activeObjectCreate = re.compile("""
+	=
+	\s*
+	\w+
+	::
+	New
+	\w*
+	\s*
+	\(
+	""", re.VERBOSE)
+
+activeObjectCreate2 = re.compile("""
+	=
+	\s*
+	new
+	\s*
+	\(
+	\s*
+	ELeave
+	\s*
+	\)
+	""", re.VERBOSE)
+
+activeObjectStart = re.compile("""
+	(\.|->)
+	\s*
+	Start
+	\s*
+	\(
+	""", re.VERBOSE)
+
+activeObjectQueue = re.compile("""
+	(\.|->)
+	\s*
+	Queue
+	\s*
+	\(
+	""", re.VERBOSE)
+
+activeObjectAfter = re.compile("""
+	(\.|->)
+	\s*
+	After
+	\s*
+	\(
+	""", re.VERBOSE)
+
+# RTimer::After() takes 2 arguments
+rtimerObjectAfter = re.compile("""
+	(\.|->)
+	\s*
+	After
+	\s*
+	\(
+	\s*
+	\w+			# first argument
+	\s*
+	,
+	""", re.VERBOSE)
+
+# Non-active types with After(), Queue() or Start() function
+KNonActiveTypes = {
+	"KAnimation"					: "Animation",
+	"KAnimator"						: "Animator",
+	"KClockSourcePeriodicUtility"	: "ClockSourcePeriodicUtility",
+	"KCodecWrapper"					: "CodecWrapper",
+	"KCommTimer"					: "CommTimer",
+	"KEmbeddedStore"				: "EmbeddedStore",
+	"KFormulaTextLexer"				: "FormulaTextLexer",
+	"KObexServer"					: "ObexServer",
+	"KSpriteAnimation"				: "SpriteAnimation",
+	"KRConnection"					: "RConnection",
+	"KRSubConnection"				: "RSubConnection",
+	"KRTest"						: "RTest",
+	"KRTimer"						: "RTimer",
+	"KValidityPeriod"				: "ValidityPeriod",
+	"KVideoPlayHwDevice"			: "VideoPlayHwDevice",
+	"KVideoRecordHwDevice"			: "VideoRecordHwDevice",
+}
+
+def isNonActiveObject(variable):
+	for name, value in KNonActiveTypes.items():
+		if (variable.lower().find(value.lower()) <> -1):
+			return True
+	return False
+
+def activeObjectCompare(lines, currentline, rematch, filename):
+	line = lines[currentline]
+	m = rematch.search(line)
+
+	if m:
+		if (scanner.iCurrentMethodName == "Start"):
+			return 0
+		if (scanner.iCurrentMethodName == "Queue"):
+			return 0
+		if (scanner.iCurrentMethodName == "After"):
+			return 0
+
+		checkForIsActive = 0	
+		if (activeObjectStart.search(line)):
+			checkForIsActive = 1
+		if (activeObjectQueue.search(line)):
+			checkForIsActive = 1
+		if (activeObjectAfter.search(line)):
+			# make sure we are not dealing with RTimer::After()
+			if (not rtimerObjectAfter.search(line)):
+				checkForIsActive = 1
+		if (checkForIsActive == 1):
+			varEnd = line.find("->")
+			if (varEnd < 0):
+				varEnd = line.find(".")
+			if (varEnd < 0):
+				return 0
+			
+			variable = TrimVariableName(line[:varEnd])
+			if (len(variable) == 0):
+				return 0
+
+			# if a local variable then unlikely to have been started already
+			if (len(variable) > 2):
+				if (variable[0] != 'i'):
+					return 0
+				else:
+					if (variable[1] < 'A') or (variable[1] > 'Z'):
+						return 0
+
+			# ignore non-active object
+			if isNonActiveObject(variable):
+				return 0
+
+			i = currentline
+			while (i > scanner.iCurrentMethodStart):
+				line = lines[i]
+				varPos = line.find(variable)
+				if (varPos >= 0):
+					cutLine = line[varPos:]
+					if (activeObjectIsActive.search(cutLine)):
+						return 0
+					if (activeObjectCancel.search(cutLine)):
+						return 0
+					if (activeObjectStop.search(cutLine)):
+						return 0
+					if (activeObjectCreate.search(cutLine)):
+						return 0
+					if (activeObjectCreate2.search(cutLine)):
+						return 0
+				i = i - 1
+			return 1
+
+	return 0
+
+script.iCompare	= activeObjectCompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/changenotification.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,33 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# changenotification.py
+#
+# Checks : Using RSAVarChangeNotify to see System Agent changes.
+#
+# Reason : When watching for System Agent changes, use RSystemAgent 
+# rather than RSAVarChangeNotify, which can fail.
+#
+# #################################################################
+
+script = CScript("changenotification")
+script.iReString = "RSAVarChangeNotify"
+script.iFileExts = ["cpp", "h", "inl", "hpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/cleanup.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,39 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# cleanup.py
+#
+# Checks : CleanupStack::Pop(AndDestroy) parameters.
+#
+# Reason : These functions should be called with explicit variable 
+# parameters to avoid misalignment.
+#
+# #################################################################
+
+script = CScript("cleanup")
+script.iReString = r"""
+	CleanupStack::Pop(AndDestroy)?
+	\s*
+	\(
+	\s*
+	([0-9]+\s*\)|\))
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/commentcode.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,84 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# commentcode.py
+#
+# Checks : Commented-out code.
+#
+# Reason : Instances of code that are commented out make the code 
+# hard to maintain and to interpret clearly. The commented out code 
+# should be removed. Any requirement to rediscover old code 
+# should be made through source control and not by trawling through 
+# commented-out code.
+#
+# #################################################################
+
+script = CScript("commentcode")
+script.iReString = r"""
+	/(/|\*)			# "//" or "/*"
+	(.*);			# skip to semicolon
+	\s*				# optional whitespace
+	(//.*)?			# optional comment
+	$				# end of line
+	"""
+script.iFileExts = ["h","cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreQuotes
+script.iSeverity = KSeverityLow
+
+reDeclaration = re.compile("""
+	\s*
+	[A-Z][\w<>*&]+
+	\s+
+	\w+
+	\s*
+	""", re.VERBOSE)
+
+def commentcodecompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		if ((m.group(2)[-1:] == ")") or (m.group(2).find("=") <> -1)) or (reDeclaration.match(m.group(2))):
+			line = lines[currentline]
+			i = 0
+			inCommentBlock = 0
+
+			while i < len(line):
+				if not inCommentBlock:
+					if (line[i] == "/"):
+						if (line[i + 1] == "/"):
+							return 1
+						elif (line[i + 1] == "*"):
+							inCommentBlock = 1
+							i += 2
+							continue
+				else:
+					endIndex = line[i:].find("*/")
+					if (endIndex <> -1):
+						inCommentBlock = 0
+						if line[i:i + endIndex + 2].find(";") <> -1:
+							return 1
+						i += endIndex + 2
+						continue
+					else:
+						return 1
+				
+				i += 1
+		
+	return 0
+
+script.iCompare = commentcodecompare
+scanner.AddScript(script)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/connect.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,43 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# connect.py
+#
+# Checks : Ignoring Connect() return value.
+#
+# Reason : Ignoring the error returned from Connect() functions 
+# means that if the Connect() function fails due to OOM or 
+# other problems, the next access to the resource will panic.
+#
+# #################################################################
+
+script = CScript("connect")
+script.iReString = r"""
+	^\s*				# start of line plus optional whitespace
+	\w+					# variable name
+	(\.|->)				# "." or "->"
+	Connect\s*\(\s*\)
+	\s*;
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCanPanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+scanner.AddScript(script)
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/constnames.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,56 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# constnames.py
+#
+# Checks : Badly-named constants.
+#
+# Reason : Badly-named constant will make the source code harder to 
+# maintain and make defects more likely.
+#
+# #################################################################
+
+script = CScript("constnames")
+script.iReString = r"""
+	^
+	\s*
+	const
+	\s+
+	\w+		# type
+	\s*
+	[\*&]?	# reference or pointer
+	\s*
+	[^K\s]	# name initial letter
+	\w+		# name
+	\s*
+	=
+	[^()]*
+	;
+	"""
+script.iFileExts = ["h", "cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+def constnamescompare(lines, currentline, rematch, filename):
+	if (scanner.iCurrentMethodName == ""):
+		if rematch.search(lines[currentline]):
+			return 1
+
+	return 0
+
+script.iCompare = constnamescompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/consttdescptr.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,43 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# consttdescptr.py
+#
+# Checks : Const descriptor pointer as argument.
+#
+# Reason : Use "const TDesC&" instead of "const TDesC*".
+#
+# #################################################################
+
+script = CScript("consttdescptr")
+script.iReString = r"""
+    (\(|,)?        # open bracket or preceeding comma
+    \s*            # whitespace
+	const
+    \s+            # whitespace
+	TDesC
+    \s*            # whitespace
+	\*
+    \s*            # whitespace
+    (=|\w|\s)*     # optional parameter name, parameter initialization or whitespace
+    (\)|,)         # close bracket or trailing comma
+	"""
+script.iFileExts = ["h"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/controlornull.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,33 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# controlornull.py
+#
+# Checks : Accessing return value of ControlOrNull().
+#
+# Reason : The return value might be NULL, so it should be checked 
+# before access.
+#
+# #################################################################
+
+script = CScript("controlornull")
+script.iReString = "(\.|->)ControlOrNull\(.*\)->"
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCanPanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/crepository.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,71 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# crepository.py
+#
+# Checks : Ignoring CRepository::get() return value.
+#
+# Reason : Independent application cannot assume that the 
+# Central Repository is set up fully. This means the return value 
+# of CRepository::get() cannot be ignored.
+#
+# #################################################################
+
+script = CScript("crepository")
+script.iReString = r"""
+    ^\s*
+    (\w+)
+    (\.|->)
+    (G|g)et\s*\(
+    """
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryOther
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+reCRepositoryAssignStr = "=\s+$"
+reCRepositoryAssign = re.compile(reCRepositoryAssignStr, re.IGNORECASE)
+
+reCRepositoryConditionalStr = "(if|while)\s+\($"
+reCRepositoryConditional = re.compile(reCRepositoryConditionalStr, re.IGNORECASE)
+
+def crepositorycompare(lines, currentline, rematch, filename):
+    m = rematch.search(lines[currentline])
+    if m:
+        objectName = m.group(1)
+        objectType = GetLocalVariableType(lines, currentline, objectName)
+        if (objectType.find("CRepository") == -1):
+            return 0
+
+        # look for handler of CRepository::get() return value on a different line
+        i = currentline - 1
+        if (i > 0) and (i >= scanner.iCurrentMethodStart):
+            line = lines[i]
+            bracketCount = line.count("(") - line.count(")")
+            if (bracketCount > 0):
+                return 0
+            r1 = reCRepositoryAssign.search(line)
+            if r1:
+                return 0
+            r2 = reCRepositoryConditional.search(line)
+            if r2:
+                return 0
+        return 1
+    else:
+        return 0
+
+script.iCompare = crepositorycompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/ctltargettype.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,79 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# ctltargettype.py
+#
+# Checks : Use of targettype ctl.
+#
+# Reason : The ctl target type should not be used. Instead, use DLL 
+# and explicitly refer to the Control Panel's DEF file. 
+# Note: Code that causes this issue only needs attention if it is 
+# found in code developed for Nokia Series 90 code that has extra 
+# exports for resetting the Control Panel item's data.
+#
+# #################################################################
+
+script = CScript("ctltargettype")
+script.iReString = r"""
+	^\s*
+	[Tt][Aa][Rr][Gg][Ee][Tt][Tt][Yy][Pp][Ee]
+	\s+
+	"""
+script.iFileExts = ["mmp"]
+script.iCategory = KCategoryWrongFunctionality
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+reTargetPath = re.compile("""
+	^\s*
+	[Tt][Aa][Rr][Gg][Ee][Tt][Pp][Aa][Tt][Hh]
+	\s+
+	""", re.VERBOSE)
+
+reDefFile = re.compile("""
+	^\s*
+	[Dd][Ee][Ff][Ff][Ii][Ll][Ee]
+	""", re.VERBOSE)
+	
+def ctltargettypecompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		if lines[currentline].upper().find("CTL") <> -1:
+			return 1
+
+		if lines[currentline].upper().find("DLL") <> -1:
+			foundDefFile = 0
+			foundSystemControls = 0
+
+			for line in lines:
+				if reTargetPath.search(line):
+					if line.upper().find("SYSTEM\\CONTROLS") <> -1:
+						foundSystemControls = 1
+
+				if reDefFile.search(line):
+					if line.upper().find("CTRL.DEF") <> -1:
+						foundDefFile = 1
+
+				if (foundSystemControls == 1) and (foundDefFile == 1):
+					break
+		
+			if (foundSystemControls == 1) and (foundDefFile <> 1):
+				return 1
+			
+	return 0
+
+script.iCompare	= ctltargettypecompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/customizableicons.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,52 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# customizableicons.py
+#
+# Checks : Use of customizable icons.
+#
+# Reason : Due to device customization requirements, independent 
+# application must not remove any customization done by the 
+# variant team. This means independent application cannot include 
+# customizable icons.
+#
+# #################################################################
+
+script = CScript("customizableicons")
+script.iReString = ""
+script.iFileExts = ["mk", "mmp"]
+script.iCategory = KCategoryOther
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+reCustomizableIconsStr = ""
+scriptNode = script.ScriptConfig()
+if (scriptNode <> None):
+    for wordNode in scriptNode.getElementsByTagName("iconsRE"):
+        reCustomizableIconsStr = wordNode.firstChild.nodeValue
+        print "Note: 'customizable icons' pattern configured as:  " + reCustomizableIconsStr
+        break
+if len(reCustomizableIconsStr) > 0:
+    reCustomizableIcons = re.compile(reCustomizableIconsStr, re.IGNORECASE)
+else:
+    reCustomizableIcons = None
+
+def customizableIconsCompare(lines, currentline, rematch, filename):
+    if reCustomizableIcons:
+        return reCustomizableIcons.search(lines[currentline])
+
+script.iCompare = customizableIconsCompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/debugrom.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,35 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# debugrom.py
+#
+# Checks : Debug components in ROM.
+#
+# Reason : Debug versions of components in the ROM could mean that 
+# ROM space is being taken up with debugging information or that 
+# logging is being put out. Release versions should be in the ROM 
+# unless there is a good reason why they are not.
+#
+# #################################################################
+
+script = CScript("debugrom")
+script.iReString = "DEBUG_DIR|\\udeb\\\\"
+script.iFileExts = ["iby", "hby"]
+script.iCategory = KCategoryPerformance
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/declarename.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,38 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# declarename.py
+#
+# Checks : Use of __DECLARE_NAME.
+#
+# Reason : The __DECLARE_NAME macro is historical and serves 
+# no purpose anymore and should be removed.
+#
+# #################################################################
+
+script = CScript("declarename")
+script.iReString = r"""
+	^\s*				# start of line plus optional whitespace
+	__DECLARE_NAME
+	\s*					# optional whitespace
+	\(					# open bracket
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/deleteMemberVariable.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,137 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# deleteMemberVariable.py
+#
+# Checks : Member variable deleted incorrectly.
+#
+# Reason : When a member variable is deleted, it should be assigned 
+# either to NULL or to another value. This prevents accidental 
+# access of the deleted object. If a NewL() or other leaving 
+# function is called to reassign the member variable, it should 
+# first be assigned to NULL in case that function leaves.
+#
+# #################################################################
+
+script = CScript("deleteMemberVariable")
+script.iReString = r"""
+	delete		# delete command
+	\s*			# optional space
+	\(*			# optional open bracket
+	\s*			# optional space
+	i[A-Z]		# member variable name
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCanPanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+deleteMemberVariableLeavingFunction = re.compile("""
+	[A-Za-z0-9]+
+	L
+	(C|D)*
+	\s*
+	\(
+	""", re.VERBOSE)
+
+deleteMemberVariableNewELeave = re.compile("""
+	new
+	\s*
+	\(
+	\s*
+	ELeave
+	\s*
+	\)
+	""", re.VERBOSE)
+
+deleteMemberVariableLeave = re.compile("""
+	User::Leave
+	""", re.VERBOSE)
+
+deleteMemberVariableArrayDeletion = re.compile("""
+	(\.|->)
+	\s*
+	Delete
+	\s*
+	\(
+	""", re.VERBOSE)
+
+deleteMemberVariableArrayDeletion2 = re.compile("""
+	(\.|->)
+	\s*
+	Remove
+	\s*
+	\(
+	""", re.VERBOSE)
+
+def deleteMemberVariableCompare(lines, currentline, rematch, filename):
+	line = lines[currentline]
+	m = rematch.search(line)
+
+	if m:
+		if (scanner.iCurrentMethodName.find(scanner.iCurrentClassName) > -1):
+			return 0
+
+		deletingArrayMember = 0
+		if (line.find("[")):
+			deletingArrayMember = 1
+
+		# get the variable name, between the 'delete' and the ';'
+		endindex = line.find(";")
+		if (endindex == -1):
+			endindex = len(line)
+		startindex = line.find("delete")
+		variable = line[startindex+6:endindex]
+		variable2 = TrimVariableName(variable)
+
+		bracketdepth = GetBracketDepth(lines, currentline)
+
+		i = currentline
+		while (i < len(lines)):
+			nextLine = lines[i]
+
+			if deleteMemberVariableLeavingFunction.search(nextLine):
+				return 1
+			if deleteMemberVariableLeave.search(nextLine):
+				return 1
+			if deleteMemberVariableNewELeave.search(nextLine):
+				return 1
+			
+			if (deletingArrayMember == 1):
+				if (nextLine.find(variable2)):
+					if deleteMemberVariableArrayDeletion.search(nextLine):
+						return 0
+					if deleteMemberVariableArrayDeletion2.search(nextLine):
+						return 0
+
+			foundAssignment = nextLine.find("=")
+			if (foundAssignment > -1 and nextLine[foundAssignment+1] != "="):
+				assigned = nextLine[:foundAssignment]
+				if (assigned.find(variable2)):
+					return 0
+
+			if (nextLine.find('{') >= 0):
+				bracketdepth = bracketdepth + 1
+			if (nextLine.find('}') >= 0):
+				bracketdepth = bracketdepth - 1
+				if (bracketdepth == 0):
+					return 1
+
+			i = i + 1
+	return 0
+
+script.iCompare	= deleteMemberVariableCompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/destructor.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,89 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# destructor.py
+#
+# Checks : Pointer access in destructors.
+# 
+# Reason : Accessing pointers to objects in destructors without 
+# checking whether they are not NULL could result in a panic, since
+# they may not have been constructed. The pointers should be
+# checked to determine whether they are owned objects. If they are
+# not owned, they should really be references rather than pointers.
+#
+# #################################################################
+
+script = CScript("destructor")
+script.iReString = r"""
+	^\s*
+	\w+
+	\s*
+	::~
+	\s*
+	\w+
+	\(
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCanPanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+remember = re.compile("(i[A-Z]\w*)(.+)")
+reguard = re.compile("^\s*(if|while)(.*)({|$)")
+
+def findguard(lines, currentline, destructorstartline, membername):
+	i = currentline
+	line = lines[i]
+
+	while (i > destructorstartline):
+		line = lines[i]
+		m = reguard.search(line)
+		if m:
+			index = m.group(2).find(membername)
+			if (index <> -1):
+				if (line[index - 1:index] <> "*") and (line[index + len(membername):index + len(membername) + 2] <> "->"):
+					return 1
+		i = i - 1
+
+	return 0
+
+def destructorcompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		openbracecount = 0
+		closebracecount = 0
+		checkline = currentline
+
+		while (checkline < len(lines)):
+			line = lines[checkline]
+			openbracecount += line.count("{")
+			closebracecount += line.count("}")
+			member = remember.search(line)
+			if member and ((member.group(2)[:2] == "->") or (line[member.start()-1:member.start()] == "*" and member.group(2)[:1] <> ".")):
+				membername = member.group(1)
+				if (membername.upper()[-3:] == "ENV") or findguard(lines, checkline, currentline, membername) <> 0:
+					return 0
+				else:
+					return 1
+
+			if (openbracecount and (openbracecount - closebracecount == 0)):
+				break
+			checkline += 1
+
+	return 0
+
+script.iCompare	= destructorcompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/doubleSemiColon.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,40 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# #################################################################
+# doubleSemiColon.py
+#
+# Checks : Use of double semicolon.
+#
+# Reason : Double semicolons at the end of a line are not necessary 
+# and cause a CodeWarrior compiler error.
+#
+# #################################################################
+
+script = CScript("doubleSemiColon")
+script.iReString = r"""
+	;
+	\s*
+	;
+	\s*
+	$
+	"""
+script.iFileExts = ["cpp", "h", "inl"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/driveletters.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,32 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# driveletters.py
+#
+# Checks : Hard-coded drive letters.
+#
+# Reason : Drive letters should not be hard-coded.
+#
+# #################################################################
+
+script = CScript("driveletters")
+script.iReString = r"""[a-zA-Z]:\\\\"""
+script.iFileExts = ["cpp", "h", "rss", "rls", "loc", "ra"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreComments
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/eikbuttons.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,37 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# eikbuttons.py
+#
+# Checks : Checks that the R_EIK_BUTTONS_* resources are not being 
+# used.
+#
+# Reason : R_EIK_BUTTONS_* resources will not be internationalised, 
+# and should not be used. Instead, create your own button resource. 
+# No button resource (or indeed, rls string) should be used in 
+# more than one location. Note: This issue is only relevant for 
+# development on Nokia platforms.
+#
+# #################################################################
+
+script = CScript("eikbuttons")
+script.iReString = "R_EIK_BUTTONS_.*?"
+script.iFileExts = ["rss", "cpp"]
+script.iCategory = KCategoryLocalisation
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/eikonenvstatic.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,38 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# eikonenvstatic.py
+#
+# Checks : Using CEikonEnv::Static.
+#
+# Reason : CEikonEnv::Static() calls should be kept to a minimum, 
+# because this involves TLS. All applications, controls, and 
+# dialogs already have a pointer to the singleton instance of 
+# CEikonEnv as a member variable and so don't need to find it again. 
+# If a class does not have access to a CEikonEnv and needs to use 
+# it repeatedly, then it should store one.
+#
+# #################################################################
+
+script = CScript("eikonenvstatic")
+script.iReString = "CEikonEnv::Static"
+
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryPerformance
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/enummembers.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,82 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# enummembers.py
+#
+# Checks : Badly-named enum members.
+#
+# Reason : Badly-named enum members make the code harder to 
+# maintain and may cause defects.
+#
+# #################################################################
+
+script = CScript("enummembers")
+script.iReString = r"""
+			^
+			\s*
+			enum
+			((\s+\w+)|(\s+\w+\s*::\s*\w+))?
+			\s*
+			({|$)
+			"""
+script.iFileExts = ["h", "cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+reMember = re.compile("^\s*(\w+)")
+
+def enummemberscompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		startline = currentline
+		openbraceindex = lines[startline].find("{")
+		while (openbraceindex == -1) and (startline < len(lines)) and (lines[startline].find(";") == -1):
+			startline += 1
+			openbraceindex = lines[startline].find("{")
+
+		if openbraceindex == -1:
+			return 0
+
+		endline = currentline
+		closebraceindex = lines[endline].find("}")
+		while (closebraceindex == -1) and (endline < len(lines)):
+			endline += 1
+			closebraceindex = lines[endline].find("}")
+
+		enumcontents = ""
+		if (startline == endline):
+			enumcontents = lines[startline][openbraceindex + 1:closebraceindex - 1]
+		else:
+			enumcontents = lines[startline][openbraceindex + 1:]
+			line = startline + 1
+			while (line < len(lines)) and (line < endline):
+				enumcontents = enumcontents + lines[line]
+				line += 1
+
+			enumcontents = enumcontents + lines[endline][:closebraceindex - 1]
+
+		# check contents
+		members = enumcontents.split("\n\r,")
+		for member in members:
+			m2 = reMember.search(member)
+			if m2 and (m2.group(1)[:1] <> "E"):
+				return 1
+									
+	return 0
+
+script.iCompare = enummemberscompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/enumnames.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,51 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# enumnames.py
+#
+# Checks : Badly-named enums.
+#
+# Reason : Badly-named enums make the code harder to maintain and 
+# may cause defects.
+#
+# #################################################################
+
+script = CScript("enumnames")
+script.iReString = r"""
+			^
+			\s*
+			enum
+			\s+
+			(\w+\s*::\s*)?
+			(\w+)
+			\s*
+			({|$)
+			"""
+script.iFileExts = ["h", "cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+def enumnamescompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		if m.group(2)[:1] <> "T":
+				return 1
+
+	return 0
+
+script.iCompare = enumnamescompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/exportinline.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,35 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# exportinline.py
+#
+# Checks : Exporting inline functions.
+#
+# Reason : Inline functions should not be exported because this can 
+# cause those that link to the DLL to fail to build. Exporting 
+# functions limits the changes that can be made in the future 
+# due to considerations of binary-compatibility.
+#
+# #################################################################
+
+script = CScript("exportinline")
+script.iReString = "IMPORT_C\s+.*inline\s+.+\("
+script.iFileExts = ["cpp", "h", "hpp", "inl", "c"]
+script.iCategory = KCategoryWrongFunctionality
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/exportpurevirtual.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,35 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# exportpurevirtual.py
+#
+# Checks : Exporting pure virtual functions.
+#
+# Reason : Symbian recommends against the exportation of 
+# pure virtual functions.
+#
+# #################################################################
+
+script = CScript("exportpurevirtual")
+script.iReString = "IMPORT_C\s+.*\)\s*=\s*0\s*;$"
+script.iFileExts = ["cpp", "h", "hpp", "inl", "c"]
+script.iCategory = KCategoryWrongFunctionality
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+scanner.AddScript(script)
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/externaldriveletters.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,37 @@
+# This script is duplicate of driveletters.py
+
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# externaldriveletters.py
+#
+# Checks : Hard-coded external drive letters.
+#
+# Reason : External drive letters should not be hard-coded as the 
+# external drive may change between platforms and releases. 
+# This may cause confusion over ownership leading to classes being 
+# deleted erroneously and leaks occurring.
+#
+# #################################################################
+
+#script = CScript("externaldriveletters")
+#script.iReString = """"[abd-yABD-Y]:\\\\"""
+#script.iFileExts = ["cpp", "h", "rss", "rls", "loc", "ra"]
+#script.iCategory = KCategoryCanPanic
+#script.iIgnore = KIgnoreComments
+#script.iSeverity = KSeverityHigh
+
+#scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/flags.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,41 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# flags.py
+#
+# Checks : Use of R&D flags or feature flags.
+#
+# Reason : Independent application must not use R&D flags nor 
+# feature flags via preprocessor statements in the source code.
+# This means bld*.hrh and productvariant.hrh should not be used.
+#
+# #################################################################
+
+script = CScript("flags")
+script.iReString = r"""
+    ^\s*
+    \#include
+    \s+
+    ("|<)
+    ((bld\w+|productvariant)\.hrh)
+    ("|>)
+    """
+script.iFileExts = ["cpp", "h", "hrh", "mmp"]
+script.iCategory = KCategoryOther
+script.iIgnore = KIgnoreComments
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/foff.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,34 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# foff.py
+#
+# Checks : Use of _FOFF.
+#
+# Reason : _FOFF allows access to data in classes that were not 
+# intended for public access. This may cause problems, especially 
+# when the location of the data changes.
+#
+# #################################################################
+
+script = CScript("foff")
+script.iReString = "_FOFF"
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/forbiddenwords.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,51 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# forbiddenwords.py
+#
+# Checks : Use of forbidden words in header files.
+#
+# Reason : Some words should not be used in header files; 
+# especially those header files destined for external release. 
+# Some words may be forbidden for legal reasons or for platform 
+# consistency. Where they exist, alternative allowed words should 
+# be used. For example, \"NMP\" and \"Nokia Mobile Phones\" should 
+# be replaced by \"Nokia\".
+#
+# #################################################################
+
+script = CScript("forbiddenwords")
+script.iReString = ""
+script.iFileExts = ["h"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreNothing
+script.iSeverity = KSeverityLow
+
+reForbiddenWordsStr = "(Typhoon|Hurricane|Calypso|Rubik|Epoc\\|Nokia Mobile Phones|NMP|Mobile Innovation|(^|\s)S90|(^|\s)S80)"
+
+scriptNode = script.ScriptConfig()
+if (scriptNode <> None):
+	for wordNode in scriptNode.getElementsByTagName("wordsRE"):
+		reForbiddenWordsStr = wordNode.firstChild.nodeValue
+		print "Note: 'forbidden words' pattern configured as: " + reForbiddenWordsStr
+		break
+reForbiddenWords = re.compile(reForbiddenWordsStr, re.IGNORECASE)
+
+def forbiddenwordcompare(lines, currentline, rematch, filename):
+	return reForbiddenWords.search(lines[currentline])
+
+script.iCompare = forbiddenwordcompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/forgottoputptroncleanupstack.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,302 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# forgottoputptroncleanupstack.py
+#
+# Checks : Neglected to put variable on cleanup stack.
+#
+# Reason : If a variable is not put on the cleanup stack and a 
+# leaving function or ELeave is called, a memory leak occurs. 
+# CodeScanner occasionally gives false positives for this issue. 
+# Individual cases should be investigated.
+#
+# #################################################################
+
+script = CScript("forgottoputptroncleanupstack")
+script.iReString = r"""
+	\s+				# optional whitespace
+	[b-hj-z]+		# must not be a member or parameter
+	[A-Za-z0-9]+	# variable name
+	\s*				# optional whitespace
+	=				# assignment operator
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+forgottoputptroncleanupstackCleanup = re.compile("""Cleanup""", re.VERBOSE)
+
+forgottoputptroncleanupstackDeleteOp = re.compile("""
+	\s+
+	delete
+	\s+
+	""", re.VERBOSE)
+
+forgottoputptroncleanupstackReturnCmd = re.compile("""
+	(\s*|\()
+	return
+	(\s*|\()
+	""", re.VERBOSE)
+
+forgottoputptroncleanupstackSetFn = re.compile("""
+	Set
+	[A-Za-z0-9]+
+	[A-KM-Za-z0-9]
+	\s*
+	\(
+	""", re.VERBOSE)
+
+forgottoputptroncleanupstackBreak = re.compile("""
+	\s+
+	break
+	\s*
+	;
+	""", re.VERBOSE)
+
+forgottoputptroncleanupstackIf = re.compile("""
+	\s+
+	if
+	\s*
+	\(
+	""", re.VERBOSE)
+	
+forgottoputptroncleanupstackElse = re.compile("""
+	\}*
+	\s*
+	else
+	\s*
+	\{*
+	""", re.VERBOSE)
+
+forgottoputptroncleanupstackAssignToMember = re.compile("""
+	i
+	[A-Za-z0-9\[\]]+
+	\s*
+	=
+	\s*
+	.*
+	\s*
+	;
+	""", re.VERBOSE)
+
+forgottoputptroncleanupstackTrapMacro = re.compile("""
+	TRAP
+	[D]*
+	\s*
+	\(
+	""", re.VERBOSE)
+
+forgottoputptroncleanupstackLeavingFunction = re.compile("""
+	[A-Za-z0-9]+
+	L
+	\s*
+	\(
+	""", re.VERBOSE)
+
+forgottoputptroncleanupstackLeave = re.compile("""
+	User::Leave
+	""", re.VERBOSE)
+
+forgottoputptroncleanupstackLeaveAndDelete = re.compile("""
+	L
+	[D]+
+	\s*
+	\(
+	""", re.VERBOSE)
+
+forgottoputptroncleanupstackNewOperator = re.compile("""
+	new
+	\s*
+	\(
+	\s*
+	ELeave
+	""", re.VERBOSE)
+
+forgottoputptroncleanupstackNewFunction = re.compile("""
+	::NewL
+	\s*
+	\(
+	""", re.VERBOSE)
+
+forgottoputptroncleanupstackCreateFunction = re.compile("""
+	Create
+	[A-Za-z0-9]+
+	L
+	\s*
+	\(
+	""", re.VERBOSE)
+
+forgottoputptroncleanupstackAllocFunction = re.compile("""
+	Alloc
+	L*
+	\s*
+	\(
+	""", re.VERBOSE)
+
+def findForgetCompare(lines, currentline, rematch, filename):
+	line = lines[currentline]
+	m = rematch.search(line)
+
+	if m:
+		foundNew = 0
+		equalPos = line.find("=")
+		assignedSection = line[equalPos:]
+	
+		if forgottoputptroncleanupstackNewFunction.search(assignedSection):
+			foundNew = 1
+		if forgottoputptroncleanupstackNewOperator.search(assignedSection):
+			foundNew = 1
+		if forgottoputptroncleanupstackAllocFunction.search(assignedSection):
+			foundNew = 1
+		if forgottoputptroncleanupstackCreateFunction.search(assignedSection):
+			foundNew = 1
+
+		# if this line contains a 'new', a 'NewL(', or an 'AllocL('
+		if (foundNew == 1):	
+			i = currentline
+
+		# move to next line ending if this line doesn't contain one
+			while (lines[i].find(';') == -1):
+				i = i + 1
+
+		# go to next line
+			i = i + 1
+			bracketdepth = GetBracketDepth(lines, i)
+			
+		# get the variable name, between the '*' and the '='
+			startindex = line.find("*")
+			if (startindex == -1):
+				startindex = 0
+			endindex = line.find("=")
+			variable = line[startindex+1:endindex]
+			if (len(variable) < 1):
+				return 0
+			variable = TrimVariableName(variable)
+
+			inAnIfOrSelectStatement = 1 # possibly
+			
+			while (i < len(lines)):
+				line2 = lines[i]
+
+				if (line2.find('{') >= 0):
+					bracketdepth = bracketdepth + 1
+				if (line2.find('}') >= 0):
+					bracketdepth = bracketdepth - 1
+					inAnIfOrSelectStatement = 0
+					if (bracketdepth == 0):
+						return 0
+
+				varIndex = line2.find(variable)
+		# if a later line contains the variable...
+				while (varIndex <> -1):
+					if (isNonAlpha(line2[varIndex-1])):
+						if (isNonAlpha(line2[varIndex+len(variable)])):
+		# ...and delete, exit
+							if forgottoputptroncleanupstackDeleteOp.search(line2):
+								return 0
+	
+		# ...and an xxxLD() function, exit
+							if forgottoputptroncleanupstackLeaveAndDelete.search(line2):
+								return 0
+							
+		# ...and the variable is assigned to a member variable, exit
+							if forgottoputptroncleanupstackAssignToMember.search(line2):
+								return 0
+		
+		# ...and it is a Set...() call, exit (e.g. SetArray, SetAppUi)
+							if forgottoputptroncleanupstackSetFn.search(line2):
+								return 0
+
+		# ...and a return command, exit 
+							if forgottoputptroncleanupstackReturnCmd.search(line2):
+								return 0
+
+		# search this line again incase there are similarly named variables
+					line2 = line2[varIndex+1:]
+					varIndex = line2.find(variable)
+
+				line2 = lines[i]
+		# if a leaving function is called...
+				if forgottoputptroncleanupstackLeavingFunction.search(line2):
+		# ...if the leaving function is trapped, exit
+					if forgottoputptroncleanupstackTrapMacro.search(line2):
+						return 0
+		# ...if a Cleanup function is called, exit
+					if forgottoputptroncleanupstackCleanup.search(line2):
+						return 0
+		# ...otherwise this is a problem!
+					return 1
+
+		# if a User::Leave is called, this is a problem
+				if forgottoputptroncleanupstackLeave.search(line2):
+					return 1
+	
+		# if the variable is initialised in a branch of an 'if' or 'switch' statement, ignore other branches
+				if (inAnIfOrSelectStatement == 1):
+					if forgottoputptroncleanupstackBreak.search(line2):
+						atLine = i
+						inAnIfOrSelectStatement = 0
+						findSwitch = i
+						line3 = lines[findSwitch]
+						while (line3.find("switch") == -1):
+							findSwitch = findSwitch - 1
+							if (findSwitch <= 0):
+								return 0
+							line3 = lines[findSwitch]
+						switchBracketDepth = GetBracketDepth(lines, findSwitch)
+						i = atLine
+						while (bracketdepth > switchBracketDepth):
+							if (i >= len(lines)):
+								return 0
+							line2 = lines[i]
+							if (line2.find('{') >= 0):
+								bracketdepth = bracketdepth + 1
+							if (line2.find('}') >= 0):
+								bracketdepth = bracketdepth - 1
+							i = i + 1
+							
+					if forgottoputptroncleanupstackElse.search(line2):
+						inAnIfOrSelectStatement = 0
+						elseBracketDepth = bracketdepth
+						if (line2.find('{') >= 0):
+							elseBracketDepth = elseBracketDepth - 1
+						if (elseBracketDepth == GetBracketDepth(lines, currentline)):
+							while (line2.find(';') == -1):
+								i = i + 1
+								if (i >= len(lines)):
+									return 0
+								line2 = lines[i]
+						else:
+							while (bracketdepth > elseBracketDepth):
+								i = i + 1
+								if (i >= len(lines)):
+									return 0
+								line2 = lines[i]
+								if (line2.find('{') >= 0):
+									bracketdepth = bracketdepth + 1
+								if (line2.find('}') >= 0):
+									bracketdepth = bracketdepth - 1
+
+					if forgottoputptroncleanupstackIf.search(line2):
+						inAnIfOrSelectStatement = 0
+				i = i + 1
+			return 0
+
+	return 0
+
+script.iCompare	= findForgetCompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/friend.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,33 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# friend.py
+#
+# Checks : Use of friends.
+#
+# Reason : The friend directive is often misused and can indicate 
+# problems in the OO design.
+#
+# #################################################################
+
+script = CScript("friend")
+script.iReString = "^\s*friend\s"
+script.iFileExts = ["cpp", "h", "hpp", "inl", "c"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/goto.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,33 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# goto.py
+#
+# Checks : Use of goto.
+#
+# Reason : Goto should not be used if it can be avoided because 
+# it makes the program flow more difficult to follow.
+#
+# #################################################################
+
+script = CScript("goto")
+script.iReString = "(^|[^\w])goto\s+"	# a goto at the beginning of a line or after a non-alphanumeric char
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/ifassignments.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,38 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# ifassignments.py
+#
+# Checks : Assignment in an If statement.
+#
+# Reason : Assignments inside an If statement often indicate that 
+# the assignment was not intended. Even if the assignment was 
+# intended, it is clearer to separate out the assignment from the 
+# conditional. The script that detects such occurrences has a few 
+# false positives when the action statements are on the same line 
+# as the conditional check. However, this is also against the 
+# coding standards and the action should be on a separate line.
+#
+# #################################################################
+
+script = CScript("ifassignments")
+script.iReString = "^\s*if\s*\(\s*.*[A-Za-z0-9_]\s*=\s*[A-Za-z0-9_].*\)"
+script.iFileExts = ["h", "cpp", "c"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/ifpreprocessor.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,48 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# ifpreprocessor.py
+#
+# Checks : Use of #if in .h files.
+#
+# Reason : #if in header files should only be used before the 
+# main include guards and not around #include statements or around 
+# functional blocks in class definitions. The reason for the latter 
+# is to aid readability and to make BC breaks more difficult.
+#
+# #################################################################
+
+script = CScript("ifpreprocessor")
+script.iReString = "^\s*\#if(.*)"
+script.iFileExts = ["h"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+def ifpreprocessorcompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		text = m.group(1)
+		slashindex = filename.rfind("/")
+		if slashindex == -1 :
+			slashindex = filename.rfind("\\")			
+		if (slashindex <> -1) and (text.upper().find(filename[slashindex+1:-2].upper()) == -1):
+			return 1
+		else:
+			return 0
+
+script.iCompare = ifpreprocessorcompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/inheritanceorder.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,92 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# inheritaenceorder.py
+#
+# Checks : Incorrect inheritance order of M and C classes.
+#
+# Reason : If a C class inherits first from an M class and then a 
+# C class, a panic can occur when trying to pop a CBase pointer 
+# pointing to such a class from the cleanup stack when in fact a 
+# pointer pointing to the first predecessor, the mixin class, was 
+# popped instead.
+#
+# #################################################################
+
+script = CScript("inheritanceorder")
+script.iReString = r"""
+    ^\s*         # optional whitespace
+    class
+    \s+          # whitespace
+    (\w+::)?
+    (\w+)        # class name
+    \s*          # optional whitespace
+    :
+    (.*)         # inheritance list
+    """
+script.iFileExts = ["h", "cpp"]
+script.iCategory = KCategoryCanPanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+def inheritancecompare(lines, currentline, rematch, filename):
+    m = rematch.search(lines[currentline])
+    if m:
+        className = m.group(2)
+        if className[0] <> "C" or (len(className) == 1) or not className[1].isupper():
+            return 0
+
+        inheritanceString = m.group(3)
+
+        # check for inheritance list spanning multiple lines
+        i = currentline + 1
+        while (inheritanceString.find("{") == -1) and i < len(lines):
+            if (inheritanceString.find(";") <> -1):
+                return 0
+            inheritanceString += lines[i]
+            i += 1
+
+        # construct inheritance class list
+        inheritancelist = inheritanceString.split(",")
+        reclass = re.compile("[\s:]*(public|protected|private)?\s*([\w:]+)")
+        classlist = []
+        for inheritance in inheritancelist:
+            match = reclass.search(inheritance)
+            if match:
+                inheritclass = match.group(2)
+                colonpos = inheritclass.rfind(":")
+                if (colonpos <> -1):
+                    inheritclass = inheritclass[colonpos + 1:]
+                classlist.append(inheritclass)
+
+        # check the order of M and C classes in inheritance class list 
+        mclassIndex = -1
+        cclassIndex = -1
+        for classname in classlist:
+            if (len(classname) > 2):
+                if classname[0] == "M" and classname[1].isupper() and mclassIndex == -1:
+                    mclassIndex = classlist.index(classname)
+                if classname[0] == "C" and classname[1].isupper() and cclassIndex == -1:
+                    cclassIndex = classlist.index(classname)
+        if mclassIndex != -1 and cclassIndex != -1 and mclassIndex < cclassIndex:
+            return 1
+        else:
+            return 0
+
+    return 0
+
+script.iCompare = inheritancecompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/intleaves.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,36 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# intleaves.py
+#
+# Checks : Methods that leave AND return a TInt error.
+#
+# Reason : Returning an error code as well as being able to leave 
+# is problematical for the caller. It is preferable to adhere to 
+# one method of returning the error. Note: CodeScanner is likely to 
+# return false positives for this situation, because some returned 
+# TInt values will not be error codes.
+#
+# #################################################################
+
+script = CScript("intleaves")
+script.iReString = "TInt\s+\w+::\w+LC?\s*\("
+script.iFileExts = ["h", "cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/jmp.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,34 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# jmp.py
+#
+# Checks : Use of setjmp and/or longjmp.
+#
+# Reason : Using setjmp and/or longjmp makes code less maintainable.
+#
+# #################################################################
+
+script = CScript("jmp")
+script.iReString = r"""
+	(set|long)jmp
+	"""
+script.iFileExts = ["cpp", "h"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/leave.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,71 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# leave.py
+#
+# Checks : Leaving functions called in non-leaving functions.
+#
+# Reason : Non-leaving functions should not call leaving functions. 
+# Note: Operator functions are considered to be able to leave when 
+# scanning the code inside them.
+#
+# #################################################################
+
+script = CScript("leave")
+script.iReString = KReStringLeavingLine
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCanPanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+reLeavingMethod = re.compile("""
+	(
+	\s*operator
+	|
+	\w*
+	[a-z]
+	\w*
+	L
+	(C(C*|[2-9])|D|P|X)?
+	$
+	)
+""", re.VERBOSE)
+
+def leavecompare(lines, currentline, rematch, filename):
+	currentMethod = scanner.iCurrentMethodName
+	if (currentMethod <> "") and (currentMethod[:5] <> "Leave"):
+		m = rematch.search(lines[currentline])
+		if m and not reLeavingMethod.search(currentMethod):
+			line = lines[currentline]
+			startline = currentline
+			if (lines[currentline].find("TRAP") != -1):
+				return 0
+
+			bracketCount = line.count("(") - line.count(")")
+			startBracketCount = bracketCount
+
+			while (currentline > startline - 40) and (currentline >= 0):
+				currentline -= 1
+				line = lines[currentline]
+				bracketCount += line.count("(") - line.count(")")
+				if (lines[currentline].find("TRAP") != -1) and (bracketCount == startBracketCount + 1):
+					return 0
+			return 1
+
+	return 0
+
+script.iCompare = leavecompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/leavingoperators.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,62 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# leavingoperators.py
+#
+# Checks : Leaving functions called in operator functions.
+#
+# Reason : It is not obvious that operator functions can leave. 
+# Calling leaving functions in operator functions should be 
+# considered carefully.
+#
+# #################################################################
+
+script = CScript("leavingoperators")
+script.iReString = "(\w*[a-z]\w*L(C*|D|P))\s*\(|ELeave|User::Leave|tream\s+<<|tream\s+>>"
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+reOperatorMethod = re.compile("""
+	operator
+	""", re.VERBOSE)
+
+def leavecompare(lines, currentline, rematch, filename):
+	currentMethod = scanner.iCurrentMethodName
+	if (currentMethod <> "") and (currentMethod[:5] <> "Leave"):
+		m = rematch.search(lines[currentline])
+		if m and reOperatorMethod.search(currentMethod):
+			line = lines[currentline]
+			startline = currentline
+			if (lines[currentline].find("TRAP") != -1):
+				return 0
+
+			bracketCount = line.count("(") - line.count(")")
+			startBracketCount = bracketCount
+
+			while (currentline > startline - 20) and (currentline >= 0):
+				currentline -= 1
+				line = lines[currentline]
+				bracketCount += line.count("(") - line.count(")")
+				if (lines[currentline].find("TRAP") != -1) and (bracketCount == startBracketCount + 1):
+					return 0
+			return 1
+
+	return 0
+
+script.iCompare = leavecompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/linescanner.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,1885 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# linescanner.py - the main body of CodeScanner
+#
+# #################################################################
+
+import base64
+import datetime
+import encodings
+import getopt
+import os
+import os.path
+import psyco
+import re
+import sys
+import xml.dom.minidom
+import zlib
+
+# Ignore flags
+KIgnoreNothing = 0
+KIgnoreComments = 1
+KIgnoreCommentsAndQuotes = 2
+KIgnoreQuotes = 3
+
+# Severities for the scripts
+KSeverityHigh = 0
+KSeverityMedium = 1
+KSeverityLow = 2
+
+# The names used in the XML configuration file for severity element names.
+KSeverityConfigMap = {
+			KSeverityHigh		: "high",
+			KSeverityMedium		: "medium",
+			KSeverityLow		: "low"}
+
+# The names used in the HTML summary file for severity element names.
+KSeverityHTMLMap = {
+			KSeverityHigh		: "High",
+			KSeverityMedium		: "Medium",
+			KSeverityLow		: "Low"}
+
+# Categories for the scripts
+KCategoryLegal = "Legal Code" 
+KCategoryDefinitePanic = "Always Panic"
+KCategoryCanPanic = "Can Panic"
+KCategoryWrongFunctionality = "Wrong Functionality"
+KCategoryLocalisation = "Localisation"
+KCategoryPerformance = "Performance"
+KCategoryCodingStandards = "Coding Standard"
+KCategoryDocumentation = "Documentation"
+KCategoryCodeReviewGuides = "Code Review Guide"
+KCategoryOther = "Other"
+
+KCategoryHtmlDisplayOrder = [KCategoryLegal,
+	KCategoryDefinitePanic,
+	KCategoryCanPanic,
+	KCategoryWrongFunctionality,
+	KCategoryLocalisation,
+	KCategoryPerformance,
+	KCategoryCodingStandards,
+	KCategoryDocumentation,
+	KCategoryCodeReviewGuides,
+	KCategoryOther]
+
+# The names used in the XML configuration file for category element names.
+KCategoryConfigMap = {
+			KCategoryLegal				:	"legal", 
+			KCategoryDefinitePanic		:	"panic", 
+			KCategoryCanPanic			:	"canpanic", 
+			KCategoryWrongFunctionality	:	"functionality",
+			KCategoryLocalisation		:	"localisation",
+			KCategoryPerformance		:	"performance",
+			KCategoryCodingStandards	:	"codingstandards",
+			KCategoryDocumentation		:	"documentation",
+			KCategoryCodeReviewGuides	:	"codereview",
+			KCategoryOther				:	"other"}
+
+#Custom rule keyword types
+KKeywordBaseClass = "baseclass"
+KKeywordCall = "call"
+KKeywordClassName = "class"
+KKeywordComment = "comment"
+KKeywordGeneric = "generic"
+KKeywordLocal = "local"
+KKeywordMacro = "macro"
+KKeywordMember = "member"
+KKeywordMethod = "method"
+KKeywordParameter = "parameter"
+KKeywordUnknown = "unknown"
+
+#The names used in the XML configuration file for custom rule keyword types.
+KCustomRuleKeywordMap = {
+			KKeywordBaseClass           :   "baseclass",
+			KKeywordCall                :   "call",
+			KKeywordClassName           :   "class",
+			KKeywordComment             :   "comment",
+			KKeywordGeneric             :   "generic",
+			KKeywordLocal               :   "local",
+			KKeywordMacro               :   "macro",
+			KKeywordMember              :   "member",
+			KKeywordMethod              :   "method",
+			KKeywordParameter           :   "parameter",
+			KKeywordUnknown             :   "unknown"}
+
+KVersion = "Nokia CodeScanner version 2.1.4"
+KCopyrightLine1 = "Copyright (c) 2007-2009. Nokia Corporation. All rights reserved."
+KCopyrightLine1Html = "Copyright &copy; 2007-2009. Nokia Corporation. All rights reserved."
+KCopyrightLine2 = "For product and support information, visit www.forum.nokia.com."
+KWww = "www.forum.nokia.com"
+
+stringPool = {}
+#!LOCALISEHERE
+
+def Usage(code, msg=""):
+	print msg
+	print
+	print KVersion
+	print
+	print "Usage: CodeScanner [options] <source dir> [<output dir>]"	
+	print "   or: CodeScanner [options] <source file> [<output dir>]"
+	print 
+	print "options:"
+	print "    -h - display command help"
+	print "    -v - display verbose messages"
+	print "    -c <config file> - use specified configuration file"
+	print "    -i <source dir/file> - specify additional directory/file to scan"
+	print "    -l <log file> - create debug log with specified filename"
+	print "    -o html|xml|std - specify output format : HTML, XML or StdOut; default is HTML"
+	print "    -x url to lxr site"
+	print "    -r lxr version"
+	print "    -t on/off - create a time-stamped directory for results, default is on"
+	print
+	print "<source dir> is the directory containing the source code to scan"
+	print "<source file> is the single file containing the source code to scan"
+	print "<output dir> is the directory in which to produce the output"
+	print
+	print "Notes:"
+	print "<source dir> and <output dir> cannot be identical"
+	print "<output dir> cannot be the root of a drive"
+	print
+	print KCopyrightLine1
+	print KCopyrightLine2
+	if scanner.iLog <> None:
+		scanner.iLog.Write("usage(): exiting with code " + str(code))
+		scanner.iLog.Close()
+	sys.exit(code)
+
+def DefaultCompare(aLines, aCurrentline, aRematch, aFilename):
+	if aRematch.search(aLines[aCurrentline]):
+		return 1
+	else:
+		return 0
+
+def DefaultFuncParamCompare(lines, currentline, rematch, filename):
+	# distinguish local declaration from function parameter
+    line = lines[currentline]
+    m = rematch.search(line)
+    if m:
+        isFuncParam = (line.find(")") <> -1)
+        isLocal = (line.find(";") <> -1)
+
+        while (not isFuncParam) and (not isLocal) and (currentline + 1 < len(lines)):
+            currentline += 1
+            line = lines[currentline]
+            isFuncParam = (line.find(")") <> -1)
+            isLocal = (line.find(";") <> -1)
+
+        if isFuncParam:
+            return 1
+        elif isLocal:
+            return 0
+
+    return 0
+
+def ScanDirOrFile(argument):
+	if os.path.isdir(argument):
+		scanner.iComponentManager.SetRoot(argument)
+		scanner.TraverseDirectory(argument)
+	elif os.path.isfile(argument):
+		parentDir = os.path.dirname(argument)
+		scanner.iComponentManager.SetRoot(parentDir)
+		scanner.iComponentManager.BeginDirectory(parentDir)
+		numberOfLinesScanned = 0
+		numberOfLinesScanned += scanner.ScanFile(argument)
+		scanner.iComponentManager.EndDirectory(parentDir, numberOfLinesScanned)
+	else:
+		print "Unable to open specified source file: " + argument
+		sys.exit(2)
+
+
+class CScript:
+
+	# #######################################################
+	# CScript - a test script
+
+	def __init__(self, aScriptName):
+		self.iScriptName = aScriptName
+		self.iCompare = DefaultCompare
+		self.iReString = ""
+		self.iReMatch = re.compile("")
+		self.iTitle = stringPool[aScriptName + "!title"]
+		self.iIdeTitle = stringPool[aScriptName + "!ideTitle"]
+		self.iFileExts = []
+		self.iIgnore = KIgnoreNothing
+		self.iDescription = stringPool[aScriptName + "!description"]
+		self.iSeverity = KSeverityMedium
+		self.iBaseClass = ""
+
+	def ScriptConfig(self):
+		if (scanner.iDomConfig <> None):
+			for scriptsNode in scanner.iDomConfig.getElementsByTagName("scripts"):
+				for scriptNode in scriptsNode.getElementsByTagName(self.iScriptName):
+					return scriptNode
+		return None
+	
+	def DefaultInheritanceCompare(self, lines, currentline, rematch, filename):
+		m = rematch.search(lines[currentline])
+		if m:
+			inheritanceString = m.group(3)
+			# check for inheritance list spanning multiple lines
+			i = currentline + 1
+			while (inheritanceString.find("{") == -1) and i < len(lines):
+				if (inheritanceString.find(";") <> -1):
+					return 0
+				inheritanceString += lines[i]
+				i += 1
+
+			# construct inheritance class list
+			inheritancelist = inheritanceString.split(",")
+			reclass = re.compile("[\s:]*(public|protected|private)?\s*([\w:]+)")
+			classlist = []
+			for inheritance in inheritancelist:
+				match = reclass.search(inheritance)
+				if match:
+					inheritclass = match.group(2)
+					colonpos = inheritclass.rfind(":")
+					if (colonpos <> -1):
+						inheritclass = inheritclass[colonpos + 1:]
+					classlist.append(inheritclass)
+
+			# search for inheritance class
+			for classname in classlist:
+				if classname == self.iBaseClass:
+					return 1
+
+		return 0
+
+
+class CCustomScript(CScript):
+
+	# #######################################################
+	# CScript - a test script based on a custom rule
+
+	def __init__(self, aScriptName):
+		self.iScriptName = aScriptName
+		self.iCompare = DefaultCompare
+		self.iReString = ""
+		self.iTitle = ""
+		self.iIdeTitle = ""
+		self.iFileExts = []
+		self.iIgnore = KIgnoreNothing
+		self.iDescription = ""
+
+
+class CCategorisedScripts:
+
+	# #######################################################
+	# CCategorisedScripts - a collection of scripts sorted
+	# by script category (panic, can panic, etc.)
+
+	def AddScript(self, aScript):
+		# do we have a category for this already?
+		category = aScript.iCategory
+		if (not self.iScripts.has_key(category)):
+			# no, create a linear array here
+			self.iScripts[category] = []
+
+		# append to the correct category
+		self.iScripts[category].append(aScript)
+
+		# compile the reg-ex otherwise will get continuous hits
+		aScript.iReMatch = re.compile(aScript.iReString, re.VERBOSE)
+
+	def AllScripts(self):
+		result = []
+		for scripts in self.iScripts.values():
+			result += scripts
+
+		return result
+
+	def PrintListOfTestScripts(self):
+		for category in self.iScripts.keys():
+			print(category + "\n----------------------------------")
+			for script in self.iScripts[category]:
+				print("\t" + script.iScriptName)
+
+		print("")
+
+	# iScripts is a 2D array, 1st level is a hash of categories
+	#                         2nd level is linear array
+	iScripts = {}        
+
+class CLogger:
+
+	# #######################################################
+	# CLogger
+	# a simple log file interface
+
+	def __init__(self, aFilename):
+		if aFilename != None and len(aFilename) > 0:
+			self.iFile = file(aFilename, "w")
+			self.iFile.write(KVersion + " started at " + datetime.datetime.now().ctime() + "\n")
+		else:
+			self.iFile = None
+
+	def Write(self, aText):
+		if self.iFile <> None:
+			self.iFile.write(str(datetime.datetime.now().time())+":"+aText+"\n")
+			self.iFile.flush()
+
+	def Close(self):
+		if self.iFile <> None:
+			self.iFile.write(KVersion + " ended at " + datetime.datetime.now().ctime() + "\n")
+			self.iFile.close()
+
+
+class CRendererBase:
+
+	# #######################################################
+	# CRendererBase - base class for renderers
+
+	def RegisterSelf(self, aName, aDescription, aRendererManager):
+		self.iName = aName
+		self.iDescription = aDescription
+		aRendererManager.AddRenderer(self)
+	def BeginComponent(self, aComponent):
+		return
+	def BeginFile(self, aFilename):
+		return
+	def ReportError(self, aLineContext, aScript):
+		return
+	def EndFile(self):
+		return
+	def EndComponent(self, aComponent):
+		return
+
+
+class CStdOutRenderer(CRendererBase):
+
+	# #######################################################
+	# CStdOutRenderer - renderer for Standard Console Output
+	# Output goes to standard output; when run in Carbide, 
+	# this shows up in the output window. Correctly formatted 
+	# lines can then be selected, automatically selecting 
+	# the corresponding line of the associated source file. 
+	# The format is:
+	#   <filename>(<line>) : <comment>
+
+	def __init__(self, aRendererManager):
+		self.RegisterSelf("stdout", "StdOut renderer", aRendererManager)
+		print KVersion
+
+	def BeginComponent(self, aComponent):
+		return
+
+	def BeginFile(self, aFilename):
+		self.iErrorCount = 0
+		scanner.ReportAction("Scanning file " + aFilename)
+
+	def ReportError(self, aLineContext, aScript):
+		self.iErrorCount += 1
+		if (aScript.iSeverity == KSeverityLow):
+			msgType = "info"
+		elif (aScript.iSeverity == KSeverityMedium):
+			msgType = "warning"
+		elif (aScript.iSeverity == KSeverityHigh):
+			msgType = "error"
+		print(aLineContext.iFileName + "(" + str(aLineContext.iLineNumber) + ") : " + msgType + ": " + aScript.iScriptName + ": " + KSeverityConfigMap[aScript.iSeverity] + ": " + KCategoryConfigMap[aScript.iCategory] + ": " + aScript.iIdeTitle)
+		if len(scanner.iRendererManager.iAnnotation)>0:
+			print scanner.iRendererManager.iAnnotation
+			scanner.iRendererManager.iAnnotation = ""
+
+	def EndFile(self):
+		scanner.ReportAction("Total problems found in file: " + str(self.iErrorCount))
+
+	def EndComponent(self, aComponent):
+		scanner.iEndTime = datetime.datetime.now().ctime()
+		return
+
+
+class CXmlComponentSummaryFile:
+	# #########################################################
+	# CXmlComponentSummaryFile
+	# Encapsulates the script (problem) summary for XML output.
+	# For each script, there is a listing for occurrences
+	# of that script's problem and location of each occurrence.
+
+	def CreateSummary(self, aXmlRenderer):
+		try:
+			outputPath = os.path.normpath(os.path.join(aXmlRenderer.iOutputDirectory, "problemIndex.xml"))
+			outputFile = file(outputPath, "w")
+		except IOError:
+			scanner.ReportError("IOError : Unable to create output file " + outputPath)
+		else:
+			errors = aXmlRenderer.iErrors
+			level = 0
+			indent = "   "
+			outputFile.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
+			outputFile.write(level * indent + "<problemIndex>\n")
+			level += 1
+			for category in KCategoryHtmlDisplayOrder:
+				found = False
+				if scanner.iCategoriedScripts.iScripts.has_key(category):
+					for script in scanner.iCategoriedScripts.iScripts[category]:
+						if errors.has_key(script.iScriptName):
+							found = True
+							break
+					if found:
+						outputFile.write(level * indent + "<category")
+						outputFile.write(" name=\"" + KCategoryConfigMap[category] + "\">\n")
+						level += 1
+						for script in scanner.iCategoriedScripts.iScripts[category]:
+							if errors.has_key(script.iScriptName):
+								outputFile.write(level * indent + "<problem")
+								outputFile.write(" name=\"" + script.iScriptName + "\"")
+								outputFile.write(" severity=\"" + KSeverityConfigMap[script.iSeverity] + "\">\n")
+								level += 1
+								for fileName, lines in errors[script.iScriptName].items():
+									outputFile.write(level * indent + "<file")
+									outputFile.write(" path=\"" + fileName + "\">\n")
+									level += 1
+									for lineNo in lines:
+										outputFile.write(level * indent + str(lineNo) + "\n")
+									level -= 1
+									outputFile.write(level * indent + "</file>\n")
+								level -= 1
+								outputFile.write(level * indent + "</problem>\n")
+						level -= 1
+						outputFile.write(level * indent + "</category>\n")
+			level -= 1
+			outputFile.write(level * indent + "</problemIndex>\n")
+			outputFile.close()
+
+
+class CXmlRenderer(CRendererBase):
+
+	# ########################################
+	# CXmlRenderer - a renderer for XML output
+
+	def __init__(self, aRendererManager, aOutputDirectory):
+		self.RegisterSelf("xml", "XML renderer", aRendererManager)
+		self.iOutputDirectory = aOutputDirectory
+		if os.path.isdir(self.iOutputDirectory) != True :
+			os.makedirs(self.iOutputDirectory)
+		self.iErrors = {} 
+		print
+		print KVersion
+		print KCopyrightLine1
+		print KCopyrightLine2
+
+	def BeginComponent(self, aComponent):
+		return
+
+	def BeginFile(self, aFilename):
+		self.iFilename = aFilename
+		scanner.ReportAction("Scanning file " + aFilename)
+
+	def ReportError(self, aLineContext, aScript):
+		scriptName = aScript.iScriptName
+		fileName = aLineContext.iFileName
+		lineNumber = aLineContext.iLineNumber
+		if (not self.iErrors.has_key(scriptName)):
+			self.iErrors[scriptName] = {}
+		if (not self.iErrors[scriptName].has_key(fileName)):
+			self.iErrors[scriptName][fileName] = []
+		self.iErrors[scriptName][fileName].append(lineNumber)
+
+	def EndFile(self):
+		#tbd
+		return
+
+	def EndComponent(self, aComponent):
+		relativeComponentName = scanner.iComponentManager.RelativeComponentName(aComponent.iFullPath)
+		if len(relativeComponentName) < 1:	# root component - final component
+			scanner.iEndTime = datetime.datetime.now().ctime()
+			componentSummaryFile = CXmlComponentSummaryFile()
+			componentSummaryFile.CreateSummary(self)
+
+
+class CHtmlOutputFileBase:
+
+	# #######################################################
+	# CHtmlOutputFileBase - base class for HTML output files
+
+	def WriteHeader(self, aOutputFile):
+		aOutputFile.write("<html><body>")
+
+	def Write(self, aOutputFile, aText):
+		aOutputFile.write(aText)
+
+	def WriteLink(self, aOutputFile, aHref, aText):
+		aHref = self.CleanupLink(aHref)
+		aOutputFile.write("<a href=\"" + aHref + "\">" + aText + "</a>")
+
+	def WriteElement(self, aOutputFile, aElementName, aElementValue):
+		aOutputFile.write("<"+aElementName+">"+aElementValue+"</"+aElementName+">")
+
+	def WriteBreak(self, aOutputFile):
+		aOutputFile.write("<br>")
+
+	def WriteFooter(self, aOutputFile):
+		aOutputFile.write("<br><hr><center><h5>"+KCopyrightLine1Html+"</h5>")
+		aOutputFile.write("<h5>")
+		CHtmlOutputFileBase.WriteLink(self, aOutputFile, "http://"+KWww, KWww)
+		aOutputFile.write("</h5></center></body></html>")
+
+	def CleanupLink(self, aHref):
+		# Mozilla Firefox does not handle link with the '#' character correctly, 
+		# so we need to replace it with the equivalent URL encoding "%23"
+		aHref = aHref.replace("#", "%23")
+		# Mozilla Firefox sometimes does not handle link with '\' correctly,
+		# so we need to replace it with '/'
+		aHref = aHref.replace('\\', '/')
+		return aHref
+
+
+class CHtmlOutputFile(CHtmlOutputFileBase):
+
+	# #######################################################
+	# CHtmlOutputFile - simplified access to HTML output file
+
+	def __init__(self, aOutputPath):
+		if not os.path.isdir(os.path.dirname(aOutputPath)):
+			os.makedirs(os.path.dirname(aOutputPath))
+		self.iOutputFile = file(aOutputPath, "w")
+		self.WriteHeader(self.iOutputFile)
+
+	def Write(self, aText):
+		CHtmlOutputFileBase.Write(self, self.iOutputFile, aText)
+
+	def WriteLink(self, aHref, aText):
+		CHtmlOutputFileBase.WriteLink(self, self.iOutputFile, aHref, aText)
+
+	def WriteElement(self, aElementName, aElementValue):
+		CHtmlOutputFileBase.WriteElement(self, self.iOutputFile, aElementName, aElementValue)
+
+	def WriteBreak(self):
+		CHtmlOutputFileBase.WriteBreak(self, self.iOutputFile)
+		
+	def Close(self):
+		self.WriteFooter(self.iOutputFile)
+		self.iOutputFile.close()
+
+
+class CHtmlComponentSummaryFiles:
+
+	# #######################################################
+	# CHtmlComponentSummaryFiles
+	# Encapsulates the component summary files for HTML output.
+	# For each component, there is a component report file listing the number 
+	# of occurrences of each problem type. There is also a single index or 
+	# summary file with links to each of the component report files.
+
+	def CreateSummaries(self, aHtmlRenderer, aOutputDirectory):
+		totalErrorCount = 0
+		outputPath = os.path.normpath(os.path.join(aOutputDirectory, "componentIndex.html"))
+		componentSummaryFile = CHtmlOutputFile(outputPath)
+		componentSummaryFile.Write("<font face=verdana>")
+		componentSummaryFile.WriteElement("h2", "Component Summary")
+		componentSummaryFile.Write("Source: "+scanner.iSource)
+		componentSummaryFile.WriteBreak()
+		componentSummaryFile.Write("Scan started at:   " + scanner.iStartTime)
+		componentSummaryFile.WriteBreak()
+		componentSummaryFile.Write("Scan completed at: " + scanner.iEndTime)
+		componentSummaryFile.WriteBreak()
+		componentSummaryFile.WriteBreak()
+		componentSummaryFile.WriteLink("problemIndex.html", "View problems by type")
+		componentSummaryFile.WriteBreak()
+		componentSummaryFile.Write("<hr>")
+		componentSummaryFile.WriteBreak()
+		componentSummaryFile.Write("<table border=\"1\" width=\"100%\">")
+		componentSummaryFile.Write("<tr bgcolor=\"#0099ff\">")
+		componentSummaryFile.WriteElement("th width=\"75%\"", "Component")
+		componentSummaryFile.WriteElement("th", "Items Found")
+		componentSummaryFile.WriteElement("th", "Lines of Code")
+		componentSummaryFile.WriteElement("th", "Possible Defects/KLOC")
+		componentSummaryFile.Write("</tr>")
+		for component in scanner.iComponentManager.iCompletedComponents:
+			componentName = scanner.iComponentManager.ComponentName(component.iFullPath)
+			outputPath = os.path.normpath(os.path.join(aOutputDirectory, "byComponent"))
+			outputPath = os.path.normpath(os.path.join(outputPath, componentName))
+			outputPath = os.path.normpath(os.path.join(outputPath, "componentSummary.html"))
+			errorCount = self.WriteComponentReport(aHtmlRenderer, outputPath, component.iFullPath, componentName)
+			if (errorCount > 0):
+				totalErrorCount = totalErrorCount + errorCount
+				numberOfLinesScanned = component.iNumberOfLinesScanned
+				if (numberOfLinesScanned > 0):
+					defectsPerKLOC = int((1000.0 / numberOfLinesScanned) * errorCount)
+				else:
+					defectsPerKLOC = 0
+				componentSummaryFile.Write("<tr>")
+				componentSummaryFile.Write("<td>")
+				relOutputPath = os.path.normpath(os.path.join("byComponent", componentName))
+				relOutputPath = os.path.normpath(os.path.join(relOutputPath, "componentSummary.html"))
+				componentSummaryFile.WriteLink(relOutputPath, component.iFullPath)
+				componentSummaryFile.Write("</td>")
+				componentSummaryFile.Write("<td>")
+				componentSummaryFile.WriteElement("center",str(errorCount))
+				componentSummaryFile.Write("</td>")
+				componentSummaryFile.Write("<td>")
+				componentSummaryFile.WriteElement("center",str(numberOfLinesScanned))
+				componentSummaryFile.Write("</td>")
+				componentSummaryFile.Write("<td>")
+				componentSummaryFile.WriteElement("center",str(defectsPerKLOC))
+				componentSummaryFile.Write("</td>")
+				componentSummaryFile.Write("</tr>")
+
+		componentSummaryFile.Write("<tr>")
+		componentSummaryFile.Write("<td>")
+		componentSummaryFile.WriteElement("b", "Total")
+		componentSummaryFile.Write("</td>")
+		componentSummaryFile.Write("<td><center>")
+		componentSummaryFile.WriteElement("b", str(totalErrorCount))
+		componentSummaryFile.Write("</center></td>")
+		componentSummaryFile.Write("</tr>")
+
+		componentSummaryFile.Write("</table>")
+		componentSummaryFile.Close()
+
+	def WriteComponentReport(self, aHtmlRenderer, aOutputPath, aComponentFullPath, aComponentName):
+		totalErrorCount = 0
+		componentReportFile = CHtmlOutputFile(aOutputPath)
+		componentReportFile.Write("<font face=verdana>")
+		componentReportFile.WriteElement("h2", "Component Report")
+		componentReportFile.WriteElement("h3", "Component: "+aComponentFullPath)
+		componentReportFile.Write("<font face=verdana color=black>")
+		found = False
+		for category in KCategoryHtmlDisplayOrder:
+			if scanner.iCategoriedScripts.iScripts.has_key(category):
+				for script in scanner.iCategoriedScripts.iScripts[category]:
+					errorCount = scanner.iComponentManager.ScriptComponentErrorCount(aComponentFullPath, script.iScriptName)
+					if errorCount > 0:
+						found = True
+						break
+
+		if found:
+			componentReportFile.Write("<table border=\"1\" width=\"100%\">")
+			componentReportFile.Write("<tr bgcolor=\"#0099ff\">")
+			componentReportFile.WriteElement("th width=\"75%\"", "Problem")
+			componentReportFile.WriteElement("th", "Items Found")
+			componentReportFile.WriteElement("th", "Severity")
+			componentReportFile.Write("</tr>")
+			for category in KCategoryHtmlDisplayOrder:
+				if scanner.iCategoriedScripts.iScripts.has_key(category):
+					for script in scanner.iCategoriedScripts.iScripts[category]:
+						errorCount = scanner.iComponentManager.ScriptComponentErrorCount(aComponentFullPath, script.iScriptName)
+						if errorCount > 0:
+							componentReportFile.Write("<tr>")
+							componentReportFile.Write("<td>")
+							#scriptComponentPath = aHtmlRenderer.ScriptComponentPath(aComponentFullPath, script.iScriptName)
+							#componentReportFile.WriteLink(scriptComponentPath, script.iTitle)
+							componentReportFile.WriteLink(script.iScriptName+".html", script.iTitle)
+							componentReportFile.Write("</td>")
+							componentReportFile.Write("<td>")
+							componentReportFile.WriteElement("center", str(errorCount))
+							componentReportFile.Write("</td>")
+							componentReportFile.Write("<td>")
+							componentReportFile.WriteElement("center", KSeverityHTMLMap[script.iSeverity])
+							componentReportFile.Write("</td>")
+							componentReportFile.Write("</tr>")
+							totalErrorCount = totalErrorCount + errorCount
+			componentReportFile.Write("<tr>")
+			componentReportFile.Write("<td>")
+			componentReportFile.WriteElement("b", "Total")
+			componentReportFile.Write("</td>")
+			componentReportFile.Write("<td><center>")
+			componentReportFile.WriteElement("b", str(totalErrorCount))
+			componentReportFile.Write("</center></td>")
+			componentReportFile.Write("</tr>")
+			componentReportFile.Write("</table>")
+		else:
+			componentReportFile.WriteBreak()
+			componentReportFile.WriteElement("i", "There are no items to report for this component.")
+			componentReportFile.WriteBreak()
+		componentReportFile.Close()
+		return totalErrorCount
+
+
+class CHtmlScriptSummaryFiles:
+
+	# #######################################################
+	# CHtmlScriptSummaryFiles
+	# Encapsulates the script (problem) summary files for HTML output.
+	# For each script, there is a file listing the number of occurrences
+	# of that script's problem for each component. There is also a single
+	# index or summary file with links to each of the problem report file.
+
+	def CreateSummaries(self, aHtmlRenderer, aOutputDirectory):
+
+		totalErrorCount = 0
+
+		outputPath = os.path.normpath(os.path.join(aOutputDirectory, "problemIndex.html"))
+		scriptSummaryFile = CHtmlOutputFile(outputPath)
+		scriptSummaryFile.Write("<font face=verdana>")
+		scriptSummaryFile.WriteElement("h2", "Problem Summary")
+		scriptSummaryFile.Write("Source: "+scanner.iSource)
+		scriptSummaryFile.WriteBreak()
+		scriptSummaryFile.Write("Scan started at:   " + scanner.iStartTime)
+		scriptSummaryFile.WriteBreak()
+		scriptSummaryFile.Write("Scan completed at: " + scanner.iEndTime)
+		scriptSummaryFile.WriteBreak()
+		scriptSummaryFile.WriteBreak()
+		scriptSummaryFile.WriteLink("componentIndex.html", "View problems by component")
+		scriptSummaryFile.WriteBreak()
+		scriptSummaryFile.Write("<hr>")
+		scriptSummaryFile.WriteBreak()
+		for category in KCategoryHtmlDisplayOrder:
+			if scanner.iCategoriedScripts.iScripts.has_key(category):
+				scriptSummaryFile.WriteElement("h3", "Category: "+category)
+				scriptSummaryFile.Write("<table border=\"1\" width=\"100%\">")
+				scriptSummaryFile.Write("<tr bgcolor=\"#0099ff\">")
+				scriptSummaryFile.WriteElement("th width=\"75%\"", "Problem")
+				scriptSummaryFile.WriteElement("th", "Items Found")
+				scriptSummaryFile.WriteElement("th", "Severity")
+				scriptSummaryFile.Write("</tr>")
+				categoryErrorCount = 0
+				for script in scanner.iCategoriedScripts.iScripts[category]:
+					outputPath = os.path.normpath(os.path.join(aOutputDirectory, "byProblem"))
+					outputPath = os.path.normpath(os.path.join(outputPath, script.iScriptName+"Summary.html"))
+					errorCount = self.WriteScriptReport(aHtmlRenderer, outputPath, script)
+					categoryErrorCount = categoryErrorCount + errorCount
+					scriptSummaryFile.Write("<tr>")
+					scriptSummaryFile.Write("<td>")
+					relOutputPath = os.path.normpath(os.path.join("byProblem", script.iScriptName+"Summary.html"))
+					scriptSummaryFile.WriteLink(relOutputPath, script.iTitle)
+					scriptSummaryFile.Write("</td>")
+					scriptSummaryFile.Write("<td>")
+					scriptSummaryFile.WriteElement("center", str(errorCount))
+					scriptSummaryFile.Write("</td>")
+					scriptSummaryFile.Write("<td>")
+					scriptSummaryFile.WriteElement("center", KSeverityHTMLMap[script.iSeverity])
+					scriptSummaryFile.Write("</td>")
+					scriptSummaryFile.Write("</tr>")
+				totalErrorCount = totalErrorCount + categoryErrorCount
+				scriptSummaryFile.Write("<tr>")
+				scriptSummaryFile.Write("<td>")
+				scriptSummaryFile.WriteElement("b", "Category Total")
+				scriptSummaryFile.Write("</td>")
+				scriptSummaryFile.Write("<td>")
+				scriptSummaryFile.WriteElement("center", "<b>"+str(categoryErrorCount)+"</b>")
+				scriptSummaryFile.Write("</td>")
+				scriptSummaryFile.Write("</tr>")
+				scriptSummaryFile.Write("</table>")
+
+		scriptSummaryFile.WriteBreak()
+		scriptSummaryFile.WriteElement("b", "Total: " + str(totalErrorCount))
+		scriptSummaryFile.WriteBreak()
+
+		scriptSummaryFile.Close()
+
+	def WriteScriptReport(self, aHtmlRenderer, aOutputPath, aScript):
+		totalErrorCount = 0
+		scriptReportFile = CHtmlOutputFile(aOutputPath)
+		scriptReportFile.Write("<font face=verdana>")
+		scriptReportFile.WriteElement("h2", "Problem Report")
+		scriptReportFile.WriteElement("h3", "Problem: " + aScript.iTitle)
+		scriptReportFile.Write(aScript.iDescription)
+		scriptReportFile.WriteBreak()
+		scriptReportFile.WriteBreak()
+
+		found = False
+		for component in scanner.iComponentManager.iCompletedComponents:
+			errorCount = scanner.iComponentManager.ScriptComponentErrorCount(component.iFullPath, aScript.iScriptName)
+			if errorCount > 0:
+				found = True
+				break
+
+		if found:
+			scriptReportFile.Write("<table border=\"1\" width=\"100%\">")
+			scriptReportFile.Write("<tr bgcolor=\"#0099ff\">")
+			scriptReportFile.WriteElement("th width=\"80%\"", "Component")
+			scriptReportFile.WriteElement("th", "Items Found")
+			scriptReportFile.Write("</tr>")
+			for component in scanner.iComponentManager.iCompletedComponents:
+				errorCount = scanner.iComponentManager.ScriptComponentErrorCount(component.iFullPath, aScript.iScriptName)
+				if errorCount > 0:
+					scriptReportFile.Write("<tr>")
+					scriptReportFile.Write("<td>")
+					scriptComponentPath = aHtmlRenderer.ScriptComponentPath(component.iFullPath, aScript.iScriptName, "..")
+					scriptReportFile.WriteLink(scriptComponentPath, component.iFullPath)
+					scriptReportFile.Write("</td>")
+					scriptReportFile.Write("<td>")
+					scriptReportFile.WriteElement("center", str(errorCount))
+					scriptReportFile.Write("</td>")
+					scriptReportFile.Write("</tr>")
+					totalErrorCount = totalErrorCount + errorCount
+			scriptReportFile.Write("<tr>")
+			scriptReportFile.Write("<td>")
+			scriptReportFile.WriteElement("b", "Total")
+			scriptReportFile.Write("</td>")
+			scriptReportFile.Write("<td><center>")
+			scriptReportFile.WriteElement("b", str(totalErrorCount))
+			scriptReportFile.Write("</center></td>")
+			scriptReportFile.Write("</tr>")
+			scriptReportFile.Write("</table>")
+		else:
+			scriptReportFile.WriteBreak()
+			scriptReportFile.WriteElement("i", "There are no items of this problem type to report.")
+			scriptReportFile.WriteBreak()
+
+		scriptReportFile.Close()
+		return totalErrorCount
+
+
+class CHtmlScriptComponentFile:
+
+	# #######################################################
+	# CHtmlScriptComponentFile
+	# Encapsulates access to the HTML output files with the greatest amount of detail.
+	# Each of these files is for a specific problem (script) and for a specific component.
+
+	# The file handle is closed between each call to avoid exhausting the system
+	# limit for open file handles. Many of these files may be open at one time,
+	# and the number of open files is dependent on both the directory structure
+	# being traversed and the number of types of problems found.
+
+	def __init__(self, aLxrUrl, aLxrVersion):
+		self.iLxrUrl = aLxrUrl
+		self.iLxrVersion = aLxrVersion
+		
+	def BeginOutputFile(self, aOutputPath, aScript, aComponentName):
+		if not os.path.isdir(os.path.dirname(aOutputPath)):
+			os.makedirs(os.path.dirname(aOutputPath))
+		outputFile = file(aOutputPath, "w")
+		self.iScriptComponentFile = CHtmlOutputFileBase()
+		self.iScriptComponentFile.Write(outputFile, "<font face=verdana>")
+		self.iScriptComponentFile.WriteHeader(outputFile)
+		self.iScriptComponentFile.WriteElement(outputFile, "h2", "Detailed Problem Report")
+		self.iScriptComponentFile.WriteElement(outputFile, "h3", "Component: "+aComponentName)
+		self.iScriptComponentFile.WriteElement(outputFile, "h3", "Problem: "+aScript.iTitle)
+		self.iScriptComponentFile.Write(outputFile, aScript.iDescription)
+		self.iScriptComponentFile.WriteBreak(outputFile)
+		self.iScriptComponentFile.Write(outputFile, "<hr>")
+		self.iScriptComponentFile.WriteBreak(outputFile)
+		outputFile.close()
+
+	def ReportError(self, aOutputPath, aLineContext):
+		outputFile = file(aOutputPath, "a")
+		if self.iLxrUrl == None:
+			# Mozilla Firefox cannot open links to local files, 
+			# so it is necessary to convert local file path
+			filePath = "file:///" + aLineContext.iFileName
+		else:
+			# generate link to LXR server instead of local file system
+			filePath = self.iLxrUrl + aLineContext.iFileName[len(scanner.iComponentManager.iRootPath):]
+			if self.iLxrVersion <> None:
+				filePath = filePath + "?v="+self.iLxrVersion
+			filePath = filePath + '#%03d'%aLineContext.iLineNumber
+		self.iScriptComponentFile.WriteLink(outputFile, filePath, self.TrimFileName(aLineContext))
+		self.iScriptComponentFile.Write(outputFile, "(" + str(aLineContext.iLineNumber) + ") ")
+		self.iScriptComponentFile.Write(outputFile, aLineContext.iClassName+"::"+aLineContext.iMethodName+" ")
+		self.iScriptComponentFile.Write(outputFile, "<code><font color=red>"+self.CleanUpText(aLineContext.iLineText))
+		self.iScriptComponentFile.Write(outputFile, "</font></code>")
+		self.iScriptComponentFile.WriteBreak(outputFile)
+		if len(scanner.iRendererManager.iAnnotation)>0:
+			self.iScriptComponentFile.Write(outputFile, scanner.iRendererManager.iAnnotation)
+			self.iScriptComponentFile.WriteBreak(outputFile)
+			scanner.iRendererManager.iAnnotation = ""
+		outputFile.close()
+
+	def EndOutputFile(self, aOutputPath):
+		outputFile = file(aOutputPath, "a")
+		self.iScriptComponentFile.WriteFooter(outputFile)
+		outputFile.close()
+
+	def TrimFileName(self, aLineContext):
+		filename = aLineContext.iFileName
+		componentNameLen = len(aLineContext.iComponentName)
+		if len(filename) > componentNameLen:
+			if filename[0:componentNameLen] == aLineContext.iComponentName:
+				filename = filename[componentNameLen:]
+				if filename[0] == os.path.sep:
+					filename = filename[1:]
+		return filename
+
+	def CleanUpText(self, aLineText):
+		# check for sub-strings that look like HTML tags and preform clean up if needed
+		reTag = re.compile(r"""(<.+>)""", re.VERBOSE)
+		foundTag = reTag.search(aLineText)
+		if foundTag:
+			aNewLineText = aLineText.replace("<", "&lt;")
+			aNewLineText = aNewLineText.replace(">", "&gt;")
+			return aNewLineText
+		else:
+			return aLineText		
+
+			
+def ComponentCompare(a, b):
+	return cmp(os.path.normcase(a.iFullPath), os.path.normcase(b.iFullPath))
+
+
+class CHtmlRenderer(CRendererBase):
+
+	# #######################################################
+	# CHtmlRenderer - a renderer for HTML output
+
+	# I have nothing to offer but blood, toil, tears and sweat. 
+	#  - Winston Churchill, 1940 
+
+	def __init__(self, aRendererManager, aOutputDirectory, aLxrUrl, aLxrVersion):
+		self.RegisterSelf("html", "HTML renderer", aRendererManager)
+		self.iOutputDirectory = aOutputDirectory
+		if os.path.isdir(self.iOutputDirectory) != True :
+			os.makedirs(self.iOutputDirectory)
+		self.iScriptComponentFile = CHtmlScriptComponentFile(aLxrUrl, aLxrVersion)
+		self.iScriptComponentFilePaths = {}
+		print
+		print KVersion
+		print KCopyrightLine1
+		print KCopyrightLine2
+
+	def BeginFile(self, aFilename):
+		self.iFilename = aFilename
+		scanner.ReportAction("Scanning file " + aFilename)
+
+	def ReportError(self, aLineContext, aScript):
+		outputPath = self.ScriptComponentPath(aLineContext.iComponentName, aScript.iScriptName)
+		if not os.path.isfile(outputPath):
+			self.iScriptComponentFilePaths[aLineContext.iComponentName].append(outputPath)
+			self.iScriptComponentFile.BeginOutputFile(outputPath, aScript, aLineContext.iComponentName)
+		self.iScriptComponentFile.ReportError(outputPath, aLineContext)
+
+	def EndFile(self):
+		return
+
+	def BeginComponent(self, aComponent):
+		self.iScriptComponentFilePaths[aComponent.iFullPath] = []
+
+	def EndComponent(self, aComponent):
+		if self.iScriptComponentFilePaths.has_key(aComponent.iFullPath):
+			for outputPath in self.iScriptComponentFilePaths[aComponent.iFullPath]:
+				self.iScriptComponentFile.EndOutputFile(outputPath)
+			del self.iScriptComponentFilePaths[aComponent.iFullPath]
+		relativeComponentName = scanner.iComponentManager.RelativeComponentName(aComponent.iFullPath)
+		if len(relativeComponentName) < 1:	# root component - final component
+			scanner.iEndTime = datetime.datetime.now().ctime()
+			scanner.iComponentManager.iCompletedComponents.sort(ComponentCompare)
+			scriptSummaryFiles = CHtmlScriptSummaryFiles()
+			scriptSummaryFiles.CreateSummaries(self, self.iOutputDirectory)
+			componentSummaryFiles = CHtmlComponentSummaryFiles()
+			componentSummaryFiles.CreateSummaries(self, self.iOutputDirectory)
+
+	def ScriptComponentPath(self, aComponentName, aScriptName, aRel=None):
+		componentName = scanner.iComponentManager.ComponentName(aComponentName)
+		if aRel==None:
+			aRel = self.iOutputDirectory
+		outputPath = os.path.normpath(os.path.join(aRel, "byComponent"))
+		outputPath = os.path.normpath(os.path.join(outputPath, componentName))
+		outputPath = os.path.normpath(os.path.join(outputPath, aScriptName+".html"))
+		return outputPath
+
+
+class CRendererManager:
+
+	# #######################################################
+	# CRendererManager
+	# this class handles all the renderers 
+
+	def __init__(self):
+		# declare associative list of renderers: iRendererList[name]=renderer
+		self.iRendererList = {}
+		self.iAnnotation = ""
+
+	def AddRenderer(self, aRenderer):
+		self.iRendererList[aRenderer.iName.lower()] = aRenderer
+
+	def PrintListOfRenderers(self):
+		print("Renderers:")        
+		for name, renderer in self.iRendererList.items():
+			print("\t" + name + "\t" + renderer.iDescription)
+
+		print("")
+
+	def BeginFile(self, aFilename):
+		for name, renderer in self.iRendererList.items():
+			renderer.BeginFile(aFilename)
+
+	def ReportError(self, aLineContext, aScript):
+		for name, renderer in self.iRendererList.items():
+			renderer.ReportError(aLineContext, aScript)
+
+	def ReportAnnotation(self, aAnnotation):
+		self.iAnnotation = aAnnotation
+
+	def EndFile(self):
+		for name, renderer in self.iRendererList.items():
+			renderer.EndFile()
+
+	def BeginComponent(self, aComponent):
+		for name, renderer in self.iRendererList.items():
+			renderer.BeginComponent(aComponent)
+
+	def EndComponent(self, aComponent):
+		for name, renderer in self.iRendererList.items():
+			renderer.EndComponent(aComponent)
+
+
+class CComponent:
+
+	# #######################################################
+	# CComponent - a single component, identified by the
+	# directory path to its source code
+
+	def __init__(self, aPath):
+		self.iFullPath = aPath
+		self.iScriptErrorCounts = {}
+		self.iHasGroupDir = False
+		self.iNumberOfLinesScanned = 0
+
+	def appendComponent(self, aComponent):
+		for scriptName in aComponent.iScriptErrorCounts.keys():
+			if self.iScriptErrorCounts.has_key(scriptName):
+				self.iScriptErrorCounts[scriptName] += aComponent.iScriptErrorCounts[scriptName]
+			else:
+				self.iScriptErrorCounts[scriptName] = aComponent.iScriptErrorCounts[scriptName]
+		self.iNumberOfLinesScanned += aComponent.iNumberOfLinesScanned
+		return
+
+
+class CComponentManager:
+
+	# #######################################################
+	# CComponentManager - controls access to components
+
+	def __init__(self):
+		self.iComponentStack = []
+		self.iCompletedComponents = []
+		self.iRootComponent = CComponent("")
+		self.iUseFullComponentPath = False
+
+	def SetRoot(self, aRootPath):
+		# set the list of root directories - used to left-trim component names
+		self.iRootPath = self.SanitizePath(aRootPath)
+
+	def BeginDirectory(self, aPath):
+		aPath = self.SanitizePath(aPath)
+		if os.path.isdir(aPath):
+			newComponent = CComponent(aPath)
+			contents = os.listdir(aPath)
+			for entry in contents:
+				if (entry.upper() == "GROUP"):
+					entryPath = os.path.normpath(os.path.join(aPath, entry))
+					if os.path.isdir(entryPath):
+						newComponent.iHasGroupDir = True
+						break
+			if len(self.iComponentStack) > 0:
+				topComponent = self.iComponentStack[len(self.iComponentStack)-1]
+				if (newComponent.iHasGroupDir or (not topComponent.iHasGroupDir)):
+					self.BeginComponent(newComponent)
+				else:
+					scanner.iLog.Write(aPath + " taken as part of " + topComponent.iFullPath)
+			else:
+				self.BeginComponent(newComponent)
+		else:
+			scanner.iLog.Write("ERROR: CComponentManager::BeginDirectory: bad path "+aPath)
+		return aPath
+
+	def EndDirectory(self, aPath, numberOfLinesScanned):
+		aPath = self.SanitizePath(aPath)
+		if len(self.iComponentStack) > 0:
+			topComponent = self.iComponentStack[len(self.iComponentStack)-1]
+			topComponent.iNumberOfLinesScanned += numberOfLinesScanned
+			if (topComponent.iFullPath == aPath):
+				self.EndComponent()
+
+	def ReportError(self, aLineContext, aScript):
+		scanner.iRendererManager.ReportError(aLineContext, aScript)
+		for component in self.iComponentStack:
+			if component.iFullPath == aLineContext.iComponentName:
+				if component.iScriptErrorCounts.has_key(aScript.iScriptName):
+					component.iScriptErrorCounts[aScript.iScriptName] = component.iScriptErrorCounts[aScript.iScriptName] + 1
+				else:
+					component.iScriptErrorCounts[aScript.iScriptName] = 1
+
+	def ScriptComponentErrorCount(self, aComponentName, aScriptName):
+		for component in self.iCompletedComponents:
+			if component.iFullPath == aComponentName:
+				if component.iScriptErrorCounts.has_key(aScriptName):
+					return component.iScriptErrorCounts[aScriptName]
+				else:
+					return 0
+		return 0
+
+	def BeginComponent(self, aComponent):
+		scanner.iRendererManager.BeginComponent(aComponent)
+		scanner.ReportAction("Begin component: " + aComponent.iFullPath)
+		self.iComponentStack.append(aComponent)
+
+	def EndComponent(self):
+		previousComponent = self.iComponentStack.pop()
+		matchingComponent = self.MatchingComponent(previousComponent)
+		if (matchingComponent <> None):
+			matchingComponent.appendComponent(previousComponent)
+		else:
+			self.iCompletedComponents.append(previousComponent)
+		scanner.ReportAction("End component: " + previousComponent.iFullPath)
+		scanner.iRendererManager.EndComponent(previousComponent)
+
+	def MatchingComponent(self, aComponent):
+		for component in self.iCompletedComponents:
+			if (ComponentCompare(component, aComponent) == 0):
+				return component
+		return None
+
+	def CurrentComponentName(self):
+		if len(self.iComponentStack) < 1:
+			return None
+		return self.iComponentStack[len(self.iComponentStack)-1].iFullPath
+
+	def SanitizePath(self, aPath):
+		# Translate an unspecified or relative pathname into an absolute pathname
+		if len(aPath) < 1:
+			aPath = "."
+		aPath = os.path.normpath(aPath)
+		# translate "." and ".." into absolute paths
+		aPath = os.path.abspath(aPath)
+		return aPath
+
+	def ComponentName(self, aFullComponentName):
+		if (self.iUseFullComponentPath):
+			(unused, componentName) = os.path.splitdrive(aFullComponentName)
+			if len(componentName) > 0:
+				if componentName[0] == os.path.sep and len(componentName) > 1:
+					componentName = componentName[1:]
+			return componentName
+		else:
+			return self.RelativeComponentName(aFullComponentName)
+
+	def RelativeComponentName(self, aFullComponentName):
+		# Remove the root path from the specified component name
+		rootLen = len(self.iRootPath)
+		if aFullComponentName[0:rootLen] == self.iRootPath:
+			relativeComponentName = aFullComponentName[rootLen:]
+		else:
+			# this case is unexpected...but we'll try to make the best of it
+			(unused, relativeComponentName) = os.path.splitdrive(aFullComponentName)
+		# trim leading path separator, if present
+		if len(relativeComponentName) > 0:
+			if relativeComponentName[0] == os.path.sep and len(relativeComponentName) > 1:
+				relativeComponentName = relativeComponentName[1:]
+		return relativeComponentName
+
+
+class CLineContext:
+
+	# #######################################################
+	# CLineContext
+	# A description of the line of source code currently being scanned
+
+	iComponentName = ""
+	iFileName = ""
+	iLineNumber = 0
+	iClassName = ""
+	iMethodName = ""
+	iLineText = ""
+
+
+class CCodeScanner:
+
+	# #######################################################
+	# CCodeScanner - main application class
+
+	def __init__(self):
+		self.iCategoriedScripts = CCategorisedScripts()
+		self.iRendererManager   = CRendererManager()
+		self.iComponentManager = CComponentManager()
+		self.iLineContext = CLineContext()
+		self.iDomConfig = None
+		self.iVerbose = False
+		self.iLog = None
+		self.iSource = None
+		self.iEncodedFileList = None
+		self.iOutputDirectory = None
+		self.iStartTimeObj = None
+		self.iStartTime = None
+		self.iEndTime = None
+		self.iLxrUrl = None
+		self.iLxrVersion = None
+		self.iConfigFilename = ""
+		self.iInputFilenames = ""
+		self.iLogFilename = ""
+		self.iOutputFormat = ""
+		self.iTimeStampedOutput = ""
+		self.iReMethod = re.compile(r"""
+			((?P<class>\w+)::~?)?
+			(?P<method>[A-Za-z0-9<>=!*\-+/]+)
+			[\s\n]*
+			\(
+			[^;]*
+			$
+			""", re.VERBOSE)
+
+	def ReportError(self, aErrorMsg):
+		self.iLog.Write(aErrorMsg)
+		print aErrorMsg
+
+	def ReportAction(self, aAction):
+		self.iLog.Write(aAction)
+		if self.iVerbose:
+			print aAction
+
+	def ReportInfo(self, aInfoMsg):
+		self.iLog.Write(aInfoMsg)
+		print aInfoMsg
+
+	def CleanOutputDirectory(self):
+		self.iLog.Write("Deleting existing contents of output directory " + self.iOutputDirectory)
+		for root, dirs, files in os.walk(self.iOutputDirectory, topdown = False):
+			for name in files:
+				os.remove(os.path.join(root, name))
+			for name in dirs:
+				os.rmdir(os.path.join(root, name))
+
+	def CheckSourceIncluded(self, aSourceFileName):
+		if (self.iDomConfig <> None):
+			for sourceNode in self.iDomConfig.getElementsByTagName("sources"):
+				for excludeSourceNode in sourceNode.getElementsByTagName("exclude"):
+					reExcludeSourceStr = excludeSourceNode.firstChild.nodeValue
+					reExcludeSource = re.compile(reExcludeSourceStr, re.IGNORECASE)
+					if reExcludeSource.search(aSourceFileName):
+						self.ReportInfo("Note: excluding " + aSourceFileName + " : " + reExcludeSourceStr)
+						return False
+		return True
+
+	def CheckScriptEnabled(self, aScript):
+		if (self.iDomConfig <> None):
+			for scriptsNode in self.iDomConfig.getElementsByTagName("scripts"):
+				for scriptNode in scriptsNode.getElementsByTagName(aScript.iScriptName):
+					enabledAttr = scriptNode.getAttribute("enable")
+					if (enabledAttr.lower() == "false"):
+						return False
+			for severitiesNode in self.iDomConfig.getElementsByTagName("severities"):
+				for severityNode in severitiesNode.getElementsByTagName(KSeverityConfigMap[aScript.iSeverity]):
+					enabledAttr = severityNode.getAttribute("enable")
+					if (enabledAttr.lower() == "false"):
+						return False
+			for categoriesNode in self.iDomConfig.getElementsByTagName("categories"):
+				for categoryNode in categoriesNode.getElementsByTagName(KCategoryConfigMap[aScript.iCategory]):
+					enabledAttr = categoryNode.getAttribute("enable")
+					if (enabledAttr.lower() == "false"):
+						return False
+		return True
+
+	def UpdateScriptCategory(self, aScript):
+		if (self.iDomConfig <> None):
+			for scriptsNode in self.iDomConfig.getElementsByTagName("scripts"):
+				for scriptNode in scriptsNode.getElementsByTagName(aScript.iScriptName):
+					if scriptNode.hasAttribute("category"):
+						newCategory = scriptNode.getAttribute("category").lower()
+						if (newCategory <> KCategoryConfigMap[aScript.iCategory]):
+							for name, value in KCategoryConfigMap.items():
+								if (newCategory == value):
+									return name
+		# no update needed, return original category
+		return aScript.iCategory
+
+	def UpdateScriptSeverity(self, aScript):
+		if (self.iDomConfig <> None):
+			for scriptsNode in self.iDomConfig.getElementsByTagName("scripts"):
+				for scriptNode in scriptsNode.getElementsByTagName(aScript.iScriptName):
+					if scriptNode.hasAttribute("severity"):
+						newSeverity = scriptNode.getAttribute("severity").lower()
+						if (newSeverity <> KSeverityConfigMap[aScript.iSeverity]):
+							for name, value in KSeverityConfigMap.items():
+								if (newSeverity == value):
+									return name
+		# no update needed, return original severity
+		return aScript.iSeverity
+
+	def ScanFile(self, aSourceFile):
+		self.iLineContext.iFileName = aSourceFile
+		self.iLineContext.iLineNumber = 0
+		self.iLineContext.iClassName = ""
+		self.iLineContext.iMethodName = ""
+		self.iLineContext.iComponentName = self.iComponentManager.CurrentComponentName()
+
+		self.iRendererManager.BeginFile(aSourceFile)
+
+		# note source file extension - used for filtering later on
+		(unused, sourceFileExt) = os.path.splitext(aSourceFile)
+		if len(sourceFileExt) > 0 and sourceFileExt[0] == '.':
+			sourceFileExt = sourceFileExt[1:]
+
+		# open, read, and preparse source file
+		inputFileHandle = file(aSourceFile, "r")
+		inputFileLines = inputFileHandle.readlines()
+		inputFileHandle.close()
+		
+		(noQuoteFileLines, noCommentFileLines, noCommentOrQuoteFileLines, csCommands) = self.PreParseSourceFile(inputFileLines)
+
+		# bundle all the filtered versions of the file contents into
+		# a hash to re-factor code
+		fileContentsToTest = { KIgnoreNothing           : inputFileLines,
+							   KIgnoreComments          : noCommentFileLines,
+							   KIgnoreQuotes            : noQuoteFileLines,
+							   KIgnoreCommentsAndQuotes : noCommentOrQuoteFileLines
+							   }
+
+		# now apply test scripts to source file
+		iBraceCount = 0
+		iBraceCountList = []
+		newCurrentClassName = ""
+		newCurrentMethodName = ""
+		self.iCurrentClassName = ""
+		self.iCurrentMethodName = ""
+		self.iCurrentMethodStart = -1
+
+		totalNumberOfLines = len(inputFileLines)
+		reConstant = re.compile(r"""
+			^\s*
+			(static\s+)?
+			const
+			\s+
+			\w+		# type
+			\s*
+			[\*&]?	# reference or pointer
+			\s*
+			\w+		# name
+			\s*
+			(=|\()
+			""", re.VERBOSE)
+		reInheritance = re.compile("[\s:]*(public|protected|private)\s*([\w:]+)")
+		rePreprocessorIf = re.compile("^\s*\#(el)*if(.*)")
+		rePreprocessorElse = re.compile("^\s*\#else")
+		rePreprocessorEnd = re.compile("^\s*\#endif")
+		reTypedef = re.compile("^\s*typedef")
+		i = 0
+		while (i < totalNumberOfLines):
+			# for extra open braces in #if blocks
+			if (rePreprocessorIf.search(noCommentOrQuoteFileLines[i])):
+				iBraceCountList.append(iBraceCount)
+			if (rePreprocessorElse.search(noCommentOrQuoteFileLines[i])):
+				if (len(iBraceCountList) > 0):
+					iBraceCount = iBraceCountList.pop()
+			if (rePreprocessorEnd.search(noCommentOrQuoteFileLines[i])):
+				if (len(iBraceCountList) > 0):
+					iBraceCountList.pop()
+
+			if (newCurrentMethodName == ""):
+				methodString = noCommentOrQuoteFileLines[i]
+				currentLine = i
+				m = self.iReMethod.search(methodString)
+				if not m and (i + 1 < totalNumberOfLines):
+					currentLine = i + 1
+					methodString += noCommentOrQuoteFileLines[currentLine]
+					m = self.iReMethod.search(methodString)
+
+				if m and (iBraceCount == 0) and (methodString.find("#") == -1) and (methodString.find("_LIT") == -1):	# must be at root level and not a preprocessor directive or a _LIT
+					if not reTypedef.match(methodString) and not reConstant.match(methodString):  # must not be typedef or constant declaration 
+						# check for cases where macros are used to declare a class
+						# by searching for the inheritance part
+						# eg. NONSHARABLE_CLASS(CMyClass) : public CBase
+						isClass = reInheritance.search(methodString)
+						if not isClass and (currentLine + 1 < totalNumberOfLines):
+							methodString += noCommentOrQuoteFileLines[currentLine + 1]
+							isClass = reInheritance.search(methodString)
+						if not isClass:
+							newCurrentMethodName = m.group('method')
+							if m.group('class'):
+								newCurrentClassName = m.group('class')
+							else:
+								newCurrentClassName = ""
+
+			iBraceCount += noCommentOrQuoteFileLines[i].count("{")
+			if (iBraceCount > 0) and (newCurrentMethodName <> ""):
+				self.iCurrentClassName = newCurrentClassName
+				self.iCurrentMethodName = newCurrentMethodName
+				self.iCurrentMethodStart = i
+				newCurrentClassName = ""
+				newCurrentMethodName = ""
+
+			self.iLineContext.iLineNumber = i+1
+			self.iLineContext.iClassName = self.iCurrentClassName
+			self.iLineContext.iMethodName = self.iCurrentMethodName
+
+			# perform all test scripts onto source file									   
+			for script in self.iCategoriedScripts.AllScripts():
+				if (script.iFileExts.count(sourceFileExt) > 0
+				    and fileContentsToTest[script.iIgnore][i] != "\n"
+					and	script.iCompare(fileContentsToTest[script.iIgnore], i, script.iReMatch, aSourceFile)):
+					# skip any script that has been disabled via CodeScanner command(s) in sources
+					if script.iScriptName.lower() in csCommands[i].lower():
+						continue
+					self.iLineContext.iLineText = fileContentsToTest[script.iIgnore][i]
+					self.iComponentManager.ReportError(self.iLineContext, script)
+
+			iBraceCount -= noCommentOrQuoteFileLines[i].count("}")
+			if (iBraceCount < 0):	# for extra close braces in #if blocks
+				iBraceCount = 0
+
+			if (iBraceCount == 0):
+				self.iCurrentClassName = ""
+				self.iCurrentMethodName = ""
+				self.iCurrentMethodStart = -1
+
+			i = i + 1
+
+		self.iRendererManager.EndFile()
+		return totalNumberOfLines
+
+	def TraverseDirectory(self, aDirectory):
+		# skip folders marked to be excluded in configuration file
+		aPath = self.iComponentManager.SanitizePath(aDirectory)
+		if (not self.CheckSourceIncluded(aPath)) or (not self.CheckSourceIncluded(aPath + os.path.sep)):
+			return
+		aDirectory = self.iComponentManager.BeginDirectory(aDirectory)
+		contents = os.listdir(aDirectory)
+		numberOfLinesScanned = 0
+		for entry in contents:
+			entryPath = os.path.normpath(os.path.join(aDirectory, entry))
+			if os.path.isdir(entryPath):
+				self.TraverseDirectory(entryPath)
+			else:
+				if self.CheckSourceIncluded(entryPath):
+					numberOfLinesScanned += self.ScanFile(entryPath)
+		self.iComponentManager.EndDirectory(aDirectory, numberOfLinesScanned)
+
+	def AddScript(self, aScript):
+		enabled = self.CheckScriptEnabled(script)
+		if enabled:
+			aScript.iCategory = self.UpdateScriptCategory(aScript)
+			aScript.iSeverity = self.UpdateScriptSeverity(aScript)
+			self.iCategoriedScripts.AddScript(aScript)
+		else:
+			self.ReportInfo("Note: script '" + aScript.iScriptName + "' DISABLED")
+
+	def AddCustomScript(self, aScript):
+		self.ReportInfo("Note: custom rule '" + aScript.iScriptName + "' ADDED")
+		self.iCategoriedScripts.AddScript(aScript)
+
+	def PreParseSourceFile(self, aLines):
+		# it provides 3 versions of input:
+		# 	1. without quotes
+		# 	2. without comments
+		# 	3. without quotes and without comments
+		
+		inCommentBlock = 0
+		noQuoteLines = []
+		noCommentLines = []
+		noCommentOrQuoteLines = []
+		csCommands = []
+		reCSCommand = re.compile("codescanner((::\w+)+)") # CodeScanner command(s) in comments
+
+		for line in aLines:
+			noQuoteLine = ""
+			noCommentLine = ""
+			noCommentOrQuoteLine = ""
+			csCommand = "\n"
+
+			i = 0
+			startQuote = 0
+			b = 0
+			escCount = 0
+
+			while i < len(line):
+				# skip quotes
+				if not inCommentBlock and ((line[i] == "\"") or (line[i] == "\'")):
+					startQuote = i
+					i += 1
+					while (i < len(line)):
+						endIndex = line[i:].find(line[startQuote])
+						if (endIndex <> -1):
+							b = i + endIndex - 1
+							escCount = 0
+							while (line[b] == "\\"):
+								escCount += 1
+								b -= 1
+
+							i += endIndex + 1
+							if (escCount % 2 == 0):
+								noQuoteLine += "\"\""
+								noCommentOrQuoteLine += "\"\""
+								noCommentLine += line[startQuote:i]
+								break
+						else:
+							#	print "Unterminated quote : " + line
+							break
+					continue	
+				
+				# parse comments
+				if not inCommentBlock:
+					if (line[i] == "/"):
+						if (i < (len(line)-1)):
+							if (line[i + 1] == "/"):
+								noCommentLine += "\n"
+								noCommentOrQuoteLine += "\n"
+								noQuoteLine += line[i:]
+								# look for CodeScanner command(s) in comments
+								m = reCSCommand.search(line[i:])
+								if m:
+									csCommand = m.group(1)
+								break
+							elif (line[i + 1] == "*"):
+								inCommentBlock = 1
+								i += 2
+								noQuoteLine += "/*"
+								continue
+
+					noCommentLine += line[i]
+					noCommentOrQuoteLine += line[i]
+					noQuoteLine += line[i]
+				else:
+					# look for CodeScanner command(s) in comments
+					m = reCSCommand.search(line[i:])
+					if m:
+						csCommand = m.group(1)
+					endIndex = line[i:].find("*/")
+					if (endIndex <> -1):
+						inCommentBlock = 0
+						noQuoteLine += line[i:i + endIndex + 2]
+						i += endIndex + 2
+						continue
+					else:
+						noCommentLine += "\n"
+						noCommentOrQuoteLine += "\n"
+						noQuoteLine = line[i:]
+						break
+				
+				i += 1
+
+			noCommentLines.append(noCommentLine)
+			noCommentOrQuoteLines.append(noCommentOrQuoteLine)
+			noQuoteLines.append(noQuoteLine)
+			csCommands.append(csCommand)
+
+		return [noQuoteLines, noCommentLines, noCommentOrQuoteLines, csCommands]
+
+	def ReadConfigFile(self):
+		if self.iConfigFilename <> "":
+			if (os.path.isfile(self.iConfigFilename)):
+				self.iDomConfig = xml.dom.minidom.parse(self.iConfigFilename)
+				if self.iVerbose:
+					print "Note: using configuration file " + self.iConfigFilename
+			else:
+				self.ReportInfo("Unable to open specified configuration file: " + self.iConfigFilename)
+				self.iLog.Close()
+				sys.exit(2)
+
+	def ReadArgumentsFromConfigFile(self):
+		if (self.iDomConfig <> None):
+			for argumentsNode in self.iDomConfig.getElementsByTagName("arguments"):
+				# read input file names
+				for inputFileNode in argumentsNode.getElementsByTagName("input"):
+					self.iInputFilenames += inputFileNode.firstChild.nodeValue + "::"
+				# read output format
+				for outputFormatNode in argumentsNode.getElementsByTagName("outputformat"):
+					self.iOutputFormat += outputFormatNode.firstChild.nodeValue
+				# read lxr URL
+				for lxrURLNode in argumentsNode.getElementsByTagName("lxr"):
+					self.iLxrUrl = lxrURLNode.firstChild.nodeValue
+				# read lxr version
+				for lxrVersionNode in argumentsNode.getElementsByTagName("lxrversion"):
+					self.iLxrVersion = lxrVersionNode.firstChild.nodeValue
+				# read time stamped output option
+				for timeStampedOutputNode in argumentsNode.getElementsByTagName("timestampedoutput"):
+					self.iTimeStampedOutput = timeStampedOutputNode.firstChild.nodeValue
+
+	def ReadCustomRulesFromConfigFile(self):
+		if (self.iDomConfig <> None):
+			for customRulesNode in self.iDomConfig.getElementsByTagName("customrules"):
+				for customRuleNode in customRulesNode.getElementsByTagName("customrule"):
+					ignoreComments = True
+
+					# read the name of the rule
+					ruleName = ""
+					for ruleNameNode in customRuleNode.getElementsByTagName("name"):
+						if (ruleNameNode == None) or (ruleNameNode.firstChild == None) or (ruleNameNode.firstChild.nodeValue == None):
+							continue
+						else:
+							ruleName = ruleNameNode.firstChild.nodeValue
+					if len(ruleName) == 0:
+						self.ReportError("Missing custom rule name in configuration file: " + self.iConfigFilename)
+						continue
+
+					# read the keywords associated with the rule
+					keywordList = []
+					badKeywordElement = False
+					for keywordNode in customRuleNode.getElementsByTagName("keyword"):
+						# read keyword content
+						if (keywordNode == None) or (keywordNode.firstChild == None) or (keywordNode.firstChild.nodeValue == None):
+							badKeywordElement = True
+							continue
+						newKeyword = CCustomRuleKeyword()
+						newKeyword.iContent = keywordNode.firstChild.nodeValue
+
+						# read keyword type
+						if not keywordNode.hasAttribute("type"):
+							badKeywordElement = True
+							continue
+						type = keywordNode.getAttribute("type").lower()
+						if type in KCustomRuleKeywordMap.values():
+							if type == KKeywordComment:
+								ignoreComments = False
+						else:
+							type = KCustomRuleKeywordMap[KKeywordUnknown]
+						newKeyword.iType = type
+						keywordList.append(newKeyword)
+					if (len(keywordList) == 0) or (badKeywordElement == True):
+						self.ReportBadCustomRuleElement(ruleName, "keyword")
+						continue
+
+					# read the file types associated with the rule
+					fileTypeList = []
+					badFileTypeElement = False
+					for fileTypeNode in customRuleNode.getElementsByTagName("filetype"):
+						if (fileTypeNode == None) or (fileTypeNode.firstChild == None) or (fileTypeNode.firstChild.nodeValue == None):
+							badFileTypeElement = True
+							continue
+						newFileType = fileTypeNode.firstChild.nodeValue
+						fileTypeList.append(newFileType.lower())
+					if (len(fileTypeList) == 0) or (badFileTypeElement == True):
+						self.ReportBadCustomRuleElement(ruleName, "file type")
+						continue
+
+					# read the severity level of the rule
+					severity = KSeverityLow
+					for severityNode in customRuleNode.getElementsByTagName("severity"):
+						if (severityNode == None) or (severityNode.firstChild == None) or (severityNode.firstChild.nodeValue == None):
+							self.ReportBadCustomRuleElement(ruleName, "severity")
+							continue
+						severityValue = severityNode.firstChild.nodeValue
+						for severityKey in KSeverityConfigMap.keys():
+							if severityValue == KSeverityConfigMap[severityKey]:
+								severity = severityKey
+
+					# read the tile of the rule
+					title = ""
+					for titleNode in customRuleNode.getElementsByTagName("title"):
+						if (titleNode == None) or (titleNode.firstChild == None) or (titleNode.firstChild.nodeValue == None):
+							continue
+						title = titleNode.firstChild.nodeValue
+					if len(title) == 0:
+						self.ReportBadCustomRuleElement(ruleName, "title")
+						continue
+
+					# read the description of the rule
+					description = ""
+					for descriptionNode in customRuleNode.getElementsByTagName("description"):
+						if (descriptionNode == None) or (descriptionNode.firstChild == None) or (descriptionNode.firstChild.nodeValue == None):
+							continue
+						description = descriptionNode.firstChild.nodeValue
+					if len(description) == 0:
+						self.ReportBadCustomRuleElement(ruleName, "description")
+						continue
+
+					# read the optional link of the rule
+					link = None
+					for linkNode in customRuleNode.getElementsByTagName("link"):
+						if (linkNode == None) or (linkNode.firstChild == None) or (linkNode.firstChild.nodeValue == None):
+							self.ReportBadCustomRuleElement(ruleName, "link")
+							continue
+						link = linkNode.firstChild.nodeValue
+
+					# create the RE string for the custom rule
+					keywordMap = self.ConstructCustomRuleKeywordMap(keywordList)
+					reString = self.ConstructCustomRuleREString(keywordMap)
+					if len(reString) == 0:
+						continue
+					
+					# create a script based on the custom rule
+					aScript = CCustomScript(ruleName)
+					aScript.iReString = reString
+					aScript.iReMatch = re.compile(reString)
+					aScript.iFileExts = fileTypeList
+					aScript.iCategory = KCategoryOther
+					if keywordMap.has_key(KKeywordBaseClass):
+						aScript.iBaseClass = keywordMap[KKeywordBaseClass]
+						aScript.iCompare = aScript.DefaultInheritanceCompare
+					if ignoreComments:
+						aScript.iIgnore = KIgnoreComments
+					else:
+						aScript.iIgnore = KIgnoreQuotes
+					aScript.iSeverity = severity
+					aScript.iTitle = title
+					aScript.iIdeTitle = title
+					aScript.iDescription = description
+					if link <> None:
+						aScript.iLink = link
+					self.AddCustomScript(aScript)
+		return
+
+	def ReportBadCustomRuleElement(self, name, element):
+		self.ReportError("<customrule> element '" + name + "' has bad <" + element + "> child element in configuration file: " + self.iConfigFilename)
+
+	def ConstructCustomRuleKeywordMap(self, keywordList):
+		reString = ""
+		keywordMap = {}
+		for keyword in keywordList:
+			if keywordMap.has_key(keyword.iType):
+				keywordMap[keyword.iType] = keywordMap[keyword.iType] + "|" + keyword.iContent
+			else:
+				keywordMap[keyword.iType] = keyword.iContent
+		return keywordMap
+
+	def ConstructCustomRuleREString(self, keywordMap):
+		# generate RE string based on the keyword types
+		if keywordMap.has_key(KKeywordBaseClass):
+			reString = "^\s*class\s+(\w+::)?(\w+)\s*:(.*)"
+		elif keywordMap.has_key(KKeywordCall):
+			reString = "(" + keywordMap[KKeywordCall] + ")\s*\(.*\)\s*;"
+		elif keywordMap.has_key(KKeywordClassName):
+			if keywordMap.has_key(KKeywordMethod):
+				reString = "([A-Za-z0-9]+\s+" + keywordMap[KKeywordClassName] + "::)?(" + keywordMap[KKeywordMethod] + ")\s*\(.*\)\s*[^;]"
+			else:
+				reString = "^\s*class\s+(\w+::)?(" + keywordMap[KKeywordClassName] + ")"
+		elif keywordMap.has_key(KKeywordComment):
+			reString = "/(/|\*).*(" + keywordMap[KKeywordComment] + ")"
+		elif keywordMap.has_key(KKeywordGeneric):
+			reString = "(" + keywordMap[KKeywordGeneric] + ")"
+		elif keywordMap.has_key(KKeywordLocal):
+			reString = "^\s*[A-Z]\w*\s*[\*&\s]\s*(" + keywordMap[KKeywordLocal] + ")\w*\s*[;\(=]"
+		elif keywordMap.has_key(KKeywordMacro):
+			reString = "^\s*\#define\s+(" + keywordMap[KKeywordMacro] + ")"
+		elif keywordMap.has_key(KKeywordMember):
+			reString = "^\s*[A-Z]\w*\s*[\*&\s]\s*(" + keywordMap[KKeywordMember] + ")\w*\s*[;\(=]"
+		elif keywordMap.has_key(KKeywordMethod):
+			reString = "[A-Za-z0-9]+\s+[C|T|R][A-Za-z0-9]+::(" + keywordMap[KKeywordMethod] + ")\s*\(.*\)\s*[^;]"
+		elif keywordMap.has_key(KKeywordParameter):
+			reString = "({)*\s*(" + keywordMap[KKeywordParameter] + ")\s*=\s*(.*);"
+		return reString
+
+
+class CCustomRuleKeyword:
+	# #######################################################
+	# CCustomRuleKeyword - keyword associated with custom rules
+
+	def __init__(self):
+		iContent = ""
+		iType = "unknown"
+
+
+# #######################################################
+
+class CEncodedFile:
+    def Extract(self, aBaseDirectory):
+        outputFileHandle = open(os.path.join(aBaseDirectory, self.iFilename), 'wb')
+        outputFileBinary = zlib.decompress(base64.decodestring(self.iFileBody))
+        outputFileHandle.write(outputFileBinary)
+        outputFileHandle.close()
+
+	iFilename = ""
+	iFileBody = ""
+
+# #######################################################
+
+
+class CEncodedFileList:
+	def AddEncodedFile(self, aEncodedFile):
+		self.iEncodedFileList[aEncodedFile.iFilename.lower()] = aEncodedFile
+
+	def ExtractEncodedFile(self, aFilename, aBaseDirectory):
+		# look for the filename in our list of files
+		filename = aFilename.lower()
+		if (self.iEncodedFileList.has_key(filename)):
+			self.iEncodedFileList[filename].Extract(aBaseDirectory)
+		else:
+			scanner.iLog.Write("Missing "+filename)
+
+	def ExtractAllEncodedFiles(self, aBaseDirectory):
+		# run through associative array and extract everything
+		for filename in self.iEncodedFileList.keys():
+			self.ExtractEncodedFile(filename, aBaseDirectory)
+
+	# declare iEncodedFileList is an associative array
+	iEncodedFileList = {}
+
+
+# #######################################################
+# main()
+scanner = CCodeScanner()
+
+# process command line arguments
+opts, args = getopt.getopt(sys.argv[1:], "hvc:i:l:o:x:r:t:", ["help", "verbose", "config=", "input=", "logfile=", "outputformat=", "lxr=", "lxrversion=", "timestampedoutput="])
+for o, a in opts:
+	if o in ("-h", "--help"):
+		Usage(0)
+	if o in ("-v", "--verbose"):
+		scanner.iVerbose = True
+	if o in ("-c", "--config"):
+		scanner.iConfigFilename = a
+	if o in ("-i", "--input"):
+		scanner.iInputFilenames += a + "::"
+	if o in ("-l", "--logfile"):
+		scanner.iLogFilename = a
+	if o in ("-o", "--outputformat"):
+		scanner.iOutputFormat += a			
+	if o in ("-x", "--lxr"):
+		scanner.iLxrUrl = a
+	if o in ("-r", "--lxrversion"):
+		scanner.iLxrVersion = a
+	if o in ("-t", "--timestampedoutput"):
+		scanner.iTimeStampedOutput = a
+
+if len(args) < 1:
+	Usage(1)
+
+scanner.iLog = CLogger(scanner.iLogFilename)
+scanner.iLog.Write("Command line: " + str(sys.argv[1:]))
+scanner.iLog.Write("Current working directory: " + os.getcwd())
+
+scanner.ReadConfigFile()
+scanner.ReadArgumentsFromConfigFile()
+scanner.ReadCustomRulesFromConfigFile()
+
+scanner.iSource = args[0]
+scanner.iEncodedFileList = CEncodedFileList()
+scanner.iStartTimeObj = datetime.datetime.now()
+scanner.iStartTime = scanner.iStartTimeObj.ctime()
+scanner.iOutputDirectory = scanner.iStartTimeObj.strftime("%a-%b-%d-%H-%M-%S-%Y")
+
+# invoke the pysco module to improve performance
+psyco.full()
+
+# choose renderer based on command line arguments
+if len(args) > 1:
+	if ("off" in scanner.iTimeStampedOutput.lower()):
+		scanner.iOutputDirectory = args[1]
+	else:
+		scanner.iOutputDirectory = os.path.normpath(os.path.join(args[1], scanner.iOutputDirectory))
+	scanner.CleanOutputDirectory()
+	if scanner.iOutputFormat <> "":
+	#user specified output format
+		if ("xml" in scanner.iOutputFormat.lower()):
+			CXmlRenderer(scanner.iRendererManager, scanner.iOutputDirectory)
+		if ("html" in scanner.iOutputFormat.lower()):
+			CHtmlRenderer(scanner.iRendererManager, scanner.iOutputDirectory, scanner.iLxrUrl, scanner.iLxrVersion)
+		if ("std" in scanner.iOutputFormat.lower()):
+			CStdOutRenderer(scanner.iRendererManager)
+	else:
+	#default output format
+		CHtmlRenderer(scanner.iRendererManager, scanner.iOutputDirectory, scanner.iLxrUrl, scanner.iLxrVersion)
+else:
+	CStdOutRenderer(scanner.iRendererManager)
+
+#!PARSE
+
+if (scanner.iVerbose):
+	scanner.iCategoriedScripts.PrintListOfTestScripts()
+	scanner.iRendererManager.PrintListOfRenderers()
+
+print
+print "Scanning inititated : " + scanner.iStartTime
+
+if scanner.iInputFilenames <> "":
+	scanner.iComponentManager.iUseFullComponentPath = True
+	#additional input files
+	inputFiles = scanner.iInputFilenames.split("::")
+	for inputFile in inputFiles:
+		if inputFile <> "":
+			ScanDirOrFile(inputFile)
+
+argument = args[0]
+ScanDirOrFile(argument)
+
+print "Scanning finished   : " + scanner.iEndTime
+scanner.iLog.Close()
+
+if (scanner.iDomConfig <> None):
+	scanner.iDomConfig.unlink()
+
+sys.exit(0)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/longlines.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,48 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# longlines.py
+#
+# Checks : Overly long lines of code.
+#
+# Reason : Lines longer than about 100 characters can indicate 
+# messy or badly-structured code that is hard to maintain.
+#
+# #################################################################
+
+script = CScript("longlines")
+# use configured line length, if available
+scriptNode = script.ScriptConfig()
+attrInt = 100
+if (scriptNode <> None):
+	attr = scriptNode.getAttribute("length")
+	attrStr = str(attr)
+	attrInt = 0
+	if (attrStr.isdigit()):
+		attrInt = int(attrStr)
+	if (attrInt < 10):
+		attrInt = 100
+		print "Warning: Invalid line length configured; using default of 100: " + attr
+	else:
+		print "Note: 'long' line length configured as: " + str(attrInt)
+script.iReString = r""".{"""+str(attrInt)+r"""}"""
+
+script.iFileExts = ["cpp", "h", "rss", "rls", "loc", "ra","mmp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/magicnumbers.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,55 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# magicnumbers.py
+#
+# Checks : Use of magic numbers.
+#
+# Reason : Magic numbers - that is, numbers that are hard-coded 
+# into the source code and instead of being presented as constants 
+# - make code difficult to maintain and give no indication of why 
+# a calculation is the way it is. Magic numbers should be replaced 
+# with named constants.
+#
+# #################################################################
+
+script = CScript("magicnumbers")
+script.iReString = "(.*[^a-zA-Z0-9_])([0-9]+)"
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+reEnum = re.compile("^\s*E\w+\s*=\s*");
+
+def magiccompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		pretext = m.group(1)
+		number = m.group(2)
+		if (number == "0") or (number == "1") or (number == '2'):
+			return 0
+		elif (pretext.find("const") <> -1):
+			return 0
+		else:
+			m2 = reEnum.search(pretext)
+			if m2:
+				return 0
+			else:
+				return 1
+
+script.iCompare = magiccompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/mclassdestructor.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,36 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# mclassdestructor.py
+#
+# Checks : M class has destructor.
+#
+# Reason : M classes should not contain a destructor.
+#
+# #################################################################
+
+script = CScript("mclassdestructor")
+script.iReString = r"""
+	::
+	\s*				# optional whitespace
+	~M[A-Z]			# destructor
+	"""
+script.iFileExts = ["cpp", "h"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/memberlc.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,58 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# memberlc.py
+#
+# Checks : Assigning LC methods to member variables.
+#
+# Reason : Objects on the cleanup stack should not be assigned to 
+# member variables.
+#
+# #################################################################
+
+script = CScript("memberlc")
+script.iReString = r"""
+	^\s*
+	i[A-Z]\w*
+	\s*
+	=
+	\s*
+	[\w:]+
+	LC
+	\s*
+	\(
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCanPanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+reMemberLCPop = re.compile("\s*CleanupStack::Pop\s*\(")
+
+def memberlccompare(lines, currentline, rematch, filename):
+	if rematch.search(lines[currentline]):
+		if (currentline + 1) < len(lines):
+			if reMemberLCPop.search(lines[currentline + 1]):
+				return 0	# next line is a Pop
+			else:
+				return 1
+		else:					
+			return 1
+	else:
+		return 0
+
+script.iCompare = memberlccompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/membervariablecallld.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,42 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# membervariablecallld.py
+#
+# Checks : Calling LD function on member variable.
+#
+# Reason : LD functions should not be called on a member variable 
+# because ownership can be unclear and may lead to double deletes.
+#
+# #################################################################
+
+script = CScript("membervariablecallld")
+script.iReString = r"""
+	i[A-Z]			# instance variable
+	\w+				# rest of the instance variable name
+	\s*				# optional whitespace
+	(.|->)			# operator
+	\s*				# optional whitespace
+	[A-Z]			# classname
+	\w+				# rest of the instance variable name
+	LD\(			# LD function
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/missingcancel.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,97 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# missingcancel.py
+#
+# Checks : Cancel() not called in active object's destructor.
+# 
+# Reason : Cancel() should always be called in active object's 
+# destructor to cancel an outstanding request if there is one. 
+# If there is no request pending then Cancel() just does nothing, 
+# but if we do not call Cancel() when having an outstanding request 
+# a panic will be raised. CodeScanner occasionally gives false 
+# positives for this issue. Individual cases should be 
+# investigated.
+#
+# #################################################################
+
+script = CScript("missingcancel")
+script.iReString = r"""
+    ::
+    \s*        # optional whitespace
+    ~C(\w+)
+    """
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+# possible active and timer object types
+activeObjectType = re.compile("\w+Active$")
+timerObjectType = re.compile("\w+Timer$")
+
+cancelFunction = re.compile("""
+    Cancel
+    \s*
+    \(
+    """, re.VERBOSE)
+
+def isActiveDestructor(destructorType):
+    if (activeObjectType.match(destructorType)) or (timerObjectType.match(destructorType)):
+        return True
+    return False
+
+def cancelcompare(lines, currentline, rematch, filename):
+    line = lines[currentline]
+    m = rematch.search(line)
+
+    if m:
+        destructorType = m.group(1)
+        # skip non-active types
+        if (not isActiveDestructor(destructorType)):
+            return 0
+
+        i = currentline
+
+        # find opening { in function
+        while (line.count("{") == 0):
+            i = i + 1
+            if (i >= len(lines)):
+                return 1
+            line = lines[i]
+
+        # if one-line or empty function
+        if (line.count("}") > 0):
+            if (cancelFunction.search(line)):
+                return 0
+            else:
+                return 1
+
+        i = i + 1
+        bracketDepth = 1
+        while (i < len(lines)):
+            line = lines[i]
+            if (cancelFunction.search(line)):
+                return 0
+
+            bracketDepth += line.count("{") - line.count("}")
+            if (bracketDepth == 0):
+                return 1
+            i = i + 1
+    return 0
+
+script.iCompare = cancelcompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/missingcclass.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,98 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# missingcclass.py
+#
+# Checks : C class not inheriting from another C class.
+#
+# Reason : All C classes should inherit from another C class to 
+# ensure that all data members are zeroed.
+#
+# #################################################################
+
+script = CScript("missingcclass")
+script.iReString = r"""
+	^\s*
+	class
+	\s+
+	(\w+::)?
+	(\w+)
+	\s*
+	(.*)"""
+script.iFileExts = ["h", "cpp"]
+script.iCategory = KCategoryCanPanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+reCClassIgnoreStr = ""
+scriptNode = script.ScriptConfig()
+if (scriptNode <> None):
+	for wordNode in scriptNode.getElementsByTagName("cclassIgnoreRE"):
+		reCClassIgnoreStr = wordNode.firstChild.nodeValue
+		print "Note: ignoring the following classes when checking for C class not inheriting from another C class: " + reCClassIgnoreStr
+		break
+if len(reCClassIgnoreStr) > 0:
+	reCClassIgnores = re.compile(reCClassIgnoreStr, re.IGNORECASE)
+else :
+	reCClassIgnores = None
+
+def missingcclasscompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		className = m.group(2)
+		if className[0] <> "C" or (len(className) == 1) or not className[1].isupper():
+			return 0
+
+		#ignore classes on the ignored list
+		if reCClassIgnores:
+			if reCClassIgnores.search(className):
+				return 0
+
+		inheritanceString = m.group(3)
+		i = currentline + 1
+		while (inheritanceString.find("{") == -1) and i < len(lines):
+			if (inheritanceString.find(";") <> -1):
+				return 0
+			inheritanceString += lines[i]
+			i += 1
+		
+		inheritancelist = inheritanceString.split(",")
+
+		reclass = re.compile("[\s:]*(public|protected|private)?\s*([\w:]+)")
+		classlist = []
+		for inheritance in inheritancelist:
+			match = reclass.search(inheritance)
+			if match:
+				inheritclass = match.group(2)
+				colonpos = inheritclass.rfind(":")
+				if (colonpos <> -1):
+					inheritclass = inheritclass[colonpos + 1:]
+				classlist.append(inheritclass)
+
+		ccount = 0
+		for classname in classlist:
+			if (len(classname) > 2) and classname[0] == "C" and classname[1].isupper():
+				ccount += 1
+				
+		if ccount == 0:
+			return 1
+		else:
+			return 0
+	else:
+		return 0
+
+script.iCompare = missingcclasscompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/mmpsourcepath.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,33 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# mmpsourcepath.py
+#
+# Checks : Use of absolute path names in MMP files.
+#
+# Reason : Use of absolute paths in MMP files makes it impossible 
+# to relocate the source. Relative paths should be used instead.
+#
+# #################################################################
+
+script = CScript("mmpsourcepath")
+script.iReString = "^\s*[Ss][Oo][Uu][Rr][Cc][Ee][Pp][Aa][Tt][Hh]\s*\\\\"
+script.iFileExts = ["mmp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/multilangrsc.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,64 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# multilangrsc.py
+#
+# Checks : Not using BaflUtils::NearestLanguageFile() when loading 
+# a resource file.
+#
+# Reason : If AddResourceFileL() is used without first using 
+# BaflUtils::NearestLanguageFile(), then not all language versions 
+# of resources will be picked up.
+#
+# #################################################################
+
+script = CScript("multilangrsc")
+script.iReString = """
+	AddResourceFileL
+	\s*
+	\(
+	\s*\w+.*
+	\)
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+reBaflNearestLanguage = re.compile("""
+	\s*
+	BaflUtils::NearestLanguageFile
+	\s*
+	\(
+	\s*\w+.*
+	\)
+	""", re.VERBOSE)
+
+def multilangrsccompare(lines, currentline, rematch, filename):
+	if (scanner.iCurrentMethodName <> ""):
+		m = rematch.search(lines[currentline])
+		if m:
+			scanLineNum = currentline
+			while (scanLineNum>scanner.iCurrentMethodStart):
+				addResMatch = reBaflNearestLanguage.search(lines[scanLineNum])
+				if addResMatch:
+					return 0
+				scanLineNum = scanLineNum - 1
+			return 1
+	return 0
+
+script.iCompare = multilangrsccompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/multipledeclarations.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,50 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# multipledeclarations.py
+#
+# Checks : Multiple declarations on one line.
+#
+# Reason : Multiple declarations on one line can be confusing. 
+# Separate them out so that each declaration is on its own separate 
+# line.
+#
+# #################################################################
+
+script = CScript("multipledeclarations")
+script.iReString = r"""
+	\w+		# variable name
+	\s*		# optional whitespace
+	=
+	\s*		# optional whitespace
+	\w+		# variable value
+	\s*		# optional whitespace
+	,
+	\s*		# optional whitespace
+	\w+		# variable name
+	\s*		# optional whitespace
+	=
+	\s*		# optional whitespace
+	\w+		# variable value
+	\s*		# optional whitespace
+	;
+	"""
+script.iFileExts = ["h", "cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/multipleinheritance.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,83 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# multipleinheritance.py
+#
+# Checks : Non M-class multiple inheritance.
+#
+# Reason : It is bad Symbian OS practice to derive from two classes 
+# that have implemented functions. Complex behaviour that was not 
+# intended can result.
+#
+# #################################################################
+
+script = CScript("multipleinheritance")
+script.iReString = r"""
+	^\s*
+	class
+	\s+
+	(\w+::)?
+	(\w+)
+	\s*
+	:
+	(.*)"""
+script.iFileExts = ["h", "cpp"]
+script.iCategory = KCategoryWrongFunctionality
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+def classcompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		className = m.group(2)
+		if className[0] <> "C" or (len(className) == 1) or not className[1].isupper():
+			return 0
+
+		inheritanceString = m.group(3)
+		i = currentline + 1
+		while (inheritanceString.find("{") == -1) and i < len(lines):
+			if (inheritanceString.find(";") <> -1):
+				return 0
+			inheritanceString += lines[i]
+			i += 1
+		
+		inheritancelist = inheritanceString.split(",")
+
+		reclass = re.compile("[\s:]*(public|protected|private)?\s*([\w:]+)")
+		classlist = []
+		for inheritance in inheritancelist:
+			match = reclass.search(inheritance)
+			if match:
+				inheritclass = match.group(2)
+				colonpos = inheritclass.rfind(":")
+				if (colonpos <> -1):
+					inheritclass = inheritclass[colonpos + 1:]
+				classlist.append(inheritclass)
+
+		ccount = 0
+		for classname in classlist:
+			if (len(classname) > 2) and classname[0] == "C" and classname[1].isupper():
+				ccount += 1
+				
+		if ccount > 1:
+			return 1
+		else:
+			return 0
+	else:
+		return 0
+
+script.iCompare = classcompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/mydocs.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,34 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# mydocs.py
+#
+# Checks : Hard-coded mydocs directory strings.
+# 
+# Reason : The mydocs directory is subject to change so should not 
+# be referenced directly. Note: @    This issue will only occur in 
+# code developed for the Nokia Series 90 platform.
+#
+# #################################################################
+
+script = CScript("mydocs")
+script.iReString = """".*[Mm][Yy][Dd][Oo][Cc][Ss]"""
+script.iFileExts = ["cpp", "h", "rss", "rls", "loc", "ra"]
+script.iCategory = KCategoryWrongFunctionality
+script.iIgnore = KIgnoreComments
+script.iSeverity = KSeverityMedium
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/namespace.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,33 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# namespace.py
+#
+# Checks : Use of namespace.
+#
+# Reason : Namespaces are often used to work around a poor naming 
+# convention.
+#
+# #################################################################
+
+script = CScript("namespace")
+script.iReString = "^\s*namespace\s*"
+script.iFileExts = ["cpp", "h", "hpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/newlreferences.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,33 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# newlreferences.py
+#
+# Checks : NewL() returning a reference.
+#
+# Reason : NewL() and NewLC() functions should return a pointer to 
+# an object created on the heap.
+#
+# #################################################################
+
+script = CScript("newlreferences")
+script.iReString = "&\s*NewL"
+script.iFileExts = ["cpp", "h", "hpp", "inl", "c"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/noleavetrap.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,60 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# noleavetrap.py
+#
+# Checks : TRAP used with no leaving functions.
+#
+# Reason : A TRAP is unnecessary if there are no leaving functions.
+#
+# #################################################################
+
+script = CScript("noleavetrap")
+script.iReString = "^\s*TRAPD?"
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+reLeave = re.compile("(L[CDP]?\s*\(|ELeave|\)\s*\(|<<|>>)")
+
+def noleavetrapcompare(lines, currentline, rematch, filename):
+    line = lines[currentline]
+    m = rematch.search(line)
+    if m:
+    	if (line.find("(") == -1) and (currentline + 1 < len(lines)):
+    		currentline += 1
+    		line = lines[currentline]
+
+        bracketCount = line.count("(") - line.count(")")
+        found = reLeave.search(line) 
+
+        while (bracketCount > 0) and (currentline + 1 < len(lines)):
+            currentline += 1
+            line = lines[currentline]
+            bracketCount += line.count("(") - line.count(")")
+            if not found:
+                found = reLeave.search(line) 
+
+        if found:
+            return 0
+        else:
+        	return 1
+
+    return 0
+
+script.iCompare = noleavetrapcompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/nonconsthbufc.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,63 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# nonconsthbufc.py
+#
+# Checks : Non-const HBufC* parameter passing.
+#
+# Reason : HBufC* parameters should almost always be passed as a 
+# const pointer.
+#
+# #################################################################
+
+script = CScript("nonconsthbufc")
+script.iReString = """
+    (\(|,)?        # open bracket or preceeding comma
+    \s*            # whitespace
+    (\w+)?
+    \s*            # whitespace
+    HBufC
+    \s*            # whitespace
+    \*
+    \s*            # whitespace
+    (\w+)          # parameter name
+    (=|\w|\s)*     # optional parameter initialization or whitespace
+    (\)|,)         # close bracket or trailing comma
+    """
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+def consthbufccompare(lines, currentline, rematch, filename):
+    # make sure const HBufC* parameters are skipped
+    line = lines[currentline]
+    m = rematch.search(line)
+    if m:
+        isConst = (m.group(0).find("const") <> -1)
+        while m and isConst:
+            line = line[m.end():]
+            m = rematch.search(line)
+            if m:
+                isConst = (m.group(0).find("const") <> -1)
+        if isConst:
+            return 0
+        else:
+            return DefaultFuncParamCompare(lines, currentline, rematch, filename)
+    return 0
+
+script.iCompare = consthbufccompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/nonconsttdesc.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,64 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# nonconsttdesc.py
+#
+# Checks : Non-const TDesC& parameter passing.
+#
+# Reason : TDesC& parameters should be passed as a const. If it is 
+# not, it may indicate that the coder does not understand 
+# descriptors, for example, passing descriptors by value.
+#
+# #################################################################
+
+script = CScript("nonconsttdesc")
+script.iReString = """
+    (\(|,)?        # open bracket or preceeding comma
+    \s*            # whitespace
+    (\w+)?
+    \s*            # whitespace
+    (TDesC)
+    \s*            # whitespace
+    &
+    \s*            # whitespace
+    (\w+)          # parameter name
+    (=|\w|\s)*     # optional parameter initialization or whitespace
+    (\)|,)         # close bracket or trailing comma
+    """
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+def consttdesccompare(lines, currentline, rematch, filename):
+    # make sure const TDesC& parameters are skipped
+    line = lines[currentline]
+    m = rematch.search(line)
+    if m:
+        isConst = (m.group(0).find("const") <> -1)
+        while m and isConst:
+            line = line[m.end():]
+            m = rematch.search(line)
+            if m:
+                isConst = (m.group(0).find("const") <> -1)
+        if isConst:
+            return 0
+        else:
+            return DefaultFuncParamCompare(lines, currentline, rematch, filename)
+    return 0
+
+script.iCompare = consttdesccompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/nonleavenew.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,72 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# nonleavenew.py
+#
+# Checks : Use of new without (ELeave).
+#
+# Reason : Using new without (ELeave) is only used in special 
+# circumstances. The leaving variant should typically be used in 
+# preference. A common exception is for application creation, 
+# where NULL is returned for failed creation.
+#
+# #################################################################
+
+script = CScript("nonleavenew")
+script.iReString = r"""
+	(=|\(|,)		# equals, open bracket or comma
+	\s*				# optional whitespace
+	new\s+			# "new" plus at least one whitespace char
+	([^\(\s]		# a character other than a bracket
+	.*)
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+currentfilename = ""
+iswindowsfile = 0
+rewindows = re.compile("^\s*#include\s+<(windows|wchar).h>", re.IGNORECASE)
+
+def checkforwindowsinclude(lines, filename):
+	global currentfilename
+	global iswindowsfile
+	global rewindows
+
+	if (currentfilename <> filename):
+		currentfilename = filename
+		iswindowsfile = 0
+		for line in lines:
+			m = rewindows.search(line)
+			if m:
+				iswindowsfile = 1
+				break
+
+	return iswindowsfile
+
+def nonleavenewcompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		if (m.group(2).find("Application") <> -1):
+			return 0
+		else:				
+			return not checkforwindowsinclude(lines, filename)
+
+	return 0
+
+script.iCompare = nonleavenewcompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/nonunicodeskins.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,41 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# nonunicodeskins.py
+#
+# Checks : Non-Unicode skins.
+#
+# Reason : Skin definition files (SKN, SKE) must be Unicode. 
+# Note: Code that causes this issue only needs attention if it is 
+# found in code developed for Nokia Series 90 code.
+#
+# #################################################################
+
+script = CScript("nonunicodeskins")
+script.iReString = r"""
+	^\s*
+	(//|/\*|A-Z|a-z|\#|\[)
+"""
+script.iFileExts = ["skn", "ske"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreNothing
+script.iSeverity = KSeverityLow
+
+def nonunicodecompare(lines, currentline, rematch, filename):
+	return (currentline == 0) and rematch.search(lines[currentline])
+
+script.iCompare = nonunicodecompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/null.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,49 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# null.py
+#
+# Checks : NULL equality check.
+#
+# Reason : There is no need to compare pointer variables to NULL. 
+# Use If(ptr).
+#
+# #################################################################
+
+script = CScript("null")
+script.iReString = r"""
+	[!=]=\s*NULL
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+def nullcompare(lines, currentline, rematch, filename):
+    # It's OK to compare against NULL in return statement
+    line = lines[currentline]
+    m = rematch.search(line)
+    if m:
+    	if (line.find("return") > -1):
+    		return 0
+    	if (line.find("ASSERT") > -1):
+    		return 0
+    	return 1
+
+    return 0
+
+script.iCompare = nullcompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/open.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,82 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# open.py
+#
+# Checks : Ignoring Open() return value.
+#
+# Reason : Ignoring the return value from Open() functions 
+# (due to OOM, etc.) means that when the resource is accessed next, 
+# a panic will result.
+#
+# #################################################################
+
+script = CScript("open")
+script.iReString = "^\s*(\w+)(\.|->)Open\s*\("
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCanPanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+reOpenIgnoreStr = ""
+scriptNode = script.ScriptConfig()
+if (scriptNode <> None):
+	for wordNode in scriptNode.getElementsByTagName("openIgnoreRE"):
+		reOpenIgnoreStr = wordNode.firstChild.nodeValue
+		print "Note: ignoring the following objects and classes when checking for open() return value: " + reOpenIgnoreStr
+		break
+if len(reOpenIgnoreStr) > 0:
+	reOpenIgnores = re.compile(reOpenIgnoreStr, re.IGNORECASE)
+else :
+	reOpenIgnores = None
+
+reOpenAssignStr = "=\s+$"
+reOpenAssign = re.compile(reOpenAssignStr, re.IGNORECASE)
+
+def streamcompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		# ignore objects with the word "tream" in object name or object type
+		objectName = m.group(1)
+		if (objectName.find("tream") <> -1):
+			return 0
+		objectType = GetLocalVariableType(lines, currentline, objectName)
+		if (objectType.find("tream") <> -1):
+			return 0
+
+		#ignore objects with either object name or object type on the ignored list
+		if reOpenIgnores:
+			if reOpenIgnores.search(objectName):
+				return 0
+			if reOpenIgnores.search(objectType):
+				return 0
+
+		# look for handler of Open() return value on a different line
+		i = currentline - 1
+		if (i > 0) and (i >= scanner.iCurrentMethodStart):
+			line = lines[i]
+			bracketCount = line.count("(") - line.count(")")
+			if (bracketCount > 0):
+				return 0
+			r = reOpenAssign.search(line)
+			if r:
+				return 0
+		return 1
+	else:
+		return 0
+
+script.iCompare = streamcompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/pointertoarrays.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,58 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# pointertoarrays.py
+#
+# Checks : Pointer to arrays as members of a C class.
+#
+# Reason : In C classes, there is no need to use pointers to arrays 
+# as data members. Instead, use the arrays themselves. Using 
+# pointers leads to obscure notation like \"(*array)[n]\" for the 
+# more usual \"array[n]\". It also makes it necessary to explicitly 
+# delete the arrays in the destructor. Using the arrays themselves 
+# also simplifies notation, reduces indirection, and reduces heap 
+# fragmentation.
+#
+# #################################################################
+
+script = CScript("pointertoarrays")
+script.iReString = r"""
+	^\s*				# start of line plus optional whitespace
+	[CR]\w*Array\w*		# class name e.g. RPointerArray
+    (|<\w*>)			# optional "<Xxxx>" part
+	\s*\*				# "*" (with optional whitespace)
+	\s*i[A-Z]			# optional whitespace followed by the starting i of the member variable and then a capital letter
+	"""
+script.iFileExts = ["h", "cpp"]
+script.iCategory = KCategoryPerformance
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+def pointerToArraysCompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		if (len(scanner.iCurrentClassName) > 1)  and (scanner.iCurrentClassName[0]=="C"):
+			return 1    # only a problem with C classes
+		else:
+			return 0    
+	else:
+		return 0
+
+script.iCompare = pointerToArraysCompare
+script.iDisplayMethodName = 0
+script.iDisplayClassName = 1
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/pragmadisable.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,33 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# pragmadisable.py
+#
+# Checks : Use of #pragma warning.
+#
+# Reason : Disabling warnings can lead to problems, because the 
+# warnings are probably there for a reason.
+#
+# #################################################################
+
+script = CScript("pragmadisable")
+script.iReString = "\#pragma\s+warning"
+script.iFileExts = ["h","cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/pragmamessage.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,33 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# pragmamessage.py
+#
+# Checks : Use of #pragma message.
+#
+# Reason : #pragma messages during the build stage can interfere 
+# with the build log parsing.
+#
+# #################################################################
+
+script = CScript("pragmamessage")
+script.iReString = "\#pragma\s+message"
+script.iFileExts = ["h","cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/pragmaother.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,35 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# pragmaother.py
+#
+# Checks : Use of #pragma other than warning and message.
+#
+# Reason : #pragma directives should only be used in very edge 
+# cases (for example, functions consisting of inline assembler 
+# without explicit return statements) because, typically, their 
+# usage masks valid build warnings and error messages.
+#
+# #################################################################
+
+script = CScript("pragmaother")
+script.iReString = "\#pragma\s+[^warning|message]"
+script.iFileExts = ["h","cpp", "c", "inl"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/privateinheritance.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,55 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# privateinheritance.py
+#
+# Checks : Use of private inheritance.
+#
+# Reason : Classes should not be inherited privately. If public or 
+# protected inheritance is not appropriate, consider using an 
+# amalgamation; that is, have an object of that type as a 
+# member variable.
+#
+# #################################################################
+
+script = CScript("privateinheritance")
+script.iReString = r"""
+	^\s*				# start of line plus optional whitespace
+	class
+	\s+					# whitespace
+	\w+					# class name
+	\s*					# optional whitespace
+	:
+	(.*)
+	"""
+script.iFileExts = ["cpp", "h"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+def privatecompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		searchtext = m.group(1)
+		if (searchtext.find("private") == -1):
+			return 0
+		else:
+			return 1
+	else:
+		return 0
+
+script.iCompare = privatecompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/pushaddrvar.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,40 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# pushaddrvar.py
+#
+# Checks : Pushing address of a variable onto the cleanup stack.
+#
+# Reason : If the variable is owned by the code pushing it, it 
+# should be stored as a pointer. If it is not, it should not be 
+# pushed onto the cleanup stack.
+#
+# #################################################################
+
+script = CScript("pushaddrvar")
+script.iReString = r"""
+	::
+	PushL\s*		# "PushL" plus optional whitespace
+	\(				# open bracket
+	\s*				# optional whitespace
+	&				# taking the address?
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCanPanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/pushmember.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,41 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# pushmember.py
+#
+# Checks : Pushing data members onto the cleanup stack.
+#
+# Reason : Pushing member variables is likely to lead to double 
+# deletes or leakage in certain circumstances and so should be 
+# avoided. Even if no panic can result, it is bad practice and 
+# makes maintenance more difficult.
+#
+# #################################################################
+
+script = CScript("pushmember")
+script.iReString = r"""
+	::
+	PushL\s*		# "PushL" plus optional whitespace
+	\(				# open bracket
+	\s*				# optional whitespace
+	i[A-Z]			# i variable
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCanPanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/readresource.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,43 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# readresource.py
+#
+# Checks : Using ReadResource() instead of ReadResourceL().
+#
+# Reason : ReadResourceL() should always be used in preference to 
+# ReadResource() because in an error scenario ReadResource() 
+# effectively fails silently. If no check is performed on the 
+# resulting descriptor afterwards, unexpected states can ensue. 
+# These states are often characterized by buffer overflows.
+#
+# #################################################################
+
+script = CScript("readresource")
+# matching against a line like this: iCoeEnv->ReadResource( buffer, R_RESOURCE_ID );
+script.iReString = r"""
+	^\s*				# start of line plus optional whitespace
+	\w+					# variable name
+	(\.|->)				# "." or "->"
+	ReadResource\s*\(.*\)
+	\s*;
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCanPanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/resourcenotoncleanupstack.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,87 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# resourcenotoncleanupstack.py
+#
+# Checks : Neglected to put resource objects on cleanup stack.
+#
+# Reason : If a stack-based resource object is not put on the 
+# cleanup stack with CleanupResetAndDestroyPushL() or 
+# CleanupClosePushL(), and a leaving function or ELeave is called, 
+# a memory leak occurs. CodeScanner occasionally gives false 
+# positives for this issue. Individual cases should be investigated.
+#
+# #################################################################
+
+script = CScript("resourcenotoncleanupstack")
+script.iReString = r"""
+	^\s*					# start of line plus optional whitespace
+	R\w+					# resource type
+	\s*						# optional whitespace
+	(<.*>)?					# optional class in angle brackets
+	\s+						# whitespace
+	(\w+)					# object name
+	\s*						# optional whitespace
+	;
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+cleanupFunction = re.compile("""
+	\s*						# optional whitespace
+	(CleanupClosePushL|CleanupResetAndDestroyPushL)
+	\s*						# optional whitespace
+	\(
+	\s*						# optional whitespace
+	(\w+)					# object name
+	\s*						# optional whitespace
+	\)
+	\s*						# optional whitespace
+	;
+	""", re.VERBOSE)
+
+def resourcecompare(lines, currentline, rematch, filename):
+    m = rematch.search(lines[currentline])
+    if m:
+    	objectName = m.group(2)
+    	bracketdepth = GetBracketDepth(lines, currentline)
+    	i = currentline
+
+    	# search for CleanupClosePushL() or CleanupResetAndDestroyPushL() 
+    	# with the resource object at parameter
+    	while (i < len(lines)):
+    		nextLine = lines[i]
+    		
+    		match = cleanupFunction.search(nextLine)
+    		if (match):
+    			if objectName == match.group(2):
+    				return 0
+
+    		if (nextLine.find('{') >= 0):
+    			bracketdepth = bracketdepth + 1
+    		if (nextLine.find('}') >= 0):
+    			bracketdepth = bracketdepth - 1
+    			if (bracketdepth == 0):
+    				return 1
+
+    		i += 1
+
+	return 0
+
+script.iCompare = resourcecompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/resources/English.loc	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,534 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+# English.loc
+# localised string for Script accessArrayElementWithoutCheck
+
+stringPool[ "accessArrayElementWithoutCheck!title" ]       = "Array element accessed by At() function without checking index is within array range"
+stringPool[ "accessArrayElementWithoutCheck!description" ] = "Whenever an element in an array is accessed, the index should be checked to ensure that it is less than array.Count(). CodeScanner checks for explicit calls to a Count() function; so if the array index is checked in a different way, it gives false positives. Accessing an invalid index can cause a panic."
+stringPool[ "accessArrayElementWithoutCheck!ideTitle" ]    = "array element accessed by At() function without checking index is within array range"
+
+# localised string for Script accessArrayElementWithoutCheck2
+stringPool[ "accessArrayElementWithoutCheck2!title" ]       = "Array element accessed by [] without checking range"
+stringPool[ "accessArrayElementWithoutCheck2!description" ] = "Whenever an element in an array is accessed, the index should first be checked to ensure that it is within range. CodeScanner checks for explicit calls to a Count() or Length() function; so if the array index is checked in a different way, it gives false positives. Accessing an invalid index can cause a panic."
+stringPool[ "accessArrayElementWithoutCheck2!ideTitle" ]    = "array element accessed by [] without checking range"
+
+# localised string for Script activestart
+stringPool[ "activestart!title" ]       = "Using CActiveScheduler::Start"
+stringPool[ "activestart!description" ] = "Using CActiveScheduler::Start() can mean that something asynchronous is being made synchronous. Instead, use active objects correctly in an asynchronous way."
+stringPool[ "activestart!ideTitle" ]    = "using CActiveScheduler::Start"
+
+# localised string for Script activestop
+stringPool[ "activestop!title" ]       = "Using CActiveScheduler::Stop"
+stringPool[ "activestop!description" ] = "Using CActiveScheduler::Stop() can mean that something asynchronous is being made synchronous. Instead, use active objects correctly in an asynchronous way."
+stringPool[ "activestop!ideTitle" ]    = "using CActiveScheduler::Stop"
+
+# localised string for Script arraypassing
+stringPool[ "arraypassing!title" ]       = "Passing arrays by value rather than reference"
+stringPool[ "arraypassing!description" ] = "Passing arrays by value causes the array to be copied needlessly, which takes up time and memory. For efficiency, references should be used."
+stringPool[ "arraypassing!ideTitle" ]    = "passing arrays by value rather than reference"
+
+# localised string for Script arrayptrcleanup
+stringPool[ "arrayptrcleanup!title" ]       = "Using local CArrayPtr classes without cleanup items"
+stringPool[ "arrayptrcleanup!description" ] = "It is not enough to push a local CArrayPtr class onto the cleanup stack. A TCleanupItem and callback function must be used to avoid leaking the elements."
+stringPool[ "arrayptrcleanup!ideTitle" ]    = "using local CArrayPtr classes without cleanup items"
+
+# localised string for Script assertdebuginvariant
+stringPool[ "assertdebuginvariant!title" ]       = "__ASSERT_DEBUG with User::Invariant"
+stringPool[ "assertdebuginvariant!description" ] = "Replace __ASSERT_DEBUG(<condition>, User::Invariant()) with ASSERT(<condition>), because it is easier to read."
+stringPool[ "assertdebuginvariant!ideTitle" ]    = "__ASSERT_DEBUG with User::Invariant"
+
+# localised string for Script baddefines
+stringPool[ "baddefines!title" ]       = "Lowercase definition names"
+stringPool[ "baddefines!description" ] = "Badly-named definitions makes the code harder to maintain and can lead to defects."
+stringPool[ "baddefines!ideTitle" ]    = "lowercase definition names"
+
+# localised string for Script baseconstruct
+stringPool[ "baseconstruct!title" ]       = "Leaving function called before BaseConstructL()"
+stringPool[ "baseconstruct!description" ] = "If a leave occurs before BaseConstructL() is called, the system can panic because it is trying to clean up an application that has not been fully initialised."
+stringPool[ "baseconstruct!ideTitle" ]    = "leaving method called before BaseConstructL"
+
+# localised string for Script callActiveObjectWithoutCheckingOrStopping
+stringPool[ "callActiveObjectWithoutCheckingOrStopping!title" ]       = "Active object called without checking whether it is active or canceling it first"
+stringPool[ "callActiveObjectWithoutCheckingOrStopping!description" ] = "If an active object is started twice, a panic occurs. CodeScanner picks out places where there is a call to a Start(), Queue(), or After() function on a member variable, without a previous call to IsActive(), Cancel(), or Stop(). In general, if starting a timer, there should at least be a call to IsActive() to ensure that the timer is not already running."
+stringPool[ "callActiveObjectWithoutCheckingOrStopping!ideTitle" ]    = "active object called without checking whether it is active or canceling it first"
+
+# localised string for Script changenotification
+stringPool[ "changenotification!title" ]       = "Using RSAVarChangeNotify to see System Agent changes"
+stringPool[ "changenotification!description" ] = "When watching for System Agent changes, use RSystemAgent rather than RSAVarChangeNotify, which can fail."
+stringPool[ "changenotification!ideTitle" ]    = "using RSAVarChangeNotify to see System Agent changes"
+
+# localised string for Script cleanup
+stringPool[ "cleanup!title" ]       = "CleanupStack::Pop(AndDestroy) parameters"
+stringPool[ "cleanup!description" ] = "These functions should be called with explicit variable parameters to avoid misalignment."
+stringPool[ "cleanup!ideTitle" ]    = "missing CleanupStack::Pop parameter"
+
+# localised string for Script commentcode
+stringPool[ "commentcode!title" ]       = "Commented-out code"
+stringPool[ "commentcode!description" ] = "Instances of code that are commented out make the code hard to maintain and to interpret clearly. The commented out code should be removed. Any requirement to rediscover old code should be made through source control and not by trawling through commented-out code."
+stringPool[ "commentcode!ideTitle" ]    = "commented-out code"
+
+# localised string for Script connect
+stringPool[ "connect!title" ]       = "Ignoring Connect() return value"
+stringPool[ "connect!description" ] = "Ignoring the error returned from Connect() functions means that if the Connect() function fails due to OOM or other problems, the next access to the resource will panic."
+stringPool[ "connect!ideTitle" ]    = "ignoring Connect() return value"
+
+# localised string for Script ConnectAndDontCloseMemberVariable
+stringPool[ "ConnectAndDontCloseMemberVariable!title" ]       = "Calling Connect() or Open() on a member variable without calling Close() in the destructor"
+stringPool[ "ConnectAndDontCloseMemberVariable!description" ] = "If Connect() or Open() is called on any member variable, then Close() must be called in the destructor."
+stringPool[ "ConnectAndDontCloseMemberVariable!ideTitle" ]    = "calling Connect() or Open() on a member variable without calling Close() in the destructor"
+
+# localised string for Script constnames
+stringPool[ "constnames!title" ]       = "Badly-named constants"
+stringPool[ "constnames!description" ] = "Badly-named constant will make the source code harder to maintain and make defects more likely."
+stringPool[ "constnames!ideTitle" ]    = "badly-named constant"
+
+# localised string for Script consttdescptr
+stringPool[ "consttdescptr!title" ]       = "Const descriptor pointer as argument"
+stringPool[ "consttdescptr!description" ] = "Use \"const TDesC&\" instead of \"const TDesC*\"."
+stringPool[ "consttdescptr!ideTitle" ]    = "const descriptor pointer as argument"
+
+# localised string for Script controlornull
+stringPool[ "controlornull!title" ]       = "Accessing return value of ControlOrNull()"
+stringPool[ "controlornull!description" ] = "The return value might be NULL, so it should be checked before access."
+stringPool[ "controlornull!ideTitle" ]    = "accessing return value of ControlOrNull()"
+
+# localised string for Script crepository
+stringPool[ "crepository!title" ]       = "Ignoring CRepository::get() return value"
+stringPool[ "crepository!description" ] = "Independent application cannot assume that the Central Repository is set up fully. This means the return value of CRepository::get() cannot be ignored."
+stringPool[ "crepository!ideTitle" ]    = "ignoring CRepository::get() return value"
+
+# localised string for Script ctltargettype
+stringPool[ "ctltargettype!title" ]       = "Use of targettype ctl"
+stringPool[ "ctltargettype!description" ] = "The ctl target type should not be used. Instead, use DLL and explicitly refer to the Control Panel's DEF file. Note: Code that causes this issue only needs attention if it is found in code developed for Nokia Series 90 code that has extra exports for resetting the Control Panel item's data."
+stringPool[ "ctltargettype!ideTitle" ]    = "use of targettype ctl"
+
+# localised string for Script customizableicons
+stringPool[ "customizableicons!title" ]       = "Use of customizable icons"
+stringPool[ "customizableicons!description" ] = "Due to device customization requirements, independent application must not remove any customization done by the variant team. This means independent application cannot include customizable icons."
+stringPool[ "customizableicons!ideTitle" ]    = "use of customizable icons"
+
+# localised string for Script debugrom
+stringPool[ "debugrom!title" ]       = "Debug components in ROM"
+stringPool[ "debugrom!description" ] = "Debug versions of components in the ROM could mean that ROM space is being taken up with debugging information or that logging is being put out. Release versions should be in the ROM unless there is a good reason why they are not."
+stringPool[ "debugrom!ideTitle" ]    = "debug components in ROM"
+
+# localised string for Script declarename
+stringPool[ "declarename!title" ]       = "Use of __DECLARE_NAME"
+stringPool[ "declarename!description" ] = "The __DECLARE_NAME macro is historical and serves no purpose anymore and should be removed."
+stringPool[ "declarename!ideTitle" ]    = "use of __DECLARE_NAME"
+
+# localised string for Script deleteMemberVariable
+stringPool[ "deleteMemberVariable!title" ]       = "Member variable deleted incorrectly"
+stringPool[ "deleteMemberVariable!description" ] = "When a member variable is deleted, it should be assigned either to NULL or to another value. This prevents accidental access of the deleted object. If a NewL() or other leaving function is called to reassign the member variable, it should first be assigned to NULL in case that function leaves."
+stringPool[ "deleteMemberVariable!ideTitle" ]    = "member variable deleted incorrectly"
+
+# localised string for Script destructor
+stringPool[ "destructor!title" ]       = "Pointer access in destructors"
+stringPool[ "destructor!description" ] = "Accessing pointers to objects in destructors without checking whether they are not NULL could result in a panic because they may not have been constructed. The pointers should be checked to determine whether they are owned objects. If they are not owned, they should really be references rather than pointers."
+stringPool[ "destructor!ideTitle" ]    = "destructor is accessing/dereferencing data member"
+
+# localised string for Script doubleSemiColon
+stringPool[ "doubleSemiColon!title" ]       = "Use of double semicolon"
+stringPool[ "doubleSemiColon!description" ] = "Double semicolons at the end of a line are not necessary and cause a CodeWarrior compiler error."
+stringPool[ "doubleSemiColon!ideTitle" ]    = "use of double semicolon"
+
+# localised string for Script driveletters
+stringPool[ "driveletters!title" ]       = "Hard-coded drive letters"
+stringPool[ "driveletters!description" ] = "Drive letters should not be hard-coded."
+stringPool[ "driveletters!ideTitle" ]    = "hard-coded drive letters"
+
+# localised string for Script eikbuttons
+stringPool[ "eikbuttons!title" ]       = "Checks that the R_EIK_BUTTONS_* resources are not being used"
+stringPool[ "eikbuttons!description" ] = "R_EIK_BUTTONS_* resources will not be internationalised, and should not be used. Instead, create your own button resource. No button resource (or indeed, rls string) should be used in more than one location. Note: This issue is only relevant for development on Nokia platforms."
+stringPool[ "eikbuttons!ideTitle" ]    = "use of R_EIK_BUTTONS_ resources"
+
+# localised string for Script eikonenvstatic
+stringPool[ "eikonenvstatic!title" ]       = "Using CEikonEnv::Static"
+stringPool[ "eikonenvstatic!description" ] = "CEikonEnv::Static() calls should be kept to a minimum, because this involves TLS. All applications, controls, and dialogs already have a pointer to the singleton instance of CEikonEnv as a member variable and so do not need to find it again. If a class does not have access to a CEikonEnv and needs to use it repeatedly, then it should store one."
+stringPool[ "eikonenvstatic!ideTitle" ]    = "using CEikonEnv::Static"
+
+# localised string for Script enummembers
+stringPool[ "enummembers!title" ]       = "Enums with badly-named members"
+stringPool[ "enummembers!description" ] = "Enums with badly-named members make the code harder to maintain and may cause defects."
+stringPool[ "enummembers!ideTitle" ]    = "enum with badly-named member"
+
+# localised string for Script enumnames
+stringPool[ "enumnames!title" ]       = "Badly-named enums"
+stringPool[ "enumnames!description" ] = "Badly-named enums make the code harder to maintain and may cause defects."
+stringPool[ "enumnames!ideTitle" ]    = "badly-named enum"
+
+# localised string for Script exportinline
+stringPool[ "exportinline!title" ]       = "Exporting inline functions"
+stringPool[ "exportinline!description" ] = "Inline functions should not be exported because this can cause those that link to the DLL to fail to build. Exporting functions limits the changes that can be made in the future due to considerations of binary-compatibility."
+stringPool[ "exportinline!ideTitle" ]    = "exporting inline functions"
+
+# localised string for Script exportpurevirtual
+stringPool[ "exportpurevirtual!title" ]       = "Exporting pure virtual functions"
+stringPool[ "exportpurevirtual!description" ] = "Symbian recommends against the exportation of pure virtual functions."
+stringPool[ "exportpurevirtual!ideTitle" ]    = "exporting pure virtual functions"
+
+# localised string for Script externaldriveletters
+# stringPool[ "externaldriveletters!title" ]       = "Hard-coded external drive letters"
+# stringPool[ "externaldriveletters!description" ] = "External drive letters should not be hard-coded as the external drive may change between platforms and releases. This may cause confusion over ownership leading to classes being deleted erroneously and leaks occurring."
+# stringPool[ "externaldriveletters!ideTitle" ]    = "hard-coded external drive letter"
+
+# localised string for Script flags
+stringPool[ "flags!title" ]       = "Use of R&D flags or feature flags"
+stringPool[ "flags!description" ] = "Independent application must not use R&D flags nor feature flags via preprocessor statements in the source code. This means bld*.hrh and productvariant.hrh should not be used."
+stringPool[ "flags!ideTitle" ]    = "use of R&D flags or feature flags"
+
+# localised string for Script foff
+stringPool[ "foff!title" ]       = "Use of _FOFF"
+stringPool[ "foff!description" ] = "_FOFF allows access to data in classes that were not intended for public access. This may cause problems, especially when the location of the data changes."
+stringPool[ "foff!ideTitle" ]    = "use of _FOFF"
+
+# localised string for Script forbiddenwords
+stringPool[ "forbiddenwords!title" ]       = "Use of forbidden words in header files"
+stringPool[ "forbiddenwords!description" ] = "Some words should not be used in header files; especially those header files destined for external release. Some words may be forbidden for legal reasons or for platform consistency. Where they exist, alternative allowed words should be used. For example, \"NMP\" and \"Nokia Mobile Phones\" should be replaced by \"Nokia\"."
+stringPool[ "forbiddenwords!ideTitle" ]    = "use of forbidden words in header files"
+
+# localised string for Script forgottoputptroncleanupstack
+stringPool[ "forgottoputptroncleanupstack!title" ]       = "Neglected to put variable on cleanup stack"
+stringPool[ "forgottoputptroncleanupstack!description" ] = "If a variable is not put on the cleanup stack and a leaving function or ELeave is called, a memory leak occurs. CodeScanner occasionally gives false positives for this issue. Individual cases should be investigated."
+stringPool[ "forgottoputptroncleanupstack!ideTitle" ]    = "neglected to put variable on cleanup stack"
+
+# localised string for Script friend
+stringPool[ "friend!title" ]       = "Use of friends"
+stringPool[ "friend!description" ] = "The friend directive is often misused and can indicate problems in the OO design."
+stringPool[ "friend!ideTitle" ]    = "use of friends"
+
+# localised string for Script goto
+stringPool[ "goto!title" ]       = "Use of goto"
+stringPool[ "goto!description" ] = "Goto should not be used if it can be avoided because it makes the program flow more difficult to follow."
+stringPool[ "goto!ideTitle" ]    = "use of goto"
+
+# localised string for Script ifassignments
+stringPool[ "ifassignments!title" ]       = "Assignment in an If statement"
+stringPool[ "ifassignments!description" ] = "Assignments inside an If statement often indicate that the assignment was not intended. Even if the assignment was intended, it is clearer to separate out the assignment from the conditional. The script that detects such occurrences has a few false positives when the action statements are on the same line as the conditional check. However, this is also against the coding standards and the action should be on a separate line."
+stringPool[ "ifassignments!ideTitle" ]    = "assignment in an If statement"
+
+# localised string for Script ifpreprocessor
+stringPool[ "ifpreprocessor!title" ]       = "Use of #if in .h files"
+stringPool[ "ifpreprocessor!description" ] = "#if in header files should only be used before the main include guards and not around #include statements or around functional blocks in class definitions. The reason for the latter is to aid readability and to make BC breaks more difficult."
+stringPool[ "ifpreprocessor!ideTitle" ]    = "use of #if in .h files (not as main include guards)"
+
+# localised string for Script inheritanceorder
+stringPool[ "inheritanceorder!title" ]       = "Incorrect inheritance order of M and C classes"
+stringPool[ "inheritanceorder!description" ] = "If a C class inherits first from an M class and then a C class, a panic can occur when trying to pop a CBase pointer pointing to such a class from the cleanup stack when in fact a pointer pointing to the first predecessor, the mixin class, was popped instead."
+stringPool[ "inheritanceorder!ideTitle" ]    = "incorrect inheritance order of M and C classes"
+
+# localised string for Script intleaves
+stringPool[ "intleaves!title" ]       = "Methods that leave AND return a TInt error"
+stringPool[ "intleaves!description" ] = "Returning an error code as well as being able to leave is problematical for the caller. It is preferable to adhere to one method of returning the error. Note: CodeScanner is likely to return false positives for this situation, because some returned TInt values will not be error codes."
+stringPool[ "intleaves!ideTitle" ]    = "methods that leave AND return a TInt error"
+
+# localised string for Script jmp
+stringPool[ "jmp!title" ]       = "Use of setjmp and/or longjmp"
+stringPool[ "jmp!description" ] = "Using setjmp and/or longjmp makes code less maintainable."
+stringPool[ "jmp!ideTitle" ]    = "use of setjmp and/or longjmp"
+
+# localised string for Script leave
+stringPool[ "leave!title" ]       = "Leaving functions called in non-leaving functions"
+stringPool[ "leave!description" ] = "Non-leaving functions should not call leaving functions. Note: Operator functions are considered to be able to leave when scanning the code inside them."
+stringPool[ "leave!ideTitle" ]    = "leaving function called in non-leaving function"
+
+# localised string for Script LeaveNoError
+stringPool[ "LeaveNoError!title" ]       = "Leaving with KErrNone"
+stringPool[ "LeaveNoError!description" ] = "Leaving with KErrNone usually indicates that there is a makeshift way around a design issue rather than a true and proper fix to the architecture."
+stringPool[ "LeaveNoError!ideTitle" ]    = "leaving with KErrNone"
+
+# localised string for Script leavingoperators
+stringPool[ "leavingoperators!title" ]       = "Leaving functions called in operator functions"
+stringPool[ "leavingoperators!description" ] = "It is not obvious that operator functions can leave. Calling leaving functions in operator functions should be considered carefully."
+stringPool[ "leavingoperators!ideTitle" ]    = "leaving functions called in operator functions"
+
+# localised string for Script LFunctionCantLeave
+stringPool[ "LFunctionCantLeave!title" ]       = "L-functions that cannot leave"
+stringPool[ "LFunctionCantLeave!description" ] = "A function should not be named with an 'L' if it cannot leave. The only exception is in virtual functions where the function name is defined in the base class so the L cannot be removed. For example, RunL()."
+stringPool[ "LFunctionCantLeave!ideTitle" ]    = "L-functions that cannot leave"
+
+# localised string for Script longlines
+stringPool[ "longlines!title" ]       = "Overly long lines of code"
+stringPool[ "longlines!description" ] = "Lines longer than about 100 characters can indicate messy or badly-structured code that is hard to maintain."
+stringPool[ "longlines!ideTitle" ]    = "overly long line of code"
+
+# localised string for Script magicnumbers
+stringPool[ "magicnumbers!title" ]       = "Use of magic numbers"
+stringPool[ "magicnumbers!description" ] = "Magic numbers - that is, numbers that are hard-coded into the source code and instead of being presented as constants - make code difficult to maintain and give no indication of why a calculation is the way it is. Magic numbers should be replaced with named constants."
+stringPool[ "magicnumbers!ideTitle" ]    = "use of magic numbers"
+
+# localised string for Script mclassdestructor
+stringPool[ "mclassdestructor!title" ]       = "M class has destructor"
+stringPool[ "mclassdestructor!description" ] = "M classes should not contain a destructor."
+stringPool[ "mclassdestructor!ideTitle" ]    = "M class has destructor"
+
+# localised string for Script memberlc
+stringPool[ "memberlc!title" ]       = "Assigning LC methods to member variables"
+stringPool[ "memberlc!description" ] = "Objects on the cleanup stack should not be assigned to member variables"
+stringPool[ "memberlc!ideTitle" ]    = "LC method assigned to data member"
+
+# localised string for Script membervariablecallld
+stringPool[ "membervariablecallld!title" ]       = "Calling LD function on member variable"
+stringPool[ "membervariablecallld!description" ] = "LD functions should not be called on a member variable because ownership can be unclear and may lead to double deletes."
+stringPool[ "membervariablecallld!ideTitle" ]    = "calling LD function on member variable"
+
+# localised string for Script missingcancel
+stringPool[ "missingcancel!title" ]       = "Cancel() not called in active object's destructor"
+stringPool[ "missingcancel!description" ] = "Cancel() should always be called in active object's destructor to cancel an outstanding request if there is one. If there is no request pending then Cancel() just does nothing, but if we do not call Cancel() when having an outstanding request a panic will be raised. CodeScanner occasionally gives false positives for this issue. Individual cases should be investigated."
+stringPool[ "missingcancel!ideTitle" ]    = "Cancel() not called in active object's destructor"
+
+# localised string for Script missingcclass
+stringPool[ "missingcclass!title" ]       = "C class not inheriting from another C class"
+stringPool[ "missingcclass!description" ] = "All C classes should inherit from another C class to ensure that all data members are zeroed."
+stringPool[ "missingcclass!ideTitle" ]    = "C class not inheriting from another C class"
+
+# localised string for Script mmpsourcepath
+stringPool[ "mmpsourcepath!title" ]       = "Use of absolute path names in MMP files"
+stringPool[ "mmpsourcepath!description" ] = "Use of absolute paths in MMP files makes it impossible to relocate the source. Relative paths should be used instead."
+stringPool[ "mmpsourcepath!ideTitle" ]    = "use of absolute path names in MMP files"
+
+# localised string for Script multilangrsc
+stringPool[ "multilangrsc!title" ]       = "Not using BaflUtils::NearestLanguageFile() when loading a resource file"
+stringPool[ "multilangrsc!description" ] = "If AddResourceFileL() is used without first using BaflUtils::NearestLanguageFile(), then not all language versions of resources will be picked up."
+stringPool[ "multilangrsc!ideTitle" ]    = "not using BaflUtils::NearestLanguageFile() when loading a resource file"
+
+# localised string for Script multipledeclarations
+stringPool[ "multipledeclarations!title" ]       = "Multiple declarations on one line"
+stringPool[ "multipledeclarations!description" ] = "Multiple declarations on one line can be confusing. Separate them out so that each declaration is on its own separate line."
+stringPool[ "multipledeclarations!ideTitle" ]    = "multiple declarations on one line"
+
+# localised string for Script multipleinheritance
+stringPool[ "multipleinheritance!title" ]       = "Non M-class multiple inheritance"
+stringPool[ "multipleinheritance!description" ] = "It is bad Symbian OS practice to derive from two classes that have implemented functions. Complex behaviour that was not intended can result."
+stringPool[ "multipleinheritance!ideTitle" ]    = "multiple inheritance from non M-classes"
+
+# localised string for Script mydocs
+stringPool[ "mydocs!title" ]       = "Hard-coded mydocs directory strings"
+stringPool[ "mydocs!description" ] = "The mydocs directory is subject to change so should not be referenced directly. Note: @	This issue will only occur in code developed for the Nokia Series 90 platform."
+stringPool[ "mydocs!ideTitle" ]    = "hard-coded mydocs directory strings"
+
+# localised string for Script namespace
+stringPool[ "namespace!title" ]       = "Use of namespace"
+stringPool[ "namespace!description" ] = "Namespaces are often used to work around a poor naming convention."
+stringPool[ "namespace!ideTitle" ]    = "use of namespace"
+
+# localised string for Script newlreferences
+stringPool[ "newlreferences!title" ]       = "NewL() returning a reference"
+stringPool[ "newlreferences!description" ] = "NewL() and NewLC() functions should return a pointer to an object created on the heap."
+stringPool[ "newlreferences!ideTitle" ]    = "NewL() returning a reference"
+
+# localised string for Script noleavetrap
+stringPool[ "noleavetrap!title" ]       = "TRAP used with no leaving functions"
+stringPool[ "noleavetrap!description" ] = "A TRAP is unnecessary if there are no leaving functions."
+stringPool[ "noleavetrap!ideTitle" ]    = "TRAP contains no leaving functions"
+
+# localised string for Script nonconsthbufc
+stringPool[ "nonconsthbufc!title" ]       = "Non-const HBufC* parameter passing"
+stringPool[ "nonconsthbufc!description" ] = "HBufC* parameters should almost always be passed as a const pointer."
+stringPool[ "nonconsthbufc!ideTitle" ]    = "non-const HBufC* parameter passing"
+
+# localised string for Script nonconsttdesc
+stringPool[ "nonconsttdesc!title" ]       = "Non-const TDesC& parameter passing"
+stringPool[ "nonconsttdesc!description" ] = "TDesC& parameters should be passed as a const. If it is not, it may indicate that the coder does not understand descriptors, for example, passing descriptors by value."
+stringPool[ "nonconsttdesc!ideTitle" ]    = "non-const TDesC& parameter passing"
+
+# localised string for Script nonleavenew
+stringPool[ "nonleavenew!title" ]       = "Use of new without (ELeave)"
+stringPool[ "nonleavenew!description" ] = "Using new without (ELeave) is only used in special circumstances. The leaving variant should typically be used in preference. A common exception is for application creation, where NULL is returned for failed creation."
+stringPool[ "nonleavenew!ideTitle" ]    = "new used without (ELeave)"
+
+# localised string for Script nonunicodeskins
+stringPool[ "nonunicodeskins!title" ]       = "Non-Unicode skins"
+stringPool[ "nonunicodeskins!description" ] = "Skin definition files (SKN, SKE) must be Unicode. Note: Code that causes this issue only needs attention if it is found in code developed for Nokia Series 90 code."
+stringPool[ "nonunicodeskins!ideTitle" ]    = "non-Unicode skins"
+
+# localised string for Script null
+stringPool[ "null!title" ]       = "NULL equality check"
+stringPool[ "null!description" ] = "There is no need to compare pointer variables to NULL. Use If(ptr)."
+stringPool[ "null!ideTitle" ]    = "NULL equality check"
+
+# localised string for Script open
+stringPool[ "open!title" ]       = "Ignoring Open() return value"
+stringPool[ "open!description" ] = "Ignoring the return value from Open() functions (due to OOM, etc.) means that when the resource is accessed next, a panic will result."
+stringPool[ "open!ideTitle" ]    = "ignoring Open() return value"
+
+# localised string for Script pointertoarrays
+stringPool[ "pointertoarrays!title" ]       = "Pointer to arrays as members of a C class"
+stringPool[ "pointertoarrays!description" ] = "In C classes, there is no need to use pointers to arrays as data members. Instead, use the arrays themselves. Using pointers leads to obscure notation like \"(*array)[n]\" for the more usual \"array[n]\". It also makes it necessary to explicitly delete the arrays in the destructor. Using the arrays themselves also simplifies notation, reduces indirection, and reduces heap fragmentation."
+stringPool[ "pointertoarrays!ideTitle" ]    = "pointer to arrays as members of a C class"
+
+# localised string for Script pragmadisable
+stringPool[ "pragmadisable!title" ]       = "Use of #pragma warning"
+stringPool[ "pragmadisable!description" ] = "Disabling warnings can lead to problems, because the warnings are probably there for a reason."
+stringPool[ "pragmadisable!ideTitle" ]    = "use of #pragma warning"
+
+# localised string for Script pragmamessage
+stringPool[ "pragmamessage!title" ]       = "Use of #pragma message"
+stringPool[ "pragmamessage!description" ] = "#pragma messages during the build stage can interfere with the build log parsing."
+stringPool[ "pragmamessage!ideTitle" ]    = "use of #pragma message"
+
+# localised string for Script pragmaother
+stringPool[ "pragmaother!title" ]       = "Use of #pragma other than warning and message"
+stringPool[ "pragmaother!description" ] = "#pragma directives should only be used in very edge cases (for example, functions consisting of inline assembler without explicit return statements) because, typically, their usage masks valid build warnings and error messages."
+stringPool[ "pragmaother!ideTitle" ]    = "use of #pragma other than warning and message"
+
+# localised string for Script privateinheritance
+stringPool[ "privateinheritance!title" ]       = "Use of private inheritance"
+stringPool[ "privateinheritance!description" ] = "Classes should not be inherited privately. If public or protected inheritance is not appropriate, consider using an amalgamation; that is, have an object of that type as a member variable."
+stringPool[ "privateinheritance!ideTitle" ]    = "use of private inheritance"
+
+# localised string for Script pushaddrvar
+stringPool[ "pushaddrvar!title" ]       = "Pushing address of a variable onto the cleanup stack"
+stringPool[ "pushaddrvar!description" ] = "If the variable is owned by the code pushing it, it should be stored as a pointer. If it is not, it should not be pushed onto the cleanup stack."
+stringPool[ "pushaddrvar!ideTitle" ]    = "pushing address of a variable onto the cleanup stack"
+
+# localised string for Script pushmember
+stringPool[ "pushmember!title" ]       = "Pushing data members onto the cleanup stack"
+stringPool[ "pushmember!description" ] = "Pushing member variables is likely to lead to double deletes or leakage in certain circumstances and so should be avoided. Even if no panic can result, it is bad practice and makes maintenance more difficult."
+stringPool[ "pushmember!ideTitle" ]    = "data member pushed to cleanup stack"
+
+# localised string for Script readresource
+stringPool[ "readresource!title" ]       = "Using ReadResource() instead of ReadResourceL()"
+stringPool[ "readresource!description" ] = "ReadResourceL() should always be used in preference to ReadResource() because in an error scenario ReadResource() effectively fails silently. If no check is performed on the resulting descriptor afterwards, unexpected states can ensue. These states are often characterized by buffer overflows."
+stringPool[ "readresource!ideTitle" ]    = "Using ReadResource() instead of ReadResourceL()"
+
+# localised string for Script resourcenotoncleanupstack
+stringPool[ "resourcenotoncleanupstack!title" ]       = "Neglected to put resource objects on cleanup stack"
+stringPool[ "resourcenotoncleanupstack!description" ] = "If a stack-based resource object is not put on the cleanup stack with CleanupResetAndDestroyPushL() or CleanupClosePushL(), and a leaving function or ELeave is called, a memory leak occurs. CodeScanner occasionally gives false positives for this issue. Individual cases should be investigated."
+stringPool[ "resourcenotoncleanupstack!ideTitle" ]    = "neglected to put resource objects on cleanup stack"
+
+# localised string for Script resourcesonheap
+stringPool[ "resourcesonheap!title" ]       = "Resource objects on the heap"
+stringPool[ "resourcesonheap!description" ] = "There is very rarely any real need to put R classes on the heap (unless they are not real R classes!).  Doing so can lead to inefficiency and cleanup stack problems."
+stringPool[ "resourcesonheap!ideTitle" ]    = "resource objects on the heap"
+
+# localised string for Script returndescriptoroutofscope
+stringPool[ "returndescriptoroutofscope!title" ]       = "Return descriptor out of scope"
+stringPool[ "returndescriptoroutofscope!description" ] = "Returning a TBuf descriptor that is declared locally takes it out of scope. This can cause a crash on WINSCW, although not on WINS."
+stringPool[ "returndescriptoroutofscope!ideTitle" ]    = "return descriptor out of scope"
+
+# localised string for Script rfs
+stringPool[ "rfs!title" ]       = "Use of non-pointer/reference RFs"
+stringPool[ "rfs!description" ] = "Connecting to an RFs is a time-consuming operation. (It can take approximately 0.1 seconds on some devices.) To minimise wasted time and resources, use the already-connected one in EikonEnv or elsewhere, if possible."
+stringPool[ "rfs!ideTitle" ]    = "use of non-pointer/reference RFs"
+
+# localised string for Script rssnames
+stringPool[ "rssnames!title" ]       = "Duplicate RSS names"
+stringPool[ "rssnames!description" ] = "Resource files with clashing NAME fields can cause the wrong resource file to be accessed. This can lead to incorrect functionality or panics."
+stringPool[ "rssnames!ideTitle" ]    = "duplicate RSS names"
+
+# localised string for Script stringliterals
+stringPool[ "stringliterals!title" ]       = "Use of _L string literals"
+stringPool[ "stringliterals!description" ] = "_L() string literals should be replaced by the _LIT() macro."
+stringPool[ "stringliterals!ideTitle" ]    = "use of _L string literals"
+
+# localised string for Script stringsinresourcefiles
+stringPool[ "stringsinresourcefiles!title" ]       = "Strings in RSS or RA files"
+stringPool[ "stringsinresourcefiles!description" ] = "Strings should not be defined in RSS or RA files. Instead, they should be put in RLS or other localisable files."
+stringPool[ "stringsinresourcefiles!ideTitle" ]    = "strings in RSS or RA files"
+
+# localised string for Script struct
+stringPool[ "struct!title" ]       = "Use of struct"
+stringPool[ "struct!description" ] = "C-style structs should not generally be used. The correct idiom is to use a class with public members. A permissible use of a C-style struct is if it is used to group non-semantically related entities together for convenience, and if a class-related hierarchy would be too heavy-weight."
+stringPool[ "struct!ideTitle" ]    = "use of struct"
+
+# localised string for Script tcclasses
+stringPool[ "tcclasses!title" ]       = "T classes inheriting from C classes"
+stringPool[ "tcclasses!description" ] = "T classes that are derived from C classes may have a complex constructor and so need to be handled differently. It is better to make the T class into a C class, which will make the code easier to maintain."
+stringPool[ "tcclasses!ideTitle" ]    = "T class inherits from C class"
+
+# localised string for Script tclassdestructor
+stringPool[ "tclassdestructor!title" ]       = "T class has destructor"
+stringPool[ "tclassdestructor!description" ] = "T classes should not have a destructor"
+stringPool[ "tclassdestructor!ideTitle" ]    = "T class has destructor"
+
+# localised string for Script todocomments
+stringPool[ "todocomments!title" ]       = "\"To do\" comments"
+stringPool[ "todocomments!description" ] = "\"To do\" comments in code suggest that it is not finished."
+stringPool[ "todocomments!ideTitle" ]    = "\"To do\" comment"
+
+# localised string for Script trapcleanup
+stringPool[ "trapcleanup!title" ]       = "Use of LC function in TRAPs"
+stringPool[ "trapcleanup!description" ] = "You cannot trap something that leaves something on the cleanup stack because it will panic."
+stringPool[ "trapcleanup!ideTitle" ]    = "LC function used in TRAP"
+
+# localised string for Script trapeleave
+stringPool[ "trapeleave!title" ]       = "Trapping new(ELeave)"
+stringPool[ "trapeleave!description" ] = "The trapping of a \"new(ELeave) CXxx\" call is redundant and wasteful as the code to support TRAP is surprisingly large. If the instantiation process really needs not to leave, use \"new CXxx\" and check for NULL."
+stringPool[ "trapeleave!ideTitle" ]    = "trapping new(ELeave)"
+
+# localised string for Script traprunl
+stringPool[ "traprunl!title" ]       = "Trapping of (Do)RunL() rather than using RunError()"
+stringPool[ "traprunl!description" ] = "The RunError() function should be used rather than the CActive derivative using its own TRAPD solution within a RunL()."
+stringPool[ "traprunl!ideTitle" ]    = "trapping of (Do)RunL() rather than using RunError()"
+
+# localised string for Script trspassing
+stringPool[ "trspassing!title" ]       = "Passing TRequestStatus parameters by value"
+stringPool[ "trspassing!description" ] = "TRequestStatus parameters should be passed by reference. If TRequestStatus is just being used as an error code, then convert it to a TInt."
+stringPool[ "trspassing!ideTitle" ]    = "passing TRequestStatus parameters by value"
+
+# localised string for Script uids
+stringPool[ "uids!title" ]       = "Duplicate UIDs"
+stringPool[ "uids!description" ] = "UIDs must be unique."
+stringPool[ "uids!ideTitle" ]    = "duplicate UIDs"
+
+# localised string for Script uncompressedaif
+stringPool[ "uncompressedaif!title" ]       = "Uncompressed AIFs in ROM"
+stringPool[ "uncompressedaif!description" ] = "AIF files should be referenced as \"AIF=\" rather than \"data=\" or \"file=\" otherwise they can bloat the ROM size and slow down application loading."
+stringPool[ "uncompressedaif!ideTitle" ]    = "uncompressed AIFs in ROM"
+
+# localised string for Script uncompressedbmp
+stringPool[ "uncompressedbmp!title" ]       = "Uncompressed bitmaps in ROM"
+stringPool[ "uncompressedbmp!description" ] = "Using uncompressed bitmaps can significantly bloat the size of ROM images. All occurrences of \"bitmap=\" in iby/hby files should be replaced with \"auto-bitmap=\". Also, including bitmaps using \"data=\" or \"file=\" causes bloat and load-speed reductions."
+stringPool[ "uncompressedbmp!ideTitle" ]    = "uncompressed bitmaps in ROM"
+
+# localised string for Script unicodesource
+stringPool[ "unicodesource!title" ]       = "Unicode source files"
+stringPool[ "unicodesource!description" ] = "Having Unicode source files (CPP, H, RLS, LOC, RSS, and RA) will break most build systems."
+stringPool[ "unicodesource!ideTitle" ]    = "Unicode source files"
+
+# localised string for Script userafter
+stringPool[ "userafter!title" ]       = "Use of User::After"
+stringPool[ "userafter!description" ] = "Generally, User::After() functions are used to skirt around timing problems. Typically, they should be removed and the defects fixed properly: that is, by waiting for the correct event to continue execution."
+stringPool[ "userafter!ideTitle" ]    = "use of User::After"
+
+# localised string for Script userfree
+stringPool[ "userfree!title" ]       = "Using User::Free directly"
+stringPool[ "userfree!description" ] = "User::Free() should never be called, because all objects free their memory on deletion; their destructors are not called and further resources cannot be freed or closed. This function should be removed and replaced by explicit deletes."
+stringPool[ "userfree!ideTitle" ]    = "using User::Free directly"
+
+# localised string for Script userWaitForRequest
+stringPool[ "userWaitForRequest!title" ]       = "Use of User::WaitForRequest"
+stringPool[ "userWaitForRequest!description" ] = "User::WaitForRequest() should not generally be used in UI code because the UI will not respond to redraw events while its thread is stopped."
+stringPool[ "userWaitForRequest!ideTitle" ]    = "use of User::WaitForRequest"
+
+# localised string for Script variablenames
+stringPool[ "variablenames!title" ]       = "Local variables with member/argument names"
+stringPool[ "variablenames!description" ] = "Local variable names should be of the form localVariable and not aLocalVar or iLocalVar. Badly-named variables can be misleading and cause maintenance and coding errors."
+stringPool[ "variablenames!ideTitle" ]    = "local variables with member/argument names"
+
+# localised string for Script voidparameter
+stringPool[ "voidparameter!title" ]       = "Void parameter explicitly declared"
+stringPool[ "voidparameter!description" ] = "Declaring a void parameter is unnecessary. A function declared as DoSomething(void) may as well be declared as DoSomething(). Void casts are also unnecessary."
+stringPool[ "voidparameter!ideTitle" ]    = "void parameter explicitly declared"
+
+# localised string for Script worryingcomments
+stringPool[ "worryingcomments!title" ]       = "Worrying comments"
+stringPool[ "worryingcomments!description" ] = "Typically, exclamation and question marks in comments indicate that something odd is in the code or that it is unfinished or not understood fully."
+stringPool[ "worryingcomments!ideTitle" ]    = "worrying comments"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/resources/doit.bat	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,114 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem 
+@rem Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+@rem 
+@rem * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+@rem * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+@rem * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+@rem 
+@rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+@rem THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+@rem BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+@rem SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+@rem CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.@rem
+@rem
+
+parsescripts.pl accessArrayElementWithoutCheck.py
+parsescripts.pl accessArrayElementWithoutCheck2.py
+parsescripts.pl activestart.py
+parsescripts.pl activestop.py
+parsescripts.pl arraypassing.py
+parsescripts.pl arrayptrcleanup.py
+parsescripts.pl assertdebuginvariant.py
+parsescripts.pl baddefines.py
+parsescripts.pl baseconstruct.py
+parsescripts.pl callActiveObjectWithoutCheckingOrStopping.py
+parsescripts.pl changenotification.py
+parsescripts.pl cleanup.py
+parsescripts.pl commentcode.py
+parsescripts.pl connect.py
+parsescripts.pl ConnectAndDontCloseMemberVariable.py
+parsescripts.pl constnames.py
+parsescripts.pl consttdescptr.py
+parsescripts.pl controlornull.py
+parsescripts.pl ctltargettype.py
+parsescripts.pl debugrom.py
+parsescripts.pl declarename.py
+parsescripts.pl deleteMemberVariable.py
+parsescripts.pl destructor.py
+parsescripts.pl doubleSemiColon.py
+parsescripts.pl driveletters.py
+parsescripts.pl eikbuttons.py
+parsescripts.pl eikonenvstatic.py
+parsescripts.pl enummembers.py
+parsescripts.pl enumnames.py
+parsescripts.pl exportinline.py
+parsescripts.pl exportpurevirtual.py
+parsescripts.pl externaldriveletters.py
+parsescripts.pl foff.py
+parsescripts.pl forbiddenwords.py
+parsescripts.pl forgottoputptroncleanupstack.py
+parsescripts.pl friend.py
+parsescripts.pl goto.py
+parsescripts.pl ifassignments.py
+parsescripts.pl ifpreprocessor.py
+parsescripts.pl intleaves.py
+parsescripts.pl jmp.py
+parsescripts.pl leave.py
+parsescripts.pl LeaveNoError.py
+parsescripts.pl leavingoperators.py
+parsescripts.pl LFunctionCantLeave.py
+parsescripts.pl longlines.py
+parsescripts.pl magicnumbers.py
+parsescripts.pl mclassdestructor.py
+parsescripts.pl memberlc.py
+parsescripts.pl membervariablecallld.py
+parsescripts.pl missingcclass.py
+parsescripts.pl mmpsourcepath.py
+parsescripts.pl multilangrsc.py
+parsescripts.pl multipledeclarations.py
+parsescripts.pl multipleinheritance.py
+parsescripts.pl mydocs.py
+parsescripts.pl namespace.py
+parsescripts.pl newlreferences.py
+parsescripts.pl noleavetrap.py
+parsescripts.pl nonconsthbufc.py
+parsescripts.pl nonconsttdesc.py
+parsescripts.pl nonleavenew.py
+parsescripts.pl nonunicodeskins.py
+parsescripts.pl null.py
+parsescripts.pl open.py
+parsescripts.pl pointertoarrays.py
+parsescripts.pl pragmadisable.py
+parsescripts.pl pragmamessage.py
+parsescripts.pl pragmaother.py
+parsescripts.pl privateinheritance.py
+parsescripts.pl pushaddrvar.py
+parsescripts.pl pushmember.py
+parsescripts.pl readresource.py
+parsescripts.pl resourcesonheap.py
+parsescripts.pl returndescriptoroutofscope.py
+parsescripts.pl rfs.py
+parsescripts.pl rssnames.py
+parsescripts.pl stringliterals.py
+parsescripts.pl stringsinresourcefiles.py
+parsescripts.pl struct.py
+parsescripts.pl tcclasses.py
+parsescripts.pl tclassdestructor.py
+parsescripts.pl todocomments.py
+parsescripts.pl trapcleanup.py
+parsescripts.pl trapeleave.py
+parsescripts.pl traprunl.py
+parsescripts.pl trspassing.py
+parsescripts.pl uids.py
+parsescripts.pl uncompressedaif.py
+parsescripts.pl uncompressedbmp.py
+parsescripts.pl unicodesource.py
+parsescripts.pl userafter.py
+parsescripts.pl userfree.py
+parsescripts.pl userWaitForRequest.py
+parsescripts.pl variablenames.py
+parsescripts.pl voidparameter.py
+parsescripts.pl worryingcomments.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/resources/parsescripts.pl	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,83 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+#!/usr/bin/perl -w
+
+
+use strict;
+
+
+open( STRINGPOOL, ">>stringPool.py" ) || die "Unable to open String Pool";
+
+my $fileName;
+for $fileName ( @ARGV )
+{
+    open( INPUT, $fileName ) || die "Unable to open $fileName";
+    my @file = <INPUT>;
+    close( INPUT );
+
+
+    open( OUTPUT, ">$fileName" ) || die "Unable to open $fileName";
+    my $scriptName = "!!!";
+    my $title = "!!!no title found";
+    my $description = "!!!no description found";
+    my $ideTitle = "!!!no IDE title found";
+
+    my $i;
+    for( $i = 0; $i <= $#file; $i++ )
+    {
+	if( $file[ $i ] =~ m/CScript\(\"(\w+)\"\)/ )
+	{
+	    $scriptName = $1;
+	}
+
+	if( $file[ $i ] =~ m/script.iTitleString\ +=\ +\"(.+)\"/ )
+	{
+	    $title = $1;
+	    $file[ $i ] = "# " . $file[ $i ];
+	}
+
+	if( $file[ $i ] =~ m/script.iDescription\ +=\ +\"(.+)\"/ )
+	{
+	    $description = $1;
+	    $file[ $i ] = "# " . $file[ $i ];
+	}
+
+    
+	if( $file[ $i ] =~ m/script.iErrorMessage\ +=\ +\"(.+)\"/ )
+	{
+	    $ideTitle = $1;
+	    $file[ $i ] = "# " . $file[ $i ];
+	}
+
+	print OUTPUT $file[ $i ];
+
+    }
+    
+    close( OUTPUT );
+
+    print STRINGPOOL <<EOS;
+# localised string for Script $scriptName
+stringPool[ "$scriptName!title" ]       = "$title"
+stringPool[ "$scriptName!description" ] = "$description"
+stringPool[ "$scriptName!ideTitle" ]    = "$ideTitle"
+
+EOS
+    ;
+}
+
+close( STRINGPOOL );
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/resourcesonheap.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,34 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# resourcesonheap.py
+#
+# Checks : Resource objects on the heap.
+#
+# Reason : There is very rarely any real need to put R classes on 
+# the heap (unless they are not real R classes!).  Doing so can 
+# lead to inefficiency and cleanup stack problems.
+#
+# #################################################################
+
+script = CScript("resourcesonheap")
+script.iReString = "new\s*(|\(ELeave\))\s+R[A-Z]"
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/returndescriptoroutofscope.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,94 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# returndescriptoroutofscope.py
+#
+# Checks : Return descriptor out of scope.
+#
+# Reason : Returning a TBuf descriptor that is declared locally 
+# takes it out of scope. This can cause a crash on WINSCW, although 
+# not on WINS.
+#
+# #################################################################
+
+script = CScript("returndescriptoroutofscope")
+script.iReString = r"""
+	TBuf
+	\s*
+	<
+	[A-Za-z0-9]+
+	>
+	\s*
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCanPanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+reReturnValue = re.compile("""
+	return
+	\s*
+	""", re.VERBOSE)
+
+reOpenCurlyBracket = re.compile("""
+	{
+	""", re.VERBOSE)
+
+reCloseCurlyBracket = re.compile("""
+	}
+	""", re.VERBOSE)
+
+def finddescriptor(line, descriptor):
+	startindex = line.find(descriptor)
+	if (startindex <> -1):
+		if (line[startindex] == " "):
+			if (line[startindex + len(descriptor)] == ";"):
+				return 1
+	return 0
+
+def returnvaluecompare(lines, currentline, rematch, filename):
+	line = lines[currentline]
+	m = rematch.search(line)
+
+	if m:
+		startindex = line.find(">");
+		endindex = line.find(";");
+
+		if (startindex <> -1):
+			descriptor = line[startindex+1:endindex]
+
+			i = currentline
+			bracketdepth = 1
+			while (i+1 < len(lines)):
+				i = i + 1
+				line2 = lines[i]
+
+				if reReturnValue.search(line2):
+					if (finddescriptor(line2, descriptor)):
+						return 1
+
+				if reOpenCurlyBracket.search(line2):
+					bracketdepth = bracketdepth + 1
+
+				if reCloseCurlyBracket.search(line2):
+					bracketdepth = bracketdepth - 1
+					if (bracketdepth == 0):
+						return 0
+
+	return 0
+
+script.iCompare	= returnvaluecompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/rfs.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,39 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# rfs.py
+#
+# Checks : Use of non-pointer/reference RFs.
+#
+# Reason : Connecting to an RFs is a time-consuming operation. 
+# (It can take approximately 0.1 seconds on some devices.) 
+# To minimise wasted time and resources, use the already-connected 
+# one in EikonEnv or elsewhere, if possible.
+#
+# #################################################################
+
+script = CScript("rfs")
+script.iReString = r"""
+	RFs
+	\s+					# at least one whitespace char
+	\w+					# variable name
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/rssnames.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,55 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# rssnames.py
+#
+# Checks : Duplicate RSS names.
+#
+# Reason : Resource files with clashing NAME fields can cause the 
+# wrong resource file to be accessed. This can lead to incorrect 
+# functionality or panics.
+#
+# #################################################################
+
+script = CScript("rssnames")
+script.iReString = "^\s*NAME\s+(\w+)"
+script.iFileExts = ["rss"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+rssnames = []
+
+def rsscompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		text = m.group(1).lower()
+		shortfilename = filename[filename.rfind("/") + 1:].lower()
+		for pair in rssnames:
+			if (pair[0] == text):
+			 	if (pair[1] == shortfilename):
+					return 0
+				else:
+					scanner.iRendererManager.ReportAnnotation(pair[2])
+					return 1
+
+		rssnames.append([text, shortfilename, filename])
+		return 0
+	else:
+		return 0
+
+script.iCompare = rsscompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/stringliterals.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,48 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# stringliterals.py
+#
+# Checks : Use of _L string literals.
+#
+# Reason : _L() string literals should be replaced by the _LIT() 
+# macro.
+#
+# #################################################################
+
+script = CScript("stringliterals")
+script.iReString = r"""
+	_L
+	(16|8)?			# optional "16" or "8"
+	\(
+	"""
+script.iFileExts = ["h", "cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+def stringliteralscompare(lines, currentline, rematch, filename):
+	if (lines[currentline].find("RDebug::Print(") != -1):
+		return 0
+	else:
+		m = rematch.search(lines[currentline])
+		if m:
+			return 1
+		else:
+			return 0
+
+script.iCompare = stringliteralscompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/stringsinresourcefiles.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,33 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# stringsinresourcefiles.py
+#
+# Checks : Strings in RSS or RA files.
+#
+# Reason : Strings should not be defined in RSS or RA files. 
+# Instead, they should be put in RLS or other localisable files.
+#
+# #################################################################
+
+script = CScript("stringsinresourcefiles")
+script.iReString = "=\s*\"[^\"]+\""
+script.iFileExts = ["rss", "ra"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreComments
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/struct.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,36 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# struct.py
+#
+# Checks : Use of struct.
+#
+# Reason : C-style structs should not generally be used. 
+# The correct idiom is to use a class with public members. 
+# A permissible use of a C-style struct is if it is used to group 
+# non-semantically related entities together for convenience, and 
+# if a class-related hierarchy would be too heavy-weight.
+#
+# #################################################################
+
+script = CScript("struct")
+script.iReString = "^\s*struct\s*"
+script.iFileExts = ["cpp", "h", "hpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/tcclasses.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,76 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# tcclasses.py
+#
+# Checks : T classes inheriting from C classes.
+#
+# Reason : T classes that are derived from C classes may have a 
+# complex constructor and so need to be handled differently. 
+# It is better to make the T class into a C class, which will make 
+# the code easier to maintain.
+#
+# #################################################################
+
+script = CScript("tcclasses")
+script.iReString = r"""
+	class
+	\s+					# at least one whitespace char
+	(\w+::)?
+	(\w+)				# T class
+	\s*					# optional whitespace
+	:
+	(.*)				# save inheritance text as group 1
+	"""
+script.iFileExts = ["h", "cpp"]
+script.iCategory = KCategoryWrongFunctionality
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+def tcclasscompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		className = m.group(2)
+		if className[0] <> "T" or (len(className) == 1) or not className[1].isupper():
+			return 0
+
+		inheritanceString = m.group(3)
+		i = currentline + 1
+		while (inheritanceString.find("{") == -1) and i < len(lines):
+			if (inheritanceString.find(";") <> -1):
+				return 0
+			inheritanceString += lines[i]
+			i += 1	
+
+		inheritancelist = inheritanceString.split(",")
+		reclass = re.compile("[\s:]*(public|protected|private)?\s*([\w:]+)")
+		classlist = []
+		for inheritance in inheritancelist:
+			match = reclass.search(inheritance)
+			if match:
+				inheritclass = match.group(2)
+				colonpos = inheritclass.rfind(":")
+				if (colonpos <> -1):
+					inheritclass = inheritclass[colonpos + 1:]
+				classlist.append(inheritclass)
+
+		for classname in classlist:
+			if (len(classname) > 2) and classname[0] == "C" and classname[1].isupper():
+				return 1
+	return 0
+
+script.iCompare = tcclasscompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/tclassdestructor.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,36 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# tclassdestructor.py
+#
+# Checks : T class has destructor.
+#
+# Reason : T classes should not have a destructor.
+#
+# #################################################################
+
+script = CScript("tclassdestructor")
+script.iReString = r"""
+	::
+	\s*				# optional whitespace
+	~T[A-Z]			# destructor
+	"""
+script.iFileExts = ["cpp", "h"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/todocomments.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,66 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# todocomments.py
+#
+# Checks : "To do" comments.
+#
+# Reason : "To do" comments in code suggest that it is not finished.
+#
+# #################################################################
+
+script = CScript("todocomments")
+script.iReString = r"""
+	/(/|\*)						# "//" or "/*"
+	.*(t|T)(o|O)(d|D)(o|O)		# skip to Todo
+	"""
+script.iFileExts = ["h", "cpp", "c"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreQuotes
+script.iSeverity = KSeverityLow
+
+def todocommentcodecompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		line = lines[currentline]
+		i = 0
+		inCommentBlock = 0
+
+		while i < len(line):
+			if not inCommentBlock:
+				if (line[i] == "/"):
+					if (line[i + 1] == "/"):
+						return 1
+					elif (line[i + 1] == "*"):
+						inCommentBlock = 1
+						i += 2
+						continue
+			else:
+				endIndex = line[i:].find("*/")
+				if (endIndex <> -1):
+					inCommentBlock = 0
+					# note, that first character is ignored in comments as can be direction to the in-source documentation tool
+					if (line[i+1:i + endIndex + 2].lower().find("todo") <> -1):
+						return 1
+					i += endIndex + 2
+					continue
+				else:
+					return 1			
+			i += 1		
+	return 0
+
+script.iCompare = todocommentcodecompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/trapcleanup.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,63 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# trapcleanup.py
+#
+# Checks : Use of LC function in TRAPs.
+#
+# Reason : You cannot trap something that leaves something on the 
+# cleanup stack because it will panic.
+#
+# #################################################################
+
+script = CScript("trapcleanup")
+script.iReString = "^\s*TRAPD?"
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryDefinitePanic
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityHigh
+
+reCMethod = re.compile("""
+	\w*
+	[a-z]
+	\w*
+	LC\(
+""", re.VERBOSE)
+
+def trapcleanupcompare(lines, currentline, rematch, filename):
+	line = lines[currentline]
+	m = rematch.search(line)
+	if m:
+		bracketCount = line.count("(") - line.count(")")
+		cMethod = reCMethod.search(line) 
+		pop = line.find("Pop")			
+						 
+		while (bracketCount > 0) and (currentline + 1 < len(lines)):
+			currentline += 1
+			line = lines[currentline]
+			bracketCount += line.count("(") - line.count(")")
+			if not cMethod:
+				cMethod = reCMethod.search(line) 
+			if (pop == -1):
+				pop = line.find("Pop")			
+
+		if cMethod and (pop == -1):
+			return 1
+	
+	return 0
+
+script.iCompare = trapcleanupcompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/trapeleave.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,69 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# trapeleave.py
+#
+# Checks : Trapping new(ELeave).
+#
+# Reason : The trapping of a "new(ELeave) CXxx" call is redundant 
+# and wasteful as the code to support TRAP is surprisingly large. 
+# If the instantiation process really needs not to leave, use 
+# "new CXxx" and check for NULL.
+#
+# #################################################################
+
+script = CScript("trapeleave")
+script.iReString = "^\s*TRAPD?"
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryPerformance
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+reELeave = re.compile("""
+    new
+    \s*        # whitespace
+    \(         # open bracket
+    \s*        # whitespace
+    ELeave
+    \s*        # whitespace
+    \)         # close bracket
+""", re.VERBOSE)
+
+def trapeleavecompare(lines, currentline, rematch, filename):
+    line = lines[currentline]
+    m = rematch.search(line)
+    if m:
+        if (line.find("(") == -1) and (currentline + 1 < len(lines)):
+            currentline += 1
+            line = lines[currentline]
+
+        bracketCount = line.count("(") - line.count(")")
+        found = reELeave.search(line) 
+
+        while (bracketCount > 0) and (currentline + 1 < len(lines)):
+            currentline += 1
+            line = lines[currentline]
+            bracketCount += line.count("(") - line.count(")")
+            if not found:
+                found = reELeave.search(line) 
+
+        if found:
+            return 1
+
+    return 0
+
+script.iCompare = trapeleavecompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/traprunl.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,63 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# traprunl.py
+#
+# Checks : Trapping of (Do)RunL() rather than using RunError().
+#
+# Reason : The RunError() function should be used rather than the 
+# CActive derivative using its own TRAPD solution within a RunL().
+#
+# #################################################################
+
+script = CScript("traprunl")
+script.iReString = "^\s*TRAPD?"
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+reRunL = re.compile("""
+    RunL
+    \s*        # whitespace
+    \(         # open bracket
+""", re.VERBOSE)
+
+def traprunlcompare(lines, currentline, rematch, filename):
+    line = lines[currentline]
+    m = rematch.search(line)
+    if m:
+        if (line.find("(") == -1) and (currentline + 1 < len(lines)):
+            currentline += 1
+            line = lines[currentline]
+
+        bracketCount = line.count("(") - line.count(")")
+        found = reRunL.search(line) 
+
+        while (bracketCount > 0) and (currentline + 1 < len(lines)):
+            currentline += 1
+            line = lines[currentline]
+            bracketCount += line.count("(") - line.count(")")
+            if not found:
+                found = reRunL.search(line) 
+
+        if found:
+            return 1
+
+    return 0
+
+script.iCompare = traprunlcompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/trspassing.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,45 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# trspassing.py
+#
+# Checks : Passing TRequestStatus parameters by value.
+#
+# Reason : TRequestStatus parameters should be passed by reference. 
+# If TRequestStatus is just being used as an error code, then 
+# convert it to a TInt.
+#
+# #################################################################
+
+script = CScript("trspassing")
+script.iReString = r"""
+    (\(|,)?				# open bracket or preceeding comma
+    \s*					# whitespace
+	TRequestStatus
+    \s*					# whitespace
+	[^&*]				# matches any character except '&' and '*'
+    \s*					# whitespace
+	(\w+)				# parameter name
+    (=|\w|\s)*          # optional parameter initialization or whitespace
+    (\)|,)				# close bracket or trailing comma
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryWrongFunctionality
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+script.iCompare = DefaultFuncParamCompare
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/uids.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,60 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# uids.py
+#
+# Checks : Duplicate UIDs.
+#
+# Reason : UIDs must be unique.
+#
+# #################################################################
+
+script = CScript("uids")
+script.iReString = r"""
+	^\s*			# whitespace
+	[Uu][Ii][Dd]	# uid			
+	\s+				# at least one whitespace char
+	\w+
+	\s+				# at least one whitespace char
+	(\w+)
+	"""
+script.iFileExts = ["mmp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+uids = []
+
+def uidcompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		text = m.group(1).lower()
+		shortfilename = filename[filename.rfind("/") + 1:].lower()
+		for pair in uids:
+			if (pair[0] == text):
+			 	if (pair[1] == shortfilename):
+					return 0
+				else:
+					scanner.iRendererManager.ReportAnnotation(pair[2])
+					return 1
+
+		uids.append([text, shortfilename, filename])
+		return 0
+	else:
+		return 0
+
+script.iCompare = uidcompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/uncompressedaif.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,44 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# uncompressedaif.py
+#
+# Checks : Uncompressed AIFs in ROM.
+#
+# Reason : AIF files should be referenced as "AIF=" rather than 
+# "data=" or "file=" otherwise they can bloat the ROM size and 
+# slow down application loading.
+#
+# #################################################################
+
+script = CScript("uncompressedaif")
+script.iReString = r"""
+			(
+			^
+			\s*
+			(data|file)
+			\s*
+			=
+			.*
+			\.aif
+			)
+			"""
+script.iFileExts = ["iby", "hby", "oby"]
+script.iCategory = KCategoryPerformance
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/uncompressedbmp.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,54 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# uncompressedbmp.py
+#
+# Checks : Uncompressed bitmaps in ROM.
+#
+# Reason : Using uncompressed bitmaps can significantly bloat the 
+# size of ROM images. All occurrences of "bitmap=" in iby/hby files 
+# should be replaced with "auto-bitmap=". Also, including bitmaps 
+# using "data=" or "file=" causes bloat and load-speed reductions.
+#
+# #################################################################
+
+script = CScript("uncompressedbmp")
+script.iReString = r"""
+			(
+
+			^
+			\s*
+			bitmap
+			\s*
+			=
+			
+			|
+
+			^
+			\s*
+			(data|file)
+			\s*
+			=
+			.*
+			\.mbm
+			)
+			"""
+script.iFileExts = ["iby", "hby", "oby"]
+script.iCategory = KCategoryPerformance
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/unicodesource.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,40 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# unicodesource.py
+#
+# Checks : Unicode source files.
+#
+# Reason : Having Unicode source files (CPP, H, RLS, LOC, RSS, and 
+# RA) will break most build systems.
+#
+# #################################################################
+
+script = CScript("unicodesource")
+script.iReString = r"""
+	^
+	\xFF\xFE	
+	"""
+script.iFileExts = ["cpp", "h", "rls", "loc", "rss", "ra"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+def unicodesourcecompare(lines, currentline, rematch, filename):
+	return (currentline == 0) and rematch.search(lines[currentline])
+
+script.iCompare = unicodesourcecompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/userWaitForRequest.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,34 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# userWaitForRequest.py
+#
+# Checks : Use of User::WaitForRequest.
+#
+# Reason : User::WaitForRequest() should not generally be used in 
+# UI code because the UI will not respond to redraw events while 
+# its thread is stopped.
+#
+# #################################################################
+
+script = CScript("userWaitForRequest")
+script.iReString = "User::WaitForRequest\s*\(\s*"
+script.iFileExts = ["cpp","inl"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/userafter.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,35 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# userafter.py
+#
+# Checks : Use of User::After.
+#
+# Reason : Generally, User::After() functions are used to skirt 
+# around timing problems. Typically, they should be removed and the 
+# defects fixed properly: that is, by waiting for the correct event 
+# to continue execution.
+#
+# #################################################################
+
+script = CScript("userafter")
+script.iReString = "User::After\s*\("
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryPerformance
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityMedium
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/userfree.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,35 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# userfree.py
+#
+# Checks : Using User::Free directly.
+#
+# Reason : User::Free() should never be called, because all objects 
+# free their memory on deletion; their destructors are not called 
+# and further resources cannot be freed or closed. This function 
+# should be removed and replaced by explicit deletes.
+#
+# #################################################################
+
+script = CScript("userfree")
+script.iReString = "User::Free\s*\("
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/variablenames.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,63 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# variablenames.py
+#
+# Checks : Local variables with member/argument names.
+#
+# Reason : Local variable names should be of the form localVariable 
+# and not aLocalVar or iLocalVar. Badly-named variables can be 
+# misleading and cause maintenance and coding errors.
+#
+# #################################################################
+
+script = CScript("variablenames")
+script.iReString = r"""
+	^\s*				# start of line plus optional whitespace
+	[A-Z]\w*			# class name e.g. TInt, CActive
+	\s*[\*&\s]\s*		# optional "*" or "&" plus at least one whitespace char
+	[ai][A-Z]\w*\s*		# a or i variable name plus optional whitespace
+	[;\(=]				# ";" or "(" or "="
+	"""
+script.iFileExts = ["cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+def bracecompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		checkline = currentline - 1
+		bracecount = 1
+		while (bracecount > 0) and (checkline >= 0):
+			bracecount -= lines[checkline].count("{")
+			bracecount += lines[checkline].count("}")
+			checkline -= 1
+
+		while (bracecount == 0) and (checkline >= 0):
+			if (lines[checkline].upper().find("CLASS") <> -1) or (lines[checkline].upper().find("STRUCT") <> -1):
+				return 0
+			
+			bracecount -= lines[checkline].count("{")
+			bracecount += lines[checkline].count("}")
+			checkline -= 1
+
+		return 1
+	else:
+		return 0
+
+script.iCompare = bracecompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/voidparameter.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,41 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# voidparameter.py
+#
+# Checks : Void parameter explicitly declared.
+#
+# Reason : Declaring a void parameter is unnecessary. A function 
+# declared as DoSomething(void) may as well be declared as 
+# DoSomething(). Void casts are also unnecessary.
+#
+# #################################################################
+
+script = CScript("voidparameter")
+script.iReString = r"""
+	\(				# opening bracket
+	\s*				# optional whitespace
+	void			# void paramater declaration
+	\s*				# optional whitespace
+	\)				# closing bracket
+	.*;				# skip to semicolon
+	"""
+script.iFileExts = ["h", "cpp"]
+script.iCategory = KCategoryCodingStandards
+script.iIgnore = KIgnoreCommentsAndQuotes
+script.iSeverity = KSeverityLow
+
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/scripts/worryingcomments.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,77 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# worryingcomments.py
+#
+# Checks : Worrying comments.
+#
+# Reason : Typically, exclamation and question marks in comments 
+# indicate that something odd is in the code or that it is 
+# unfinished or not understood fully.
+#
+# #################################################################
+
+script = CScript("worryingcomments")
+script.iFileExts = ["h", "cpp", "c"]
+script.iCategory = KCategoryCodeReviewGuides
+script.iIgnore = KIgnoreQuotes
+script.iSeverity = KSeverityLow
+
+reWordsStr = r"""\!|\?|[Zz]{3}|kludge|workaround|\scrap|hack"""
+scriptNode = script.ScriptConfig()
+if (scriptNode <> None):
+	for wordNode in scriptNode.getElementsByTagName("worryRE"):
+		reWordsStr = wordNode.firstChild.nodeValue
+		print "Note: 'worrying comments' pattern configured as: " + reWordsStr
+		break
+script.iReString = r"""
+	/(/|\*)						# "//" or "/*"
+	.*("""+reWordsStr+r""")		# skip to "!", "?", "zzz", "kludge", "workaround", " crap" or "hack"
+	"""
+
+def worryingcommentcodecompare(lines, currentline, rematch, filename):
+	m = rematch.search(lines[currentline])
+	if m:
+		line = lines[currentline]
+		i = 0
+		inCommentBlock = 0
+
+		while i < len(line):
+			if not inCommentBlock:
+				if (line[i] == "/"):
+					if (line[i + 1] == "/"):
+						# note i+3 to bypass the character after the start of the comment as can be an in-source documentation directive
+						return (line[i+3:].find("!")<>-1) or (line[i+3:].find("?")<>-1)
+					elif (line[i + 1] == "*"):
+						inCommentBlock = 1
+						i += 2
+						continue
+			else:
+				endIndex = line[i:].find("*/")
+				if (endIndex <> -1):
+					inCommentBlock = 0
+					# note, that first character is ignored in comments as can be direction to the in-source documentation tool
+					if (line[i+1:i + endIndex + 2].find("!") <> -1) or (line[i+1:i + endIndex + 2].find("?") <> -1):
+						return 1
+					i += endIndex + 2
+					continue
+				else:
+					return 1			
+			i += 1		
+	return 0
+
+script.iCompare = worryingcommentcodecompare
+scanner.AddScript(script)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/setup.py	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,42 @@
+# #################################################################
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+# 
+# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+# * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
+#
+# Description: A very simple setup script to create executable.
+#
+# Run the build process by entering 'setup.py py2exe' or
+# 'python setup.py py2exe' in a console prompt.
+#
+# If everything works well, you should find a subdirectory named 'dist'
+# containing some files.
+#
+# #################################################################
+
+from distutils.core import setup
+import py2exe
+
+setup(
+    # The first three parameters are not required, if at least a
+    # 'version' is given, then a versioninfo resource is built from
+    # them and added to the executables.
+    version = "1.2.0.0",
+    description = "CodeScanner",
+    name = "Nokia CodeScanner",
+    #company_name = "Nokia",
+    #copyright = "Copyright @ Nokia 2007",
+
+    # targets to build
+    console = ["codescanner.py"],
+)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/srcanamdw/codescanner/warncodescanner.txt	Thu Feb 18 12:29:02 2010 +0530
@@ -0,0 +1,50 @@
+W: no module named org (delayed import by xml.sax)
+W: no module named _dummy_threading (top-level import by dummy_threading)
+W: no module named xml.dom.EMPTY_PREFIX (top-level import by xml.dom.expatbuilder)
+W: no module named xml.dom.XMLNS_NAMESPACE (top-level import by xml.dom.expatbuilder)
+W: no module named pwd (delayed, conditional import by posixpath)
+W: no module named xml.dom.EMPTY_NAMESPACE (top-level import by xml.dom.minidom)
+W: no module named xml.dom.XMLNS_NAMESPACE (top-level import by xml.dom.minidom)
+W: no module named optik.__version__ (top-level import by optparse)
+W: no module named java (conditional import by xml.sax._exceptions)
+W: no module named pwd (delayed import by getpass)
+W: no module named posix (delayed, conditional import by iu)
+W: no module named EasyDialogs (conditional import by getpass)
+W: no module named termios (top-level import by getpass)
+W: no module named xml.dom.XML_NAMESPACE (delayed import by xml.dom.pulldom)
+W: no module named org (top-level import by copy)
+W: no module named fcntl (top-level import by tempfile)
+W: no module named xml.dom.EMPTY_PREFIX (top-level import by xml.dom.minidom)
+W: no module named xmlparse (top-level import by pyexpat)
+W: no module named xmltok (top-level import by pyexpat)
+W: no module named ic (delayed import by urllib)
+W: no module named _emx_link (conditional import by os)
+W: no module named posix (conditional import by os)
+W: no module named optik.__all__ (top-level import by optparse)
+W: no module named xml.dom.DOMImplementation (top-level import by xml.dom.domreg)
+W: no module named rourl2path (conditional import by urllib)
+W: no module named xml.dom.EMPTY_NAMESPACE (top-level import by xml.dom.expatbuilder)
+W: no module named SOCKS (top-level import by ftplib)
+W: no module named _xmlplus (top-level import by xml)
+W: no module named psyco (top-level import by __main__)
+W: no module named Carbon (conditional import by tempfile)
+W: __all__ is built strangely at line 0 - optparse (S:\codescanner\pyinstaller\optparse.pyc)
+W: __all__ is built strangely at line 0 - tokenize (c:\apps\actpython\lib\tokenize.pyc)
+W: delayed conditional eval hack detected at line 0 - gopherlib (c:\apps\actpython\lib\gopherlib.pyc)
+W: delayed  __import__ hack detected at line 0 - encodings (c:\apps\actpython\lib\encodings\__init__.pyc)
+W: __all__ is built strangely at line 0 - dummy_threading (c:\apps\actpython\lib\dummy_threading.pyc)
+W: top-level  exec statement detected at line 0 - hashlib (c:\apps\actpython\lib\hashlib.pyc)
+W: top-level conditional exec statement detected at line 0 - hashlib (c:\apps\actpython\lib\hashlib.pyc)
+W: delayed conditional eval hack detected at line 0 - warnings (c:\apps\actpython\lib\warnings.pyc)
+W: delayed conditional __import__ hack detected at line 0 - warnings (c:\apps\actpython\lib\warnings.pyc)
+W: delayed  __import__ hack detected at line 0 - email (c:\apps\actpython\lib\email\__init__.pyc)
+W: delayed conditional __import__ hack detected at line 0 - xml.dom.domreg (c:\apps\actpython\lib\xml\dom\domreg.pyc)
+W: delayed conditional exec statement detected at line 0 - iu (S:\codescanner\pyinstaller\iu.pyc)
+W: delayed conditional exec statement detected at line 0 - iu (S:\codescanner\pyinstaller\iu.pyc)
+W: delayed  __import__ hack detected at line 0 - optik.option_parser (S:\codescanner\pyinstaller\optik\option_parser.pyc)
+W: __all__ is built strangely at line 0 - optik (S:\codescanner\pyinstaller\optik\__init__.pyc)
+W: delayed  exec statement detected at line 0 - socket (c:\apps\actpython\lib\socket.pyc)
+W: delayed  eval hack detected at line 0 - os (c:\apps\actpython\lib\os.pyc)
+W: __all__ is built strangely at line 0 - __future__ (c:\apps\actpython\lib\__future__.pyc)
+W: delayed  __import__ hack detected at line 0 - xml.sax (c:\apps\actpython\lib\xml\sax\__init__.pyc)
+W: delayed  eval hack detected at line 0 - gettext (c:\apps\actpython\lib\gettext.pyc)