APT

Merge lp:~brian-murray/apt/history-log into lp:~ubuntu-core-dev/apt/ubuntu

Proposed by Brian Murray
Status: Merged
Merge reported by: Michael Vogt
Merged at revision: not available
Proposed branch: lp:~brian-murray/apt/history-log
Merge into: lp:~ubuntu-core-dev/apt/ubuntu
Diff against target: 389383 lines (+386902/-0) (has conflicts)
480 files modified
.bzr-builddeb/default.conf (+2/-0)
AUTHORS (+64/-0)
BUGS (+9/-0)
COMPILING (+85/-0)
COPYING (+23/-0)
COPYING.GPL (+340/-0)
Makefile (+34/-0)
README.MultiArch (+63/-0)
README.ddtp (+74/-0)
README.make (+112/-0)
README.progress-reporting (+69/-0)
abicheck/abi-compliance-checker.pl (+7325/-0)
abicheck/apt_build.xml.in (+11/-0)
abicheck/apt_installed.xml.in (+11/-0)
abicheck/run_abi_test (+14/-0)
aclocal.m4 (+2378/-0)
apt-inst/contrib/arfile.cc (+152/-0)
apt-inst/contrib/arfile.h (+66/-0)
apt-inst/contrib/extracttar.cc (+349/-0)
apt-inst/contrib/extracttar.h (+55/-0)
apt-inst/database.cc (+26/-0)
apt-inst/database.h (+52/-0)
apt-inst/deb/debfile.cc (+294/-0)
apt-inst/deb/debfile.h (+89/-0)
apt-inst/deb/dpkgdb.cc (+490/-0)
apt-inst/deb/dpkgdb.h (+50/-0)
apt-inst/dirstream.cc (+116/-0)
apt-inst/dirstream.h (+58/-0)
apt-inst/dpkg-diffs.txt (+5/-0)
apt-inst/extract.cc (+507/-0)
apt-inst/extract.h (+50/-0)
apt-inst/filelist.cc (+587/-0)
apt-inst/filelist.h (+312/-0)
apt-inst/makefile (+34/-0)
apt-pkg/acquire-item.cc (+2077/-0)
apt-pkg/acquire-item.h (+1023/-0)
apt-pkg/acquire-method.cc (+511/-0)
apt-pkg/acquire-method.h (+102/-0)
apt-pkg/acquire-worker.cc (+611/-0)
apt-pkg/acquire-worker.h (+322/-0)
apt-pkg/acquire.cc (+919/-0)
apt-pkg/acquire.h (+782/-0)
apt-pkg/algorithms.cc (+1466/-0)
apt-pkg/algorithms.h (+138/-0)
apt-pkg/aptconfiguration.cc (+459/-0)
apt-pkg/aptconfiguration.h (+118/-0)
apt-pkg/cachefile.cc (+184/-0)
apt-pkg/cachefile.h (+76/-0)
apt-pkg/cachefilter.cc (+54/-0)
apt-pkg/cachefilter.h (+29/-0)
apt-pkg/cacheiterators.h (+441/-0)
apt-pkg/cacheset.cc (+511/-0)
apt-pkg/cacheset.h (+389/-0)
apt-pkg/cdrom.cc (+948/-0)
apt-pkg/cdrom.h (+115/-0)
apt-pkg/clean.cc (+119/-0)
apt-pkg/clean.h (+28/-0)
apt-pkg/contrib/cdromutl.cc (+267/-0)
apt-pkg/contrib/cdromutl.h (+24/-0)
apt-pkg/contrib/cmndline.cc (+393/-0)
apt-pkg/contrib/cmndline.h (+105/-0)
apt-pkg/contrib/configuration.cc (+896/-0)
apt-pkg/contrib/configuration.h (+137/-0)
apt-pkg/contrib/crc-16.cc (+72/-0)
apt-pkg/contrib/crc-16.h (+17/-0)
apt-pkg/contrib/error.cc (+262/-0)
apt-pkg/contrib/error.h (+322/-0)
apt-pkg/contrib/fileutl.cc (+1046/-0)
apt-pkg/contrib/fileutl.h (+127/-0)
apt-pkg/contrib/hashes.cc (+126/-0)
apt-pkg/contrib/hashes.h (+74/-0)
apt-pkg/contrib/macros.h (+90/-0)
apt-pkg/contrib/md5.cc (+359/-0)
apt-pkg/contrib/md5.h (+77/-0)
apt-pkg/contrib/mmap.cc (+444/-0)
apt-pkg/contrib/mmap.h (+115/-0)
apt-pkg/contrib/netrc.cc (+211/-0)
apt-pkg/contrib/netrc.h (+29/-0)
apt-pkg/contrib/progress.cc (+219/-0)
apt-pkg/contrib/progress.h (+89/-0)
apt-pkg/contrib/sha1.cc (+357/-0)
apt-pkg/contrib/sha1.h (+67/-0)
apt-pkg/contrib/sha256.cc (+424/-0)
apt-pkg/contrib/sha256.h (+72/-0)
apt-pkg/contrib/sptr.h (+66/-0)
apt-pkg/contrib/strutl.cc (+1431/-0)
apt-pkg/contrib/strutl.h (+145/-0)
apt-pkg/contrib/weakptr.h (+64/-0)
apt-pkg/deb/debindexfile.cc (+717/-0)
apt-pkg/deb/debindexfile.h (+141/-0)
apt-pkg/deb/deblistparser.cc (+867/-0)
apt-pkg/deb/deblistparser.h (+79/-0)
apt-pkg/deb/debmetaindex.cc (+429/-0)
apt-pkg/deb/debmetaindex.h (+51/-0)
apt-pkg/deb/debrecords.cc (+179/-0)
apt-pkg/deb/debrecords.h (+54/-0)
apt-pkg/deb/debsrcrecords.cc (+173/-0)
apt-pkg/deb/debsrcrecords.h (+56/-0)
apt-pkg/deb/debsystem.cc (+233/-0)
apt-pkg/deb/debsystem.h (+43/-0)
apt-pkg/deb/debversion.cc (+282/-0)
apt-pkg/deb/debversion.h (+70/-0)
apt-pkg/deb/dpkgpm.cc (+1507/-0)
apt-pkg/deb/dpkgpm.h (+116/-0)
apt-pkg/depcache.cc (+1800/-0)
apt-pkg/depcache.h (+496/-0)
apt-pkg/indexcopy.cc (+929/-0)
apt-pkg/indexcopy.h (+104/-0)
apt-pkg/indexfile.cc (+103/-0)
apt-pkg/indexfile.h (+95/-0)
apt-pkg/indexrecords.cc (+212/-0)
apt-pkg/indexrecords.h (+59/-0)
apt-pkg/init.cc (+170/-0)
apt-pkg/init.h (+45/-0)
apt-pkg/makefile (+58/-0)
apt-pkg/metaindex.h (+51/-0)
apt-pkg/orderlist.cc (+1117/-0)
apt-pkg/orderlist.h (+117/-0)
apt-pkg/packagemanager.cc (+714/-0)
apt-pkg/packagemanager.h (+113/-0)
apt-pkg/pkgcache.cc (+900/-0)
apt-pkg/pkgcache.h (+693/-0)
apt-pkg/pkgcachegen.cc (+1321/-0)
apt-pkg/pkgcachegen.h (+181/-0)
apt-pkg/pkgrecords.cc (+72/-0)
apt-pkg/pkgrecords.h (+77/-0)
apt-pkg/pkgsystem.cc (+44/-0)
apt-pkg/pkgsystem.h (+94/-0)
apt-pkg/policy.cc (+400/-0)
apt-pkg/policy.h (+89/-0)
apt-pkg/sourcelist.cc (+344/-0)
apt-pkg/sourcelist.h (+100/-0)
apt-pkg/srcrecords.cc (+132/-0)
apt-pkg/srcrecords.h (+99/-0)
apt-pkg/tagfile.cc (+609/-0)
apt-pkg/tagfile.h (+124/-0)
apt-pkg/vendor.cc (+35/-0)
apt-pkg/vendor.h (+35/-0)
apt-pkg/vendorlist.cc (+154/-0)
apt-pkg/vendorlist.h (+50/-0)
apt-pkg/version.cc (+40/-0)
apt-pkg/version.h (+64/-0)
apt-pkg/versionmatch.cc (+275/-0)
apt-pkg/versionmatch.h (+78/-0)
autom4te.cache/output.0 (+9260/-0)
autom4te.cache/output.1 (+9260/-0)
autom4te.cache/requests (+196/-0)
autom4te.cache/traces.0 (+3504/-0)
autom4te.cache/traces.1 (+624/-0)
buildlib/apti18n.h.in (+28/-0)
buildlib/config.h.in (+43/-0)
buildlib/configure.mak (+35/-0)
buildlib/copy.mak (+31/-0)
buildlib/debiandoc.mak (+58/-0)
buildlib/defaults.mak (+183/-0)
buildlib/environment.mak.in (+69/-0)
buildlib/fail.mak (+20/-0)
buildlib/install-sh (+250/-0)
buildlib/inttypes.h.in (+50/-0)
buildlib/library.mak (+73/-0)
buildlib/libversion.mak (+14/-0)
buildlib/makefile.in (+51/-0)
buildlib/manpage.mak (+29/-0)
buildlib/mkChangeLog (+14/-0)
buildlib/netdb.h.in (+6/-0)
buildlib/po4a_manpage.mak (+64/-0)
buildlib/podomain.mak (+22/-0)
buildlib/program.mak (+60/-0)
buildlib/python.mak (+68/-0)
buildlib/sizetable (+25/-0)
buildlib/staticlibrary.mak (+60/-0)
buildlib/statvfs.h.in (+13/-0)
buildlib/tools.m4 (+110/-0)
cmdline/acqprogress.cc (+301/-0)
cmdline/acqprogress.h (+37/-0)
cmdline/apt-cache.cc (+1812/-0)
cmdline/apt-cdrom.cc (+283/-0)
cmdline/apt-config.cc (+135/-0)
cmdline/apt-extracttemplates.cc (+392/-0)
cmdline/apt-extracttemplates.h (+48/-0)
cmdline/apt-get.cc (+3356/-0)
cmdline/apt-key (+223/-0)
cmdline/apt-mark (+101/-0)
cmdline/apt-report-mirror-failure (+29/-0)
cmdline/apt-sortpkgs.cc (+208/-0)
cmdline/makefile (+68/-0)
configure (+9260/-0)
configure.in (+217/-0)
debian/NEWS (+59/-0)
debian/README.source (+6/-0)
debian/apt-doc.doc-base.guide (+13/-0)
debian/apt-doc.doc-base.offline (+13/-0)
debian/apt-doc.docs (+2/-0)
debian/apt-transport-https.README (+2/-0)
debian/apt-transport-https.dirs (+1/-0)
debian/apt-transport-https.install (+1/-0)
debian/apt-utils.dirs (+2/-0)
debian/apt-utils.examples (+1/-0)
debian/apt-utils.install (+1/-0)
debian/apt-utils.symbols (+121/-0)
debian/apt.bug-script (+33/-0)
debian/apt.conf.autoremove (+26/-0)
debian/apt.conf.changelog (+6/-0)
debian/apt.cron.daily (+517/-0)
debian/apt.dirs (+16/-0)
debian/apt.install (+5/-0)
debian/apt.lintian-overrides (+3/-0)
debian/apt.logrotate (+16/-0)
debian/apt.postinst (+41/-0)
debian/apt.symbols (+1303/-0)
debian/changelog (+7357/-0)
debian/compat (+1/-0)
debian/control (+80/-0)
debian/copyright (+23/-0)
debian/libapt-pkg-dev.dirs (+2/-0)
debian/libapt-pkg-dev.install (+3/-0)
debian/libapt-pkg-doc.doc-base.design (+14/-0)
debian/libapt-pkg-doc.doc-base.dpkg-tech (+13/-0)
debian/libapt-pkg-doc.doc-base.files (+14/-0)
debian/libapt-pkg-doc.doc-base.method (+14/-0)
debian/postinst (+39/-0)
debian/postrm (+22/-0)
debian/preinst (+32/-0)
debian/rules (+295/-0)
debian/source/format (+1/-0)
doc/Bugs (+174/-0)
doc/Doxyfile.in (+1515/-0)
doc/apt-cache.8.xml (+391/-0)
doc/apt-cdrom.8.xml (+171/-0)
doc/apt-config.8.xml (+119/-0)
doc/apt-extracttemplates.1.xml (+87/-0)
doc/apt-ftparchive.1.xml (+637/-0)
doc/apt-get.8.xml (+606/-0)
doc/apt-key.8.xml (+203/-0)
doc/apt-mark.8.xml (+141/-0)
doc/apt-secure.8.xml (+214/-0)
doc/apt-sortpkgs.1.xml (+82/-0)
doc/apt-verbatim.ent (+188/-0)
doc/apt.8 (+52/-0)
doc/apt.conf.5.xml (+1106/-0)
doc/apt.ent (+210/-0)
doc/apt_preferences.5.xml (+711/-0)
doc/design.sgml (+411/-0)
doc/dpkg-tech.sgml (+511/-0)
doc/examples/apt-ftparchive.conf (+46/-0)
doc/examples/apt-https-method-example.conf (+186/-0)
doc/examples/apt.conf (+32/-0)
doc/examples/configure-index (+458/-0)
doc/examples/ftp-archive.conf (+81/-0)
doc/examples/preferences (+11/-0)
doc/examples/sources.list (+11/-0)
doc/files.sgml (+345/-0)
doc/guide.sgml (+547/-0)
doc/lang.makefile (+11/-0)
doc/libapt-pkg2_to_3.txt (+89/-0)
doc/makefile (+108/-0)
doc/manpage-style.xsl (+9/-0)
doc/method.sgml (+354/-0)
doc/offline.sgml (+236/-0)
doc/po/apt-doc.pot (+8195/-0)
doc/po/de.po (+11359/-0)
doc/po/es.po (+11338/-0)
doc/po/fr.po (+11330/-0)
doc/po/it.po (+8559/-0)
doc/po/ja.po (+10956/-0)
doc/po/pl.po (+10219/-0)
doc/po/pt.po (+11220/-0)
doc/po/pt_BR.po (+8748/-0)
doc/po4a.conf (+38/-0)
doc/sources.list.5.xml (+242/-0)
doc/style.txt (+75/-0)
doc/xml.add (+5/-0)
dselect/desc.apt (+9/-0)
dselect/install (+110/-0)
dselect/makefile (+17/-0)
dselect/names (+1/-0)
dselect/setup (+286/-0)
dselect/update (+48/-0)
ftparchive/apt-ftparchive.cc (+1012/-0)
ftparchive/apt-ftparchive.h (+28/-0)
ftparchive/cachedb.cc (+474/-0)
ftparchive/cachedb.h (+137/-0)
ftparchive/contents.cc (+394/-0)
ftparchive/contents.h (+89/-0)
ftparchive/makefile (+20/-0)
ftparchive/multicompress.cc (+493/-0)
ftparchive/multicompress.h (+67/-0)
ftparchive/override.cc (+289/-0)
ftparchive/override.h (+51/-0)
ftparchive/writer.cc (+1095/-0)
ftparchive/writer.h (+205/-0)
methods/bzip2.cc (+172/-0)
methods/cdrom.cc (+281/-0)
methods/connect.cc (+245/-0)
methods/connect.h (+20/-0)
methods/copy.cc (+99/-0)
methods/file.cc (+96/-0)
methods/ftp.cc (+1124/-0)
methods/ftp.h (+82/-0)
methods/gpgv.cc (+262/-0)
methods/gzip.cc (+120/-0)
methods/http.cc (+1387/-0)
methods/http.h (+199/-0)
methods/http_main.cc (+20/-0)
methods/https.cc (+336/-0)
methods/https.h (+50/-0)
methods/makefile (+116/-0)
methods/mirror.cc (+436/-0)
methods/mirror.h (+56/-0)
methods/rfc2553emu.cc (+245/-0)
methods/rfc2553emu.h (+113/-0)
methods/rred.cc (+583/-0)
methods/rsh.cc (+520/-0)
methods/rsh.h (+70/-0)
mirror-failure.py (+23/-0)
po/ChangeLog (+1077/-0)
po/LINGUAS (+1/-0)
po/apt-all.pot (+3146/-0)
po/ar.po (+3219/-0)
po/ast.po (+3472/-0)
po/bg.po (+3513/-0)
po/bs.po (+3184/-0)
po/ca.po (+3551/-0)
po/cs.po (+3483/-0)
po/cy.po (+3552/-0)
po/da.po (+3430/-0)
po/de.po (+3524/-0)
po/dz.po (+3468/-0)
po/el.po (+3468/-0)
po/es.po (+4060/-0)
po/eu.po (+3421/-0)
po/fi.po (+3419/-0)
po/fr.po (+3586/-0)
po/gl.po (+3440/-0)
po/he.po (+2840/-0)
po/hu.po (+3458/-0)
po/it.po (+3520/-0)
po/ja.po (+3464/-0)
po/km.po (+3423/-0)
po/ko.po (+3400/-0)
po/ku.po (+3193/-0)
po/lt.po (+3309/-0)
po/makefile (+94/-0)
po/mr.po (+3439/-0)
po/nb.po (+3511/-0)
po/ne.po (+3430/-0)
po/nl.po (+3481/-0)
po/nn.po (+3459/-0)
po/pl.po (+3467/-0)
po/pt.po (+3648/-0)
po/pt_BR.po (+3567/-0)
po/ro.po (+3504/-0)
po/ru.po (+3510/-0)
po/sk.po (+3429/-0)
po/sl.po (+3626/-0)
po/sv.po (+3485/-0)
po/th.po (+3408/-0)
po/tl.po (+3505/-0)
po/uk.po (+3498/-0)
po/vi.po (+3475/-0)
po/zh_CN.po (+3451/-0)
po/zh_TW.po (+3365/-0)
share/apt-auth-failure.note (+11/-0)
test/authReliability/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-broken_Packages (+25/-0)
test/authReliability/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-broken_Release (+13/-0)
test/authReliability/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-broken_Release.gpg (+7/-0)
test/authReliability/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-ok_Packages (+25/-0)
test/authReliability/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-ok_Release (+13/-0)
test/authReliability/lists/people.ubuntu.com_%7emvo_apt_auth-test-suit_gpg-package-ok_Release.gpg (+7/-0)
test/authReliability/sources.list.failure (+2/-0)
test/authReliability/sources.list.good (+2/-0)
test/conf.cc (+37/-0)
test/conf_clear.cc (+23/-0)
test/extract-control.cc (+42/-0)
test/fake-status (+16/-0)
test/hash.cc (+70/-0)
test/integration/Packages-bug-590438-broken-provides-thanks-to-remove-order (+67/-0)
test/integration/Packages-bug-591882-conkeror (+1787/-0)
test/integration/Packages-bug-593360-modifiers-in-names (+42/-0)
test/integration/Packages-bug-598669-install-postfix-gets-exim-heavy (+30/-0)
test/integration/Packages-bug-604222-new-and-autoremove (+68/-0)
test/integration/Packages-bug-605394-versioned-or-groups (+71/-0)
test/integration/Packages-bug-64141-install-dependencies-for-on-hold (+42/-0)
test/integration/Packages-pdiff-usage (+34/-0)
test/integration/Packages-pdiff-usage-new (+37/-0)
test/integration/Packages-policy-pinning (+12/-0)
test/integration/Packages-releasefile-verification (+18/-0)
test/integration/Packages-releasefile-verification-new (+21/-0)
test/integration/Packages-ubuntu-bug-614993 (+1819/-0)
test/integration/Packages-xorg-break-providers (+52/-0)
test/integration/create-test-data (+47/-0)
test/integration/framework (+691/-0)
test/integration/run-tests (+27/-0)
test/integration/status-bug-590438-broken-provides-thanks-to-remove-order (+97/-0)
test/integration/status-bug-591882-conkeror (+1357/-0)
test/integration/status-bug-598669-install-postfix-gets-exim-heavy (+30/-0)
test/integration/status-bug-601961-install-info (+42/-0)
test/integration/status-bug-604222-new-and-autoremove (+10/-0)
test/integration/status-bug-605394-versioned-or-groups (+34/-0)
test/integration/status-bug-612557-garbage-upgrade (+34/-0)
test/integration/status-bug-613420-new-garbage-dependency (+22/-0)
test/integration/status-bug-64141-install-dependencies-for-on-hold (+33/-0)
test/integration/status-ubuntu-bug-614993 (+5894/-0)
test/integration/status-xorg-break-providers (+22/-0)
test/integration/test-apt-get-autoremove (+51/-0)
test/integration/test-apt-get-changelog (+36/-0)
test/integration/test-apt-get-download (+29/-0)
test/integration/test-bug-254770-segfault-if-cache-not-buildable (+57/-0)
test/integration/test-bug-330162-encoded-tar-header (+11/-0)
test/integration/test-bug-549968-install-depends-of-not-installed (+26/-0)
test/integration/test-bug-590041-prefer-non-virtual-packages (+51/-0)
test/integration/test-bug-590438-broken-provides-thanks-to-remove-order (+98/-0)
test/integration/test-bug-591882-conkeror (+75/-0)
test/integration/test-bug-593360-modifiers-in-names (+64/-0)
test/integration/test-bug-595691-empty-and-broken-archive-files (+144/-0)
test/integration/test-bug-598669-install-postfix-gets-exim-heavy (+19/-0)
test/integration/test-bug-601016-description-translation (+92/-0)
test/integration/test-bug-601961-install-info (+38/-0)
test/integration/test-bug-604222-new-and-autoremove (+66/-0)
test/integration/test-bug-604401-files-are-directories (+66/-0)
test/integration/test-bug-605394-versioned-or-groups (+25/-0)
test/integration/test-bug-611729-mark-as-manual (+84/-0)
test/integration/test-bug-612099-multiarch-conflicts (+212/-0)
test/integration/test-bug-612557-garbage-upgrade (+60/-0)
test/integration/test-bug-612958-use-dpkg-multiarch-config (+59/-0)
test/integration/test-bug-613420-new-garbage-dependency (+37/-0)
test/integration/test-bug-618848-always-respect-user-requests (+32/-0)
test/integration/test-bug-64141-install-dependencies-for-on-hold (+34/-0)
test/integration/test-compressed-indexes (+132/-0)
test/integration/test-disappearing-packages (+54/-0)
test/integration/test-pdiff-usage (+45/-0)
test/integration/test-policy-pinning (+228/-0)
test/integration/test-release-candidate-switching (+419/-0)
test/integration/test-releasefile-verification (+160/-0)
test/integration/test-ubuntu-bug-365611-long-package-names (+11/-0)
test/integration/test-ubuntu-bug-614993 (+59/-0)
test/integration/test-xorg-break-providers (+43/-0)
test/libapt/assert.h (+21/-0)
test/libapt/commandlineasstring_test.cc (+39/-0)
test/libapt/compareversion_test.cc (+123/-0)
test/libapt/getarchitectures_test.cc (+61/-0)
test/libapt/getlanguages_test.cc (+182/-0)
test/libapt/getlistoffilesindir_test.cc (+82/-0)
test/libapt/globalerror_test.cc (+109/-0)
test/libapt/makefile (+48/-0)
test/libapt/parsedepends_test.cc (+196/-0)
test/libapt/run-tests (+66/-0)
test/local-repo/Packages (+11/-0)
test/local-repo/Release (+13/-0)
test/local-repo/Release.gpg (+7/-0)
test/makefile (+74/-0)
test/mthdcat.cc (+20/-0)
test/networkless-install-fixes/README (+5/-0)
test/networkless-install-fixes/sources.test.list (+25/-0)
test/networkless-install-fixes/test.sh (+25/-0)
test/pre-upload-check.py (+266/-0)
test/rpmver.cc (+117/-0)
test/scratch.cc (+105/-0)
test/test-indexes.sh (+235/-0)
test/test_udevcdrom.cc (+19/-0)
test/testdeb.cc (+39/-0)
test/testextract.cc (+98/-0)
test/testkeys/mvo.key (+1182/-0)
test/testsources.list/sources.list.all-gpg-broken (+2/-0)
test/testsources.list/sources.list.all-gpg-ok (+2/-0)
test/testsources.list/sources.list.all-release-broken (+1/-0)
test/testsources.list/sources.list.all-release-ok (+1/-0)
test/testsources.list/sources.list.all-validuntil-broken (+1/-0)
test/testsources.list/sources.list.md5-package-broken (+2/-0)
test/testsources.list/sources.list.md5-package-ok (+2/-0)
test/testsources.list/sources.list.md5-release-broken (+1/-0)
test/testsources.list/sources.list.md5-release-ok (+1/-0)
test/testsources.list/sources.list.sha1-release-broken (+1/-0)
test/testsources.list/sources.list.sha1-release-ok (+1/-0)
test/testsources.list/sources.list.sha256-package-broken (+2/-0)
test/testsources.list/sources.list.sha256-package-ok (+2/-0)
test/testsources.list/sources.list.sha256-release-broken (+1/-0)
test/testsources.list/sources.list.sha256-release-ok (+1/-0)
test/uri.cc (+34/-0)
test/versions.lst (+106/-0)
Conflict adding file .bzr-builddeb.  Moved existing file to .bzr-builddeb.moved.
Conflict adding file AUTHORS.  Moved existing file to AUTHORS.moved.
Conflict adding file BUGS.  Moved existing file to BUGS.moved.
Conflict adding file COMPILING.  Moved existing file to COMPILING.moved.
Conflict adding file COPYING.GPL.  Moved existing file to COPYING.GPL.moved.
Conflict adding file COPYING.  Moved existing file to COPYING.moved.
Conflict adding file Makefile.  Moved existing file to Makefile.moved.
Conflict adding file README.MultiArch.  Moved existing file to README.MultiArch.moved.
Conflict adding file README.ddtp.  Moved existing file to README.ddtp.moved.
Conflict adding file README.make.  Moved existing file to README.make.moved.
Conflict adding file README.progress-reporting.  Moved existing file to README.progress-reporting.moved.
Conflict adding file abicheck.  Moved existing file to abicheck.moved.
Conflict adding file apt-inst.  Moved existing file to apt-inst.moved.
Conflict adding file apt-pkg.  Moved existing file to apt-pkg.moved.
Conflict adding file buildlib.  Moved existing file to buildlib.moved.
Conflict adding file cmdline.  Moved existing file to cmdline.moved.
Conflict adding file configure.in.  Moved existing file to configure.in.moved.
Conflict adding file debian.  Moved existing file to debian.moved.
Conflict adding file doc.  Moved existing file to doc.moved.
Conflict adding file dselect.  Moved existing file to dselect.moved.
Conflict adding file ftparchive.  Moved existing file to ftparchive.moved.
Conflict adding file methods.  Moved existing file to methods.moved.
Conflict adding file mirror-failure.py.  Moved existing file to mirror-failure.py.moved.
Conflict adding file po.  Moved existing file to po.moved.
Conflict adding file share.  Moved existing file to share.moved.
Conflict adding file test.  Moved existing file to test.moved.
To merge this branch: bzr merge lp:~brian-murray/apt/history-log
Reviewer Review Type Date Requested Status
Michael Vogt (community) Approve
Ubuntu Core Development Team Pending
Review via email: mp+63163@code.launchpad.net

Description of the change

This branch adds in /var/log/apt/history.log to apport-package bug reports. Additionally, it prevents writing of apport reports in the event that dpkg returns an ENOENT error.

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks a bunch! I fixed a small typo and merged it. Please note that I couldn't merge directly as lp:ubuntu/apt does not point to lp:~ubuntu-core-dev/apt/ubuntu I need to figure out how to fix this.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory '.bzr-builddeb'
2=== renamed directory '.bzr-builddeb' => '.bzr-builddeb.moved'
3=== added file '.bzr-builddeb/default.conf'
4--- .bzr-builddeb/default.conf 1970-01-01 00:00:00 +0000
5+++ .bzr-builddeb/default.conf 2011-06-01 19:45:47 +0000
6@@ -0,0 +1,2 @@
7+[BUILDDEB]
8+native = True
9
10=== added file 'AUTHORS'
11--- AUTHORS 1970-01-01 00:00:00 +0000
12+++ AUTHORS 2011-06-01 19:45:47 +0000
13@@ -0,0 +1,64 @@
14+The project contributors:
15+
16+Michael Vogt <mvo@debian.org>
17+- Development, bug fixes
18+
19+David Kalnischkies <kalnischkies+debian@gmail.com>
20+- Development, bug fixes
21+
22+Christian Perrier <bubulle@debian.org>
23+- Translations hero/coordinator
24+
25+
26+Past Contributors:
27+
28+Robert Collins <robert.collins@canonical.com>
29+- Change the package index Info methods to allow apt-cache policy to be useful
30+ when using several different archives on the same host.
31+
32+Julian Andres Klode
33+- Development, bug fixes
34+
35+Eugene V. Lyubimkin
36+- Development, bug fixes
37+
38+Otavio Salvador
39+- Development, bug fixes
40+
41+Luca Bruno
42+- Development, bug fixes
43+
44+CVS:jgg Jason Gunthorpe <jgg@debian.org>
45+- The Mad Cow incarnate
46+
47+CVS:mdz Matt Zimmerman <mdz@debian.org>
48+- Ongoing maintenance and coordination of development
49+
50+CVS:piefel Michael Piefel <piefel@debian.org>
51+- i18n and l10n
52+
53+CVS:che Ben Gertzfield <che@debian.org>
54+- Packaging and Releases
55+
56+CVS:bod Brendan O'Dea <bod@debian.org>
57+- Perl Bindings
58+
59+CVS:tausq Randolph Chung <tausq@debian.org>
60+- Patches, Fixes, Debugging, GUIs and Releases
61+
62+Isaac Jones <ijones@syntaxpolice.org> and Colin Walters <walters@debian.org>
63+ Initial implementation of authentication support (Release.gpg)
64+
65+Brian White <bcwhite@verisim.com> - Project originator
66+Tom Lees <tom@lpsg.demon.co.uk> - DPKG documentation and ideas
67+Behan Webster <behanw@verisim.com> - Original GUI design
68+Scott Ellis <storm@gate.net> - Original packaging and beta releases
69+Branden Robinson <branden@purdue.edu> - Man Page Documentation
70+Manoj Srivastava <srivasta@datasync.com> - 1st Generation FTP method and
71+ dselect setup script
72+Adam Heath <doogie@debian.org> - 2nd Generation FTP method author
73+Ben Collins <bcollins@debian.org> - Initial RSH method
74+Many other bug reports through the Debian Bug system
75+
76+NOTE: The ChangeLog generator will parse for names and email addresses. The
77+'CVS:<name>' tag should indicate who this pair refers to.
78
79=== renamed file 'AUTHORS' => 'AUTHORS.moved'
80=== added file 'BUGS'
81--- BUGS 1970-01-01 00:00:00 +0000
82+++ BUGS 2011-06-01 19:45:47 +0000
83@@ -0,0 +1,9 @@
84+
85+DDTP problems:
86+--------------
87+- apt-get update clean the /var/lib/apt/lists dir
88+ from all Translation-$index that are not in the current
89+ enviroment or Translations apt variable
90+- there needs to be a list of locales (pt, sv, en) that need
91+ both language and country code to get the right file
92+ (is in the code in indexfile::LanguageCode(), just a bit ugly
93
94=== renamed file 'BUGS' => 'BUGS.moved'
95=== added file 'COMPILING'
96--- COMPILING 1970-01-01 00:00:00 +0000
97+++ COMPILING 2011-06-01 19:45:47 +0000
98@@ -0,0 +1,85 @@
99+General Information
100+~~~~~~~~~~~~~~~~~~~
101+To compile this you need a couple things
102+ - A working POSIX system with working POSIX gcc, g++, make (GNU),
103+ ar, sh, awk and sed in the path
104+ - GNU Make 3.74 or so, -- normal UNIX make will NOT work
105+ * Note 3.77 is broken.
106+ - A working ANSI C++ compiler, this is not g++ 2.7.*
107+ g++ 2.8 works OK and newer egcs work well also. Nobody has tried it
108+ on other compilers :< You will need a properly working STL as well.
109+ - A C library with the usual POSIX functions and a BSD socket layer.
110+ If your OS conforms to the Single Unix Spec then you are fine:
111+ http://www.opengroup.org/onlinepubs/7908799/index.html
112+ - Refer to the Build-Depends information in debian/control for
113+ additional requirements (some of which are Debian-specific)
114+
115+** NOTICE **
116+The C++ global constructors do not link correctly when using non-shared
117+libraries. This is probably the correct behavior of the linker, but I have
118+not yet had time to devise a work around for it. The correct thing to
119+do is add a reference to debSystem in apt-pkg/init.cc,
120+assert(&debSystem == 0) would be fine for instance.
121+
122+Guidelines
123+~~~~~~~~~~
124+I am not interested in making 'ultra portable code'. I will accept patches
125+to make the code that already exists conform more to SUS or POSIX, but
126+I don't really care if your not-SUS OS doesn't work. It is simply too
127+much work to maintain patches for dysfunctional OSs. I highly suggest you
128+contact your vendor and express intrest in a conforming C library.
129+
130+That said, there are lots of finicky problems that must be dealt with even
131+between the supported OS's. Primarily the path I choose to take is to put
132+a shim header file in build/include that transparently adds the required
133+functionality. Patches to make autoconf detect these cases and generate the
134+required shims are OK.
135+
136+Current shims:
137+ * C99 integer types 'inttypes.h'
138+ * sys/statvfs.h to convert from BSD/old-glibc statfs to SUS statvfs
139+ * rfc2553 hostname resolution (methods/rfc*), shims to normal gethostbyname.
140+ The more adventurous could steal the KAME IPv6 enabled resolvers for those
141+ OS's with IPv6 support but no rfc2553 (why?)
142+ * define _XOPEN_EXTENDED_SOURCE to bring in h_errno on HP-UX
143+ * socklen_t shim in netdb.h if the OS does not have socklen_t
144+
145+The only completely non-shimmed OS is Linux with glibc2.1, glibc2.0 requires
146+the first three shims.
147+
148+Platform Notes
149+~~~~~~~~~~~~~~
150+Debian GNU Linux 2.1 'slink'
151+Debian GNU Linux 'potato'
152+Debian GNU Linux 'woody'
153+ * All Archs
154+ - Works flawlessly
155+ - You will want to have debiandoc-sgml and docbook2man installed to get
156+ best results.
157+ - No IPv6 Support in glibc's < 2.1.
158+
159+Sun Solaris
160+ SunOS cab101 5.7 Generic_106541-04 sun4u sparc
161+ SunOS csu201 5.8 Generic_108528-04 sun4u sparc
162+ - Works fine
163+ - Note, no IPv6 Support, OS lacks RFC 2553 hostname resolution
164+
165+OpenBSD
166+ OpenBSD gsb086 2.5 CMPUT#0 i386 unknown
167+ OpenBSD csu101 2.7 CMPUT#1 i386 unknown
168+ - OS needs 'ranlib' to generate the symbol table after 'ar'.. (not using
169+ GNU ar with the gnu tool chain :<)
170+ - '2.5' does not have RFC 2553 hostname resolution, but '2.7' does
171+ - Testing on '2.7' suggests the OS has a bug in its handling of
172+ ftruncate on files that have been written via mmap. It fills the page
173+ that crosses the truncation boundary with 0's.
174+
175+HP-UX
176+ HP-UX nyquist B.10.20 C 9000/780 2016574337 32-user license
177+ - Evil OS, does not conform very well to SUS
178+ 1) snprintf exists but is not prototyped, ignore spurious warnings
179+ 2) No socklen_t
180+ 3) Requires -D_XOPEN_SOURCE_EXTENDED for h_errno
181+ configure should fix the last two (see above)
182+ - Note, no IPv6 Support, OS lacks RFC 2553 hostname resolution
183+
184
185=== renamed file 'COMPILING' => 'COMPILING.moved'
186=== added file 'COPYING'
187--- COPYING 1970-01-01 00:00:00 +0000
188+++ COPYING 2011-06-01 19:45:47 +0000
189@@ -0,0 +1,23 @@
190+Apt is copyright 1997, 1998, 1999 Jason Gunthorpe and others.
191+Apt is currently developed by APT Development Team <deity@lists.debian.org>.
192+
193+License: GPLv2+
194+
195+ This program is free software; you can redistribute it and/or modify
196+ it under the terms of the GNU General Public License as published by
197+ the Free Software Foundation; either version 2 of the License, or
198+ (at your option) any later version.
199+
200+ This program is distributed in the hope that it will be useful,
201+ but WITHOUT ANY WARRANTY; without even the implied warranty of
202+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
203+ GNU General Public License for more details.
204+
205+ You should have received a copy of the GNU General Public License
206+ along with this program; if not, write to the Free Software
207+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
208+
209+See /usr/share/common-licenses/GPL-2, or
210+<http://www.gnu.org/copyleft/gpl.txt> for the terms of the latest version
211+of the GNU General Public License.
212+
213
214=== added file 'COPYING.GPL'
215--- COPYING.GPL 1970-01-01 00:00:00 +0000
216+++ COPYING.GPL 2011-06-01 19:45:47 +0000
217@@ -0,0 +1,340 @@
218+ GNU GENERAL PUBLIC LICENSE
219+ Version 2, June 1991
220+
221+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
222+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
223+ Everyone is permitted to copy and distribute verbatim copies
224+ of this license document, but changing it is not allowed.
225+
226+ Preamble
227+
228+ The licenses for most software are designed to take away your
229+freedom to share and change it. By contrast, the GNU General Public
230+License is intended to guarantee your freedom to share and change free
231+software--to make sure the software is free for all its users. This
232+General Public License applies to most of the Free Software
233+Foundation's software and to any other program whose authors commit to
234+using it. (Some other Free Software Foundation software is covered by
235+the GNU Library General Public License instead.) You can apply it to
236+your programs, too.
237+
238+ When we speak of free software, we are referring to freedom, not
239+price. Our General Public Licenses are designed to make sure that you
240+have the freedom to distribute copies of free software (and charge for
241+this service if you wish), that you receive source code or can get it
242+if you want it, that you can change the software or use pieces of it
243+in new free programs; and that you know you can do these things.
244+
245+ To protect your rights, we need to make restrictions that forbid
246+anyone to deny you these rights or to ask you to surrender the rights.
247+These restrictions translate to certain responsibilities for you if you
248+distribute copies of the software, or if you modify it.
249+
250+ For example, if you distribute copies of such a program, whether
251+gratis or for a fee, you must give the recipients all the rights that
252+you have. You must make sure that they, too, receive or can get the
253+source code. And you must show them these terms so they know their
254+rights.
255+
256+ We protect your rights with two steps: (1) copyright the software, and
257+(2) offer you this license which gives you legal permission to copy,
258+distribute and/or modify the software.
259+
260+ Also, for each author's protection and ours, we want to make certain
261+that everyone understands that there is no warranty for this free
262+software. If the software is modified by someone else and passed on, we
263+want its recipients to know that what they have is not the original, so
264+that any problems introduced by others will not reflect on the original
265+authors' reputations.
266+
267+ Finally, any free program is threatened constantly by software
268+patents. We wish to avoid the danger that redistributors of a free
269+program will individually obtain patent licenses, in effect making the
270+program proprietary. To prevent this, we have made it clear that any
271+patent must be licensed for everyone's free use or not licensed at all.
272+
273+ The precise terms and conditions for copying, distribution and
274+modification follow.
275+
276
277+ GNU GENERAL PUBLIC LICENSE
278+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
279+
280+ 0. This License applies to any program or other work which contains
281+a notice placed by the copyright holder saying it may be distributed
282+under the terms of this General Public License. The "Program", below,
283+refers to any such program or work, and a "work based on the Program"
284+means either the Program or any derivative work under copyright law:
285+that is to say, a work containing the Program or a portion of it,
286+either verbatim or with modifications and/or translated into another
287+language. (Hereinafter, translation is included without limitation in
288+the term "modification".) Each licensee is addressed as "you".
289+
290+Activities other than copying, distribution and modification are not
291+covered by this License; they are outside its scope. The act of
292+running the Program is not restricted, and the output from the Program
293+is covered only if its contents constitute a work based on the
294+Program (independent of having been made by running the Program).
295+Whether that is true depends on what the Program does.
296+
297+ 1. You may copy and distribute verbatim copies of the Program's
298+source code as you receive it, in any medium, provided that you
299+conspicuously and appropriately publish on each copy an appropriate
300+copyright notice and disclaimer of warranty; keep intact all the
301+notices that refer to this License and to the absence of any warranty;
302+and give any other recipients of the Program a copy of this License
303+along with the Program.
304+
305+You may charge a fee for the physical act of transferring a copy, and
306+you may at your option offer warranty protection in exchange for a fee.
307+
308+ 2. You may modify your copy or copies of the Program or any portion
309+of it, thus forming a work based on the Program, and copy and
310+distribute such modifications or work under the terms of Section 1
311+above, provided that you also meet all of these conditions:
312+
313+ a) You must cause the modified files to carry prominent notices
314+ stating that you changed the files and the date of any change.
315+
316+ b) You must cause any work that you distribute or publish, that in
317+ whole or in part contains or is derived from the Program or any
318+ part thereof, to be licensed as a whole at no charge to all third
319+ parties under the terms of this License.
320+
321+ c) If the modified program normally reads commands interactively
322+ when run, you must cause it, when started running for such
323+ interactive use in the most ordinary way, to print or display an
324+ announcement including an appropriate copyright notice and a
325+ notice that there is no warranty (or else, saying that you provide
326+ a warranty) and that users may redistribute the program under
327+ these conditions, and telling the user how to view a copy of this
328+ License. (Exception: if the Program itself is interactive but
329+ does not normally print such an announcement, your work based on
330+ the Program is not required to print an announcement.)
331+
332
333+These requirements apply to the modified work as a whole. If
334+identifiable sections of that work are not derived from the Program,
335+and can be reasonably considered independent and separate works in
336+themselves, then this License, and its terms, do not apply to those
337+sections when you distribute them as separate works. But when you
338+distribute the same sections as part of a whole which is a work based
339+on the Program, the distribution of the whole must be on the terms of
340+this License, whose permissions for other licensees extend to the
341+entire whole, and thus to each and every part regardless of who wrote it.
342+
343+Thus, it is not the intent of this section to claim rights or contest
344+your rights to work written entirely by you; rather, the intent is to
345+exercise the right to control the distribution of derivative or
346+collective works based on the Program.
347+
348+In addition, mere aggregation of another work not based on the Program
349+with the Program (or with a work based on the Program) on a volume of
350+a storage or distribution medium does not bring the other work under
351+the scope of this License.
352+
353+ 3. You may copy and distribute the Program (or a work based on it,
354+under Section 2) in object code or executable form under the terms of
355+Sections 1 and 2 above provided that you also do one of the following:
356+
357+ a) Accompany it with the complete corresponding machine-readable
358+ source code, which must be distributed under the terms of Sections
359+ 1 and 2 above on a medium customarily used for software interchange; or,
360+
361+ b) Accompany it with a written offer, valid for at least three
362+ years, to give any third party, for a charge no more than your
363+ cost of physically performing source distribution, a complete
364+ machine-readable copy of the corresponding source code, to be
365+ distributed under the terms of Sections 1 and 2 above on a medium
366+ customarily used for software interchange; or,
367+
368+ c) Accompany it with the information you received as to the offer
369+ to distribute corresponding source code. (This alternative is
370+ allowed only for noncommercial distribution and only if you
371+ received the program in object code or executable form with such
372+ an offer, in accord with Subsection b above.)
373+
374+The source code for a work means the preferred form of the work for
375+making modifications to it. For an executable work, complete source
376+code means all the source code for all modules it contains, plus any
377+associated interface definition files, plus the scripts used to
378+control compilation and installation of the executable. However, as a
379+special exception, the source code distributed need not include
380+anything that is normally distributed (in either source or binary
381+form) with the major components (compiler, kernel, and so on) of the
382+operating system on which the executable runs, unless that component
383+itself accompanies the executable.
384+
385+If distribution of executable or object code is made by offering
386+access to copy from a designated place, then offering equivalent
387+access to copy the source code from the same place counts as
388+distribution of the source code, even though third parties are not
389+compelled to copy the source along with the object code.
390+
391
392+ 4. You may not copy, modify, sublicense, or distribute the Program
393+except as expressly provided under this License. Any attempt
394+otherwise to copy, modify, sublicense or distribute the Program is
395+void, and will automatically terminate your rights under this License.
396+However, parties who have received copies, or rights, from you under
397+this License will not have their licenses terminated so long as such
398+parties remain in full compliance.
399+
400+ 5. You are not required to accept this License, since you have not
401+signed it. However, nothing else grants you permission to modify or
402+distribute the Program or its derivative works. These actions are
403+prohibited by law if you do not accept this License. Therefore, by
404+modifying or distributing the Program (or any work based on the
405+Program), you indicate your acceptance of this License to do so, and
406+all its terms and conditions for copying, distributing or modifying
407+the Program or works based on it.
408+
409+ 6. Each time you redistribute the Program (or any work based on the
410+Program), the recipient automatically receives a license from the
411+original licensor to copy, distribute or modify the Program subject to
412+these terms and conditions. You may not impose any further
413+restrictions on the recipients' exercise of the rights granted herein.
414+You are not responsible for enforcing compliance by third parties to
415+this License.
416+
417+ 7. If, as a consequence of a court judgment or allegation of patent
418+infringement or for any other reason (not limited to patent issues),
419+conditions are imposed on you (whether by court order, agreement or
420+otherwise) that contradict the conditions of this License, they do not
421+excuse you from the conditions of this License. If you cannot
422+distribute so as to satisfy simultaneously your obligations under this
423+License and any other pertinent obligations, then as a consequence you
424+may not distribute the Program at all. For example, if a patent
425+license would not permit royalty-free redistribution of the Program by
426+all those who receive copies directly or indirectly through you, then
427+the only way you could satisfy both it and this License would be to
428+refrain entirely from distribution of the Program.
429+
430+If any portion of this section is held invalid or unenforceable under
431+any particular circumstance, the balance of the section is intended to
432+apply and the section as a whole is intended to apply in other
433+circumstances.
434+
435+It is not the purpose of this section to induce you to infringe any
436+patents or other property right claims or to contest validity of any
437+such claims; this section has the sole purpose of protecting the
438+integrity of the free software distribution system, which is
439+implemented by public license practices. Many people have made
440+generous contributions to the wide range of software distributed
441+through that system in reliance on consistent application of that
442+system; it is up to the author/donor to decide if he or she is willing
443+to distribute software through any other system and a licensee cannot
444+impose that choice.
445+
446+This section is intended to make thoroughly clear what is believed to
447+be a consequence of the rest of this License.
448+
449
450+ 8. If the distribution and/or use of the Program is restricted in
451+certain countries either by patents or by copyrighted interfaces, the
452+original copyright holder who places the Program under this License
453+may add an explicit geographical distribution limitation excluding
454+those countries, so that distribution is permitted only in or among
455+countries not thus excluded. In such case, this License incorporates
456+the limitation as if written in the body of this License.
457+
458+ 9. The Free Software Foundation may publish revised and/or new versions
459+of the General Public License from time to time. Such new versions will
460+be similar in spirit to the present version, but may differ in detail to
461+address new problems or concerns.
462+
463+Each version is given a distinguishing version number. If the Program
464+specifies a version number of this License which applies to it and "any
465+later version", you have the option of following the terms and conditions
466+either of that version or of any later version published by the Free
467+Software Foundation. If the Program does not specify a version number of
468+this License, you may choose any version ever published by the Free Software
469+Foundation.
470+
471+ 10. If you wish to incorporate parts of the Program into other free
472+programs whose distribution conditions are different, write to the author
473+to ask for permission. For software which is copyrighted by the Free
474+Software Foundation, write to the Free Software Foundation; we sometimes
475+make exceptions for this. Our decision will be guided by the two goals
476+of preserving the free status of all derivatives of our free software and
477+of promoting the sharing and reuse of software generally.
478+
479+ NO WARRANTY
480+
481+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
482+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
483+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
484+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
485+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
486+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
487+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
488+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
489+REPAIR OR CORRECTION.
490+
491+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
492+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
493+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
494+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
495+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
496+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
497+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
498+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
499+POSSIBILITY OF SUCH DAMAGES.
500+
501+ END OF TERMS AND CONDITIONS
502+
503
504+ How to Apply These Terms to Your New Programs
505+
506+ If you develop a new program, and you want it to be of the greatest
507+possible use to the public, the best way to achieve this is to make it
508+free software which everyone can redistribute and change under these terms.
509+
510+ To do so, attach the following notices to the program. It is safest
511+to attach them to the start of each source file to most effectively
512+convey the exclusion of warranty; and each file should have at least
513+the "copyright" line and a pointer to where the full notice is found.
514+
515+ <one line to give the program's name and a brief idea of what it does.>
516+ Copyright (C) 19yy <name of author>
517+
518+ This program is free software; you can redistribute it and/or modify
519+ it under the terms of the GNU General Public License as published by
520+ the Free Software Foundation; either version 2 of the License, or
521+ (at your option) any later version.
522+
523+ This program is distributed in the hope that it will be useful,
524+ but WITHOUT ANY WARRANTY; without even the implied warranty of
525+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
526+ GNU General Public License for more details.
527+
528+ You should have received a copy of the GNU General Public License
529+ along with this program; if not, write to the Free Software
530+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
531+
532+
533+Also add information on how to contact you by electronic and paper mail.
534+
535+If the program is interactive, make it output a short notice like this
536+when it starts in an interactive mode:
537+
538+ Gnomovision version 69, Copyright (C) 19yy name of author
539+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
540+ This is free software, and you are welcome to redistribute it
541+ under certain conditions; type `show c' for details.
542+
543+The hypothetical commands `show w' and `show c' should show the appropriate
544+parts of the General Public License. Of course, the commands you use may
545+be called something other than `show w' and `show c'; they could even be
546+mouse-clicks or menu items--whatever suits your program.
547+
548+You should also get your employer (if you work as a programmer) or your
549+school, if any, to sign a "copyright disclaimer" for the program, if
550+necessary. Here is a sample; alter the names:
551+
552+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
553+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
554+
555+ <signature of Ty Coon>, 1 April 1989
556+ Ty Coon, President of Vice
557+
558+This General Public License does not permit incorporating your program into
559+proprietary programs. If your program is a subroutine library, you may
560+consider it more useful to permit linking proprietary applications with the
561+library. If this is what you want to do, use the GNU Library General
562+Public License instead of this License.
563
564=== renamed file 'COPYING.GPL' => 'COPYING.GPL.moved'
565=== renamed file 'COPYING' => 'COPYING.moved'
566=== added file 'Makefile'
567--- Makefile 1970-01-01 00:00:00 +0000
568+++ Makefile 2011-06-01 19:45:47 +0000
569@@ -0,0 +1,34 @@
570+# -*- make -*-
571+
572+# This is the top level make file for APT, it recurses to each lower
573+# level make file and runs it with the proper target
574+ifndef NOISY
575+.SILENT:
576+endif
577+
578+.PHONY: default
579+default: startup all
580+
581+.PHONY: headers library clean veryclean all binary program doc
582+all headers library clean veryclean binary program doc dirs:
583+ $(MAKE) -C apt-pkg $@
584+ $(MAKE) -C apt-inst $@
585+ $(MAKE) -C methods $@
586+ $(MAKE) -C cmdline $@
587+ $(MAKE) -C ftparchive $@
588+ $(MAKE) -C dselect $@
589+ $(MAKE) -C doc $@
590+ $(MAKE) -C po $@
591+
592+# Some very common aliases
593+.PHONY: maintainer-clean dist-clean distclean pristine sanity
594+maintainer-clean dist-clean distclean pristine sanity: veryclean
595+
596+# The startup target builds the necessary configure scripts. It should
597+# be used after a CVS checkout.
598+CONVERTED=environment.mak include/config.h include/apti18n.h build/doc/Doxyfile makefile
599+include buildlib/configure.mak
600+$(BUILDDIR)/include/config.h: buildlib/config.h.in
601+$(BUILDDIR)/include/apti18n.h: buildlib/apti18n.h.in
602+$(BUILDDIR)/environment.mak: buildlib/environment.mak.in
603+$(BUILDDIR)/makefile: buildlib/makefile.in
604
605=== renamed file 'Makefile' => 'Makefile.moved'
606=== added file 'README.MultiArch'
607--- README.MultiArch 1970-01-01 00:00:00 +0000
608+++ README.MultiArch 2011-06-01 19:45:47 +0000
609@@ -0,0 +1,63 @@
610+Before we start with this topic: Note that MultiArch is not yet ready for
611+prime time and/or for the casual user. The implementation is so far widely
612+untested and only useful for developers of packagemanagment tools which
613+use APT and his friends and maintainers of (upcoming) MultiArch packages.
614+This README is especially NOT written for the casual user and is NOT a
615+usage guide - you have been warned. It is assumed that the reader has
616+at least a bit of knowledge about APT internals, dependency relations
617+and the MultiArch spec [0].
618+
619+Note also that the toolchain isn't ready yet, e.g. while you can simulate
620+the installation of MultiArch packages they will more sooner than later
621+cause enormous problems if really installed as dpkg can't handle MultiArch
622+yet (no, --force-{overwrite,architecture} aren't good options here).
623+Other parts of the big picture are missing and/or untested too.
624+You have been warned!
625+
626+
627+The implementation is focused on NOT breaking existing singleArch-only
628+applications and/or systems as this is the current status-quo for all
629+systems. Also, many systems don't need (or can't make use of) MultiArch,
630+so APT will proceed in thinking SingleArch as long as it is not explicitly
631+told to handle MultiArch:
632+To activate MultiArch handling you need to specify architectures you
633+want to be considered by APT with the config list APT::Architectures
634+(Insert architectures in order of preference).
635+APT will download Packages files for all these architectures in the
636+update step. Exception: In the sourcelist is the optionfield used:
637+deb [ arch=amd64,i386 ] http://example.org/ experimental main
638+(This optionfield is a NOP in previous apt versions)
639+
640+Internally in APT a package is represented as a PkgIterator -
641+before MultiArch this PkgIterator was architecture unaware,
642+only VerIterators include the architecture they came from.
643+This is/was a big problem as all versions in a package are
644+considered for dependency resolution, so pinning will not work in all cases.
645+
646+The problem is solved by a conceptional change:
647+A PkgIterator is now architecture aware, so the packages
648+of foobar for amd64 and for i386 are now for apt internal totally
649+different packages. That is a good thing for e.g. pinning, but
650+sometimes you need the information that such packages are belonging together:
651+All these foobar packages therefore form a Group accessible with GrpIterators.
652+Note that the GrpIterator has the same name as all the packages in this group,
653+so e.g. apt-cache pkgnames iterates over GrpIterator to get the package names:
654+This is compatible to SingleArch as a Group consists only of a single package
655+and also to MultiArch as a Group consists of possible many packages which
656+all have the same name and are therefore out of interest for pkgnames.
657+
658+
659+Given all these internal changes it is quite interesting that the actual
660+implementation of MultiArch is trivial: Some implicit dependencies and a few
661+more provides are all changes needed to get it working. Especially noteworthy
662+is that it wasn't needed to change the resolver in any way and other parts only
663+need to be told about using GrpIterator instead of PkgIterator, so chances are
664+good that libapt-applications will proceed to work without or at least only
665+require minor changes, but your mileage may vary…
666+
667+
668+Known Issues and/or noteworthy stuff:
669+* The implementation is mostly untested, so it is very likely that APT will
670+ eat your kids if you aren't as lucky as the author of these patches.
671+
672+[0] https://wiki.ubuntu.com/MultiarchSpec
673
674=== renamed file 'README.MultiArch' => 'README.MultiArch.moved'
675=== added file 'README.ddtp'
676--- README.ddtp 1970-01-01 00:00:00 +0000
677+++ README.ddtp 2011-06-01 19:45:47 +0000
678@@ -0,0 +1,74 @@
679+TODO:
680+- URL-Remap for the translation files (to hack around the problem that
681+ they are not on any ftp server yet but only on http://ddtp.debian.org/)
682+
683+Here is the original announcement of the ddtp support:
684+
685+* To: debian-devel-announce@lists.debian.org
686+* Subject: Translate files
687+* From: Michael Bramer <grisu@debian.org>
688+* Date: Sun, 6 Oct 2002 21:56:06 +0200
689+* Mail-followup-to: debian-devel@lists.debian.org
690+* Message-id: <20021006195605.GA30516@home.debsupport.de>
691+* Old-return-path: <michael@home.debsupport.de>
692+* User-agent: Mutt/1.3.28i
693+
694+Hello all
695+
696+After some discussion between Anthony Towns (a ftpmaster), Jason
697+Gunthorpe (APT Developer) and some DDTP Coordinators we find a way to
698+transfer the translated package descriptions from the archive to the
699+user.
700+
701+The translated descriptions need to be downloadable befor any
702+installation process, like the other package meta information. We
703+choose a new file per languages with all translated package
704+descriptions. The package system can download one or more of this
705+files at 'apt-get update' time and know the translations.
706+
707+The new files are names 'Translate-$lang' and the file have this
708+rfc822-format:
709+ Package: &lt;package-name&gt;
710+ Description-md5: &lt;the md5 checksum of the english description&gt;
711+ Description-$lang.$encoding: &lt;translated headline&gt;
712+ &lt;translated section&gt;
713+
714+The encoding of the Description is 'UTF-8' in all languages normal.
715+The files will be located at 'debian/dists/sid/main/i18n/' on the ftp
716+server (for all architecture). In addition of the plain
717+'Translate-$lang' file, there will be a 'gz' and a 'bz2' version and
718+in future also the new incremental format version.
719+
720+The &lt;the md5 checksum of the english description&gt; is the md5 checksum
721+of the full english description, without the 'Description: '-tag and
722+with all spaces and newlines. Look at this example:
723+ Description: XXX
724+ YYY
725+ .
726+ ZZZ
727+is md5(&quot;XXX\n YYY\n .\n ZZZ\n&quot;) (perl-syntax).
728+
729+
730+A future APT version will download one or some 'Translate-$lang'
731+file(s) at 'update'-time. After this download it show a translated
732+description instead of the english form, if it found a translated
733+description of the package with the right md5 chechsum. The enviroment
734+of the user will controlled this process (LANG, LANGUAGE, LC_MESSAGES,
735+etc). With this the package system will never show a outdated
736+translation.
737+
738+The translations come all from the DDTP. A daily process on
739+ddtp.debian.org make new 'Translated-$lang' files and a script on
740+ftp-master request this files and move this to the debian archive.
741+Now the first files are accessable at
742+ <a href="http://ddtp.debian.org/pdesc/translatefiles/">http://ddtp.debian.org/pdesc/translatefiles/</a>
743+
744+If you found wrong translations, please read the guides on
745+ddtp.debian.org, make a better translation and send this per mail to
746+the DDTP server. Don't bug the package maintainer!
747+
748+Thanks
749+Grisu
750+--
751+Michael Bramer - a Debian Linux Developer <a href="http://www.debsupport.de">http://www.debsupport.de</a>
752+PGP: finger grisu@db.debian.org -- Linux Sysadmin -- Use Debian Linux
753
754=== renamed file 'README.ddtp' => 'README.ddtp.moved'
755=== added file 'README.make'
756--- README.make 1970-01-01 00:00:00 +0000
757+++ README.make 2011-06-01 19:45:47 +0000
758@@ -0,0 +1,112 @@
759+The Make System
760+~~~ ~~~~ ~~~~~~
761+To compile this program you require GNU Make. In fact you probably need
762+GNU Make 3.76.1 or newer. The makefiles contained make use of many
763+GNU Make specific features and will not run on other makes.
764+
765+The make system has a number of interesting properties that are not found
766+in other systems such as automake or the GNU makefile standards. In
767+general some semblance of expectedness is kept so as not to be too
768+surprising. Basically the following will work as expected:
769+
770+ ./configure
771+ make
772+ or
773+ cd build
774+ ../configure
775+ make
776+
777+There are a number of other things that are possible that may make software
778+development and software packaging simpler. The first of these is the
779+environment.mak file. When configure is run it creates an environment.mak
780+file in the build directory. This contains -all- configurable parameters
781+for all of the make files in all of the subdirectories. Changing one
782+of these parameters will have an immediate effect. The use of makefile.in
783+and configure substitutions across build makefiles is not used at all.
784+
785+Furthermore, the make system runs with a current directory equal to the
786+source directory irregardless of the destination directory. This means
787+#include "" and #include <> work as expected and more importantly
788+running 'make' in the source directory will work as expected. The
789+environment variable or make parameter 'BUILD' sets the build directory.
790+It may be an absolute path or a path relative to the top level directory.
791+By default build-arch/ then build/ will be used with a fall back to ./ This
792+means you can get all the advantages of a build directory without having to
793+cd into it to edit your source code!
794+
795+The make system also performs dependency generation on the fly as the
796+compiler runs. This is extremely fast and accurate. There is however
797+one failure condition that occurs when a header file is erased. In
798+this case you should run make clean to purge the .o and .d files to
799+rebuild.
800+
801+The final significant deviation from normal make practices is
802+in how the build directory is managed. It is not nearly a mirror of
803+the source directory but is logically divided in the following manner
804+ bin/
805+ methods/
806+ doc/
807+ examples/
808+ include/
809+ apt-pkg/
810+ obj/
811+ apt-pkg/
812+ cmdline/
813+ [...]
814+Only .o and .d files are placed in the obj/ subdirectory. The final compiled
815+binaries are placed in bin, published headers for inter-component linking
816+are placed in include/ and documentation is generated into doc/. This means
817+all runnable programs are within the bin/ directory, a huge benefit for
818+debugging inter-program relationships. The .so files are also placed in
819+bin/ for simplicity.
820+
821+By default make is put into silent mode. During operation there should be
822+no shell or compiler messages only status messages from the makefiles,
823+if any pop up that indicates there may be a problem with your environment.
824+For debugging you can disable this by setting NOISY=1, ala
825+ make NOISY=1
826+
827+Using the makefiles
828+~~~~~ ~~~ ~~~~~~~~~
829+The makefiles for the components are really simple. The complexity is hidden
830+within the buildlib/ directory. Each makefile defines a set of make variables
831+for the bit it is going to make then includes a makefile fragment from
832+the buildlib/. This fragment generates the necessary rules based on the
833+originally defined variables. This process can be repeated as many times as
834+necessary for as many programs or libraries as are in the directory.
835+
836+Many of the make fragments have some useful properties involving sub
837+directories and other interesting features. They are more completely
838+described in the fragment code in buildlib. Some tips on writing fragments
839+are included in buildlib/defaults.mak
840+
841+The fragments are NEVER processed by configure, so if you make changes to
842+them they will have an immediate effect.
843+
844+Autoconf
845+~~~~~~~~
846+Straight out of CVS you have to initialize autoconf. This requires
847+automake (I really don't know why) and autoconf and requires doing
848+ aclocal -I buildlib
849+ autoconf
850+[Alternatively you can run make startup in the top level build dir]
851+
852+Autoconf is configured to do some basic system probes for optional and
853+required functionality and generate an environment.mak and include/config.h
854+from it's findings. It will then write a 'makefile' and run make dirs to
855+create the output directory tree.
856+
857+It is not my belief that autoconf should be used to generate substantial
858+source code markup to escape OS problems. If an OS problem does crop up
859+it can likely be corrected by installing the correct files into the
860+build include/ dir and perhaps writing some replacement code and
861+linking it in. To the fullest extent possible the source code should conform
862+to standards and not cater to broken systems.
863+
864+Autoconf will also write a makefile into the top level of the build dir,
865+this simply acts as a wrapper to the main top level make in the source tree.
866+There is one big warning, you can't use both this make file and the
867+ones in the top level tree. Make is not able to resolve rules that
868+go to the same file through different paths and this will confuse the
869+depends mechanism. I recommend always using the makefiles in the
870+source directory and exporting BUILD.
871
872=== renamed file 'README.make' => 'README.make.moved'
873=== added file 'README.progress-reporting'
874--- README.progress-reporting 1970-01-01 00:00:00 +0000
875+++ README.progress-reporting 2011-06-01 19:45:47 +0000
876@@ -0,0 +1,69 @@
877+Install-progress reporting
878+--------------------------
879+
880+If the apt options: "APT::Status-Fd" is set, apt will send status
881+reports to that fd. The status information is seperated with a ':',
882+there are the following status conditions:
883+
884+status = {"pmstatus", "dlstatus", "conffile-prompt", "error", "media-change" }
885+
886+The reason for using a fd instead of a OpProgress class is that many
887+apt frontend fork a (vte) terminal for the actual installation.
888+
889+The reason to do the mapping and l10n of the dpkg states to human
890+readable (and translatable) strings is that this way the translation
891+needs to be done only once for all frontends.
892+
893+
894+pmstatus
895+--------
896+Status of the package manager (dpkg). This is send when packages
897+are installed/removed.
898+pmstatus:pkgname:TotalPercentage:action-description
899+
900+PkgName = the name of the package
901+TotalPercentage = the total progress between [0..100]
902+description = a i18ned human readable decription of the current action
903+
904+
905+Example:
906+# ./apt-get install -o APT::Status-Fd=2 3dchess >/dev/null
907+pmstatus:3dchess:20:Preparing 3dchess
908+pmstatus:3dchess:40:Unpacking 3dchess
909+pmstatus:3dchess:60:Preparing to configure 3dchess
910+pmstatus:3dchess:80:Configuring 3dchess
911+pmstatus:3dchess:100:Installed 3dchess
912+
913+pmerror
914+-------
915+pmerror:deb:TotalPercentage:error string
916+
917+Example:
918+pmerror: /var/cache/apt/archives/krecipes_0.8.1-0ubuntu1_i386.deb : 75% : trying to overwrite `/usr/share/doc/kde/HTML/en/krecipes/krectip.png', which is also in package krecipes-data
919+
920+
921+pmconffile
922+----------
923+pmconffile:conffile:percent:'current-conffile' 'new-conffile' useredited distedited
924+
925+
926+media-change
927+------------
928+media-change:medium:drive:human-readable string
929+
930+example:
931+media-change: Ubuntu 5.10 _Breezy Badger_ - Alpha i386 (20050830):/cdrom/:Please insert the disc labeled: 'Ubuntu 5.10 _Breezy Badger_ - Alpha i386 (20050830)' in the drive '/cdrom/' and press enter.
932+
933+
934+dlstatus
935+--------
936+dlstatus:AlreadDownloaded:TotalPercentage:action-description
937+
938+AlreadyDownloaded = the number of already downloaded packages
939+TotalPercentage = the total progress between [0..100]
940+description = a i18ned human readable decription of the current action
941+
942+Example:
943+dlstatus:1:9.05654:Downloading file 1 of 3 (4m40s remaining)
944+dlstatus:1:9.46357:Downloading file 1 of 3 (4m39s remaining)
945+dlstatus:1:9.61022:Downloading file 1 of 3 (4m38s remaining)
946\ No newline at end of file
947
948=== renamed file 'README.progress-reporting' => 'README.progress-reporting.moved'
949=== added directory 'abicheck'
950=== renamed directory 'abicheck' => 'abicheck.moved'
951=== added file 'abicheck/abi-compliance-checker.pl'
952--- abicheck/abi-compliance-checker.pl 1970-01-01 00:00:00 +0000
953+++ abicheck/abi-compliance-checker.pl 2011-06-01 19:45:47 +0000
954@@ -0,0 +1,7325 @@
955+#!/usr/bin/perl
956+###########################################################################
957+# ABI-compliance-checker v1.13, lightweight tool for statically checking
958+# backward binary compatibility of shared C/C++ libraries in Linux.
959+# Copyright (C) The Linux Foundation
960+# Copyright (C) Institute for System Programming, RAS
961+# Author: Andrey Ponomarenko
962+#
963+# This program is free software: you can redistribute it and/or modify
964+# it under the terms of the GNU General Public License as published by
965+# the Free Software Foundation, either version 2 of the License, or
966+# (at your option) any later version.
967+#
968+# This program is distributed in the hope that it will be useful,
969+# but WITHOUT ANY WARRANTY; without even the implied warranty of
970+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
971+# GNU General Public License for more details.
972+#
973+# You should have received a copy of the GNU General Public License
974+# along with this program. If not, see <http://www.gnu.org/licenses/>.
975+###########################################################################
976+use Getopt::Long;
977+Getopt::Long::Configure ("posix_default", "no_ignore_case");
978+use Data::Dumper;
979+
980+my $ABI_COMPLIANCE_CHECKER_VERSION = "1.13";
981+my ($Help, $ShowVersion, %Descriptor, $TargetLibraryName, $HeaderCheckingMode_Separately, $GenerateDescriptor, $TestSystem, $DumpInfo_DescriptorPath, $CheckHeadersOnly, $InterfacesListPath, $AppPath, $ShowExpendTime);
982+
983+my $CmdName = get_FileName($0);
984+GetOptions("h|help!" => \$Help,
985+ "v|version!" => \$ShowVersion,
986+#general options
987+ "l|library=s" => \$TargetLibraryName,
988+ "d1|descriptor1=s" => \$Descriptor{1}{"Path"},
989+ "d2|descriptor2=s" => \$Descriptor{2}{"Path"},
990+#extra options
991+ "app|application=s" => \$AppPath,
992+ "symbols_list|int_list=s" => \$InterfacesListPath,
993+ "dump_abi|dump_info=s" => \$DumpInfo_DescriptorPath,
994+ "headers_only!" => \$CheckHeadersOnly,
995+#other options
996+ "d|descriptor_template!" => \$GenerateDescriptor,
997+ "separately!" => \$HeaderCheckingMode_Separately,
998+ "test!" => \$TestSystem,
999+ "time!" => \$ShowExpendTime
1000+) or exit(1);
1001+
1002+sub HELP_MESSAGE()
1003+{
1004+ print STDERR <<"EOM"
1005+
1006+NAME:
1007+ $CmdName - check ABI compatibility of shared C/C++ library versions
1008+
1009+DESCRIPTION:
1010+ Lightweight tool for statically checking backward binary compatibility of shared C/C++ libraries
1011+ in Linux. It checks header files along with shared objects in two library versions and searches
1012+ for ABI changes that may lead to incompatibility. Breakage of the binary compatibility may result
1013+ in crashing or incorrect behavior of applications built with an old version of a library when
1014+ it is running with a new one.
1015+
1016+ ABI Compliance Checker was intended for library developers that are interested in ensuring
1017+ backward binary compatibility. Also it can be used for checking forward binary compatibility
1018+ and checking applications portability to the new library version.
1019+
1020+ This tool is free software: you can redistribute it and/or modify it under the terms of the GNU GPL.
1021+
1022+USAGE:
1023+ $CmdName [options]
1024+
1025+EXAMPLE OF USE:
1026+ $CmdName -l <library_name> -d1 <1st_version_descriptor> -d2 <2nd_version_descriptor>
1027+
1028+GENERAL OPTIONS:
1029+ -h|-help
1030+ Print this help.
1031+
1032+ -v|-version
1033+ Print version.
1034+
1035+ -l|-library <name>
1036+ Library name (without version).
1037+ It affects only on the path and the title of the report.
1038+
1039+ -d1|-descriptor1 <path>
1040+ Path to descriptor of 1st library version.
1041+
1042+ -d2|-descriptor2 <path>
1043+ Path to descriptor of 2nd library version.
1044+
1045+EXTRA OPTIONS:
1046+ -app|-application <path>
1047+ This option allow to specify the application that should be tested for portability
1048+ to the new library version.
1049+
1050+ -dump_abi|-dump_info <descriptor_path>
1051+ Dump library ABI information using specified descriptor.
1052+ This command will create '<library>_<ver1>.abi.tar.gz' file in the directory 'abi_dumps/<library>/'.
1053+ You can transfer it anywhere and pass instead of library descriptor.
1054+
1055+ -headers_only
1056+ Check header files without shared objects. It is easy to run, but may provide
1057+ a low quality ABI compliance report with false positives and without
1058+ detecting of added/withdrawn interfaces.
1059+
1060+ -symbols_list|-int_list <path>
1061+ This option allow to specify a file with a list of interfaces (mangled names in C++)
1062+ that should be checked, other library interfaces will not be checked.
1063+
1064+OTHER OPTIONS:
1065+ -d|-descriptor_template
1066+ Create library descriptor template 'library-descriptor.xml' in the current directory.
1067+
1068+ -separately
1069+ Check headers individually. This mode requires more time for checking ABI compliance,
1070+ but possible compiler errors in one header can't affect others.
1071+
1072+ -test
1073+ Run internal tests (create two binary-incompatible versions of an artificial library
1074+ and run ABI-Compliance-Checker on it).
1075+
1076+DESCRIPTOR EXAMPLE:
1077+ <version>
1078+ 1.28.0
1079+ </version>
1080+
1081+ <headers>
1082+ /usr/local/atk/atk-1.28.0/include/
1083+ </headers>
1084+
1085+ <libs>
1086+ /usr/local/atk/atk-1.28.0/lib/libatk-1.0.so
1087+ </libs>
1088+
1089+ <include_paths>
1090+ /usr/include/glib-2.0/
1091+ /usr/lib/glib-2.0/include/
1092+ </include_paths>
1093+
1094+
1095+Report bugs to <abi-compliance-checker\@linuxtesting.org>
1096+For more information, please see: http://ispras.linux-foundation.org/index.php/ABI_compliance_checker
1097+EOM
1098+ ;
1099+}
1100+
1101+my $Descriptor_Template = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
1102+<descriptor>
1103+
1104+<!-- Template for the library version descriptor -->
1105+
1106+<!--
1107+ Necessary sections
1108+ -->
1109+
1110+<version>
1111+ <!-- Version of the library -->
1112+</version>
1113+
1114+<headers>
1115+ <!-- The list of paths to header files and/or
1116+ directories with header files, one per line -->
1117+</headers>
1118+
1119+<libs>
1120+ <!-- The list of paths to shared objects and/or
1121+ directories with shared objects, one per line -->
1122+</libs>
1123+
1124+<!--
1125+ Additional sections
1126+ -->
1127+
1128+<include_paths>
1129+ <!-- The list of paths to be searched for header files
1130+ needed for compiling of library headers, one per line -->
1131+</include_paths>
1132+
1133+<gcc_options>
1134+ <!-- Additional gcc options, one per line -->
1135+</gcc_options>
1136+
1137+<opaque_types>
1138+ <!-- The list of opaque types, one per line -->
1139+</opaque_types>
1140+
1141+<skip_interfaces>
1142+ <!-- The list of functions (mangled/symbol names in C++)
1143+ that should be skipped while testing, one per line -->
1144+</skip_interfaces>
1145+
1146+<include_preamble>
1147+ <!-- The list of header files that should be included before other headers, one per line.
1148+ For example, it is a tree.h for libxml2 and ft2build.h for freetype2 -->
1149+</include_preamble>
1150+
1151+</descriptor>";
1152+
1153+my %Operator_Indication = (
1154+"not" => "~",
1155+"assign" => "=",
1156+"andassign" => "&=",
1157+"orassign" => "|=",
1158+"xorassign" => "^=",
1159+"or" => "|",
1160+"xor" => "^",
1161+"addr" => "&",
1162+"and" => "&",
1163+"lnot" => "!",
1164+"eq" => "==",
1165+"ne" => "!=",
1166+"lt" => "<",
1167+"lshift" => "<<",
1168+"lshiftassign" => "<<=",
1169+"rshiftassign" => ">>=",
1170+"call" => "()",
1171+"mod" => "%",
1172+"modassign" => "%=",
1173+"subs" => "[]",
1174+"land" => "&&",
1175+"lor" => "||",
1176+"rshift" => ">>",
1177+"ref" => "->",
1178+"le" => "<=",
1179+"deref" => "*",
1180+"mult" => "*",
1181+"preinc" => "++",
1182+"delete" => " delete",
1183+"vecnew" => " new[]",
1184+"vecdelete" => " delete[]",
1185+"predec" => "--",
1186+"postinc" => "++",
1187+"postdec" => "--",
1188+"plusassign" => "+=",
1189+"plus" => "+",
1190+"minus" => "-",
1191+"minusassign" => "-=",
1192+"gt" => ">",
1193+"ge" => ">=",
1194+"new" => " new",
1195+"multassign" => "*=",
1196+"divassign" => "/=",
1197+"div" => "/",
1198+"neg" => "-",
1199+"pos" => "+",
1200+"memref" => "->*",
1201+"compound" => ","
1202+);
1203+
1204+sub num_to_str($)
1205+{
1206+ my $Number = $_[0];
1207+ if(int($Number)>3)
1208+ {
1209+ return $Number."th";
1210+ }
1211+ elsif(int($Number)==1)
1212+ {
1213+ return "1st";
1214+ }
1215+ elsif(int($Number)==2)
1216+ {
1217+ return "2nd";
1218+ }
1219+ elsif(int($Number)==3)
1220+ {
1221+ return "3rd";
1222+ }
1223+ else
1224+ {
1225+ return "";
1226+ }
1227+}
1228+
1229+#Global variables
1230+my $REPORT_PATH;
1231+my %ERR_PATH;
1232+my $POINTER_SIZE;
1233+my $MAX_COMMAND_LINE_ARGUMENTS = 4096;
1234+my %Cache;
1235+my %FuncAttr;
1236+my %LibInfo;
1237+my %HeaderCompileError;
1238+my $StartTime;
1239+my %CompilerOptions;
1240+my %AddedInt;
1241+my %WithdrawnInt;
1242+my @RecurLib;
1243+my %CheckedSoLib;
1244+
1245+#Constants checking
1246+my %ConstantsSrc;
1247+my %Constants;
1248+
1249+#Types
1250+my %TypeDescr;
1251+my %TemplateInstance_Func;
1252+my %TemplateInstance;
1253+my %OpaqueTypes;
1254+my %Tid_TDid;
1255+my %CheckedTypes;
1256+my %Typedef_BaseName;
1257+my %StdCxxTypedef;
1258+my %TName_Tid;
1259+my %EnumMembName_Id;
1260+
1261+#Interfaces
1262+my %FuncDescr;
1263+my %ClassFunc;
1264+my %ClassVirtFunc;
1265+my %ClassIdVirtFunc;
1266+my %ClassId;
1267+my %tr_name;
1268+my %mangled_name;
1269+my %InternalInterfaces;
1270+my %InterfacesList;
1271+my %InterfacesList_App;
1272+my %CheckedInterfaces;
1273+my %DepInterfaces;
1274+
1275+#Headers
1276+my %Include_Preamble;
1277+my %Headers;
1278+my %HeaderName_Destinations;
1279+my %Header_Dependency;
1280+
1281+#Shared objects
1282+my %SoLib_DefaultPath;
1283+
1284+#Merging
1285+my %CompleteSignature;
1286+my @RecurTypes;
1287+my %Interface_Library;
1288+my %Library_Interface;
1289+my %Language;
1290+my %SoNames_All;
1291+my $Version;
1292+
1293+#Symbols versioning
1294+my %SymVer;
1295+
1296+#Problem descriptions
1297+my %CompatProblems;
1298+my %ConstantProblems;
1299+
1300+#Rerorts
1301+my $ContentID = 1;
1302+my $ContentSpanStart = "<span class=\"section\" onclick=\"javascript:showContent(this, 'CONTENT_ID')\">\n";
1303+my $ContentSpanEnd = "</span>\n";
1304+my $ContentDivStart = "<div id=\"CONTENT_ID\" style=\"display:none;\">\n";
1305+my $ContentDivEnd = "</div>\n";
1306+my $Content_Counter = 0;
1307+
1308+sub readDescriptor($)
1309+{
1310+ my $LibVersion = $_[0];
1311+ if(not -e $Descriptor{$LibVersion}{"Path"})
1312+ {
1313+ return;
1314+ }
1315+ my $Descriptor_File = readFile($Descriptor{$LibVersion}{"Path"});
1316+ $Descriptor_File =~ s/\/\*(.|\n)+?\*\///g;
1317+ $Descriptor_File =~ s/<\!--(.|\n)+?-->//g;
1318+ if(not $Descriptor_File)
1319+ {
1320+ print "ERROR: descriptor d$LibVersion is empty\n";
1321+ exit(1);
1322+ }
1323+ $Descriptor{$LibVersion}{"Version"} = parseTag(\$Descriptor_File, "version");
1324+ if(not $Descriptor{$LibVersion}{"Version"})
1325+ {
1326+ print "ERROR: version in the descriptor d$LibVersion was not specified (section <version>)\n\n";
1327+ exit(1);
1328+ }
1329+ $Descriptor{$LibVersion}{"Headers"} = parseTag(\$Descriptor_File, "headers");
1330+ if(not $Descriptor{$LibVersion}{"Headers"})
1331+ {
1332+ print "ERROR: header files in the descriptor d$LibVersion were not specified (section <headers>)\n";
1333+ exit(1);
1334+ }
1335+ if(not $CheckHeadersOnly)
1336+ {
1337+ $Descriptor{$LibVersion}{"Libs"} = parseTag(\$Descriptor_File, "libs");
1338+ if(not $Descriptor{$LibVersion}{"Libs"})
1339+ {
1340+ print "ERROR: shared objects in the descriptor d$LibVersion were not specified (section <libs>)\n";
1341+ exit(1);
1342+ }
1343+ }
1344+ $Descriptor{$LibVersion}{"Include_Paths"} = parseTag(\$Descriptor_File, "include_paths");
1345+ $Descriptor{$LibVersion}{"Gcc_Options"} = parseTag(\$Descriptor_File, "gcc_options");
1346+ foreach my $Option (split("\n", $Descriptor{$LibVersion}{"Gcc_Options"}))
1347+ {
1348+ $Option =~ s/\A\s+|\s+\Z//g;
1349+ next if(not $Option);
1350+ $CompilerOptions{$LibVersion} .= " ".$Option;
1351+ }
1352+ $Descriptor{$LibVersion}{"Opaque_Types"} = parseTag(\$Descriptor_File, "opaque_types");
1353+ foreach my $Type_Name (split("\n", $Descriptor{$LibVersion}{"Opaque_Types"}))
1354+ {
1355+ $Type_Name =~ s/\A\s+|\s+\Z//g;
1356+ next if(not $Type_Name);
1357+ $OpaqueTypes{$LibVersion}{$Type_Name} = 1;
1358+ }
1359+ $Descriptor{$LibVersion}{"Skip_interfaces"} = parseTag(\$Descriptor_File, "skip_interfaces");
1360+ foreach my $Interface_Name (split("\n", $Descriptor{$LibVersion}{"Skip_interfaces"}))
1361+ {
1362+ $Interface_Name =~ s/\A\s+|\s+\Z//g;
1363+ next if(not $Interface_Name);
1364+ $InternalInterfaces{$LibVersion}{$Interface_Name} = 1;
1365+ }
1366+ $Descriptor{$LibVersion}{"Include_Preamble"} = parseTag(\$Descriptor_File, "include_preamble");
1367+ my $Position = 0;
1368+ foreach my $Header_Name (split("\n", $Descriptor{$LibVersion}{"Include_Preamble"}))
1369+ {
1370+ $Header_Name =~ s/\A\s+|\s+\Z//g;
1371+ next if(not $Header_Name);
1372+ $Include_Preamble{$LibVersion}{$Header_Name}{"Position"} = $Position;
1373+ $Position+=1;
1374+ }
1375+ my $Descriptors_Dir = "descriptors_storage/$TargetLibraryName";
1376+ system("mkdir", "-p", $Descriptors_Dir);
1377+ my $Descriptor_Name = $TargetLibraryName."_".$Descriptor{$LibVersion}{"Version"}.".desc";
1378+ if($Descriptor{$LibVersion}{"Path"} ne $Descriptors_Dir."/".$Descriptor_Name)
1379+ {
1380+ system("cp", "-f", $Descriptor{$LibVersion}{"Path"}, $Descriptors_Dir."/".$Descriptor_Name);
1381+ }
1382+ $ERR_PATH{$LibVersion} = "header_compile_errors/$TargetLibraryName/".$Descriptor{$LibVersion}{"Version"};
1383+}
1384+
1385+sub parseTag($$)
1386+{
1387+ my ($CodeRef, $Tag) = @_;
1388+ return "" if(not $CodeRef or not ${$CodeRef} or not $Tag);
1389+ if(${$CodeRef} =~ s/\<$Tag\>((.|\n)+?)\<\/$Tag\>//)
1390+ {
1391+ my $Content = $1;
1392+ $Content=~s/(\A\s+|\s+\Z)//g;
1393+ return $Content;
1394+ }
1395+ else
1396+ {
1397+ return "";
1398+ }
1399+}
1400+
1401+my %check_node=(
1402+"array_type"=>1,
1403+"binfo"=>1,
1404+"boolean_type"=>1,
1405+"complex_type"=>1,
1406+"const_decl"=>1,
1407+"enumeral_type"=>1,
1408+"field_decl"=>1,
1409+"function_decl"=>1,
1410+"function_type"=>1,
1411+"identifier_node"=>1,
1412+"integer_cst"=>1,
1413+"integer_type"=>1,
1414+"method_type"=>1,
1415+"namespace_decl"=>1,
1416+"parm_decl"=>1,
1417+"pointer_type"=>1,
1418+"real_cst"=>1,
1419+"real_type"=>1,
1420+"record_type"=>1,
1421+"reference_type"=>1,
1422+"string_cst"=>1,
1423+"template_decl"=>1,
1424+"template_type_parm"=>1,
1425+"tree_list"=>1,
1426+"tree_vec"=>1,
1427+"type_decl"=>1,
1428+"union_type"=>1,
1429+"var_decl"=>1,
1430+"void_type"=>1);
1431+
1432+sub getInfo($)
1433+{
1434+ my $InfoPath = $_[0];
1435+ return if(not $InfoPath or not -f $InfoPath);
1436+ my $InfoPath_New = $InfoPath.".1";
1437+ #my $Keywords = join("\\|", keys(%check_node));#|grep "$Keywords"
1438+ system("sed ':a;N;\$!ba;s/\\n[^\@]//g' ".esc($InfoPath)."|sed 's/ [ ]\\+/ /g' > ".esc($InfoPath_New));
1439+ system("rm", "-fr", $InfoPath);
1440+ #getting info
1441+ open(INFO, $InfoPath_New) || die ("can't open file '\$InfoPath_New\': $!\n");
1442+ while(<INFO>)
1443+ {
1444+ chomp;
1445+ if(/\A@([0-9]+)[ ]+([a-zA-Z_]+)[ ]+(.*)\Z/)
1446+ {
1447+ next if(not $check_node{$2});
1448+ $LibInfo{$Version}{$1}{"info_type"}=$2;
1449+ $LibInfo{$Version}{$1}{"info"}=$3;
1450+ }
1451+ }
1452+ close(INFO);
1453+ system("rm", "-fr", $InfoPath_New);
1454+ #processing info
1455+ setTemplateParams_All();
1456+ getTypeDescr_All();
1457+ getFuncDescr_All();
1458+ getVarDescr_All();
1459+ %LibInfo = ();
1460+ %TemplateInstance = ();
1461+}
1462+
1463+sub setTemplateParams_All()
1464+{
1465+ foreach (keys(%{$LibInfo{$Version}}))
1466+ {
1467+ if($LibInfo{$Version}{$_}{"info_type"} eq "template_decl")
1468+ {
1469+ setTemplateParams($_);
1470+ }
1471+ }
1472+}
1473+
1474+sub setTemplateParams($)
1475+{
1476+ my $TypeInfoId = $_[0];
1477+ my $Info = $LibInfo{$Version}{$TypeInfoId}{"info"};
1478+ if($Info =~ /(inst|spcs)[ ]*:[ ]*@([0-9]+) /)
1479+ {
1480+ my $TmplInst_InfoId = $2;
1481+ setTemplateInstParams($TmplInst_InfoId);
1482+ my $TmplInst_Info = $LibInfo{$Version}{$TmplInst_InfoId}{"info"};
1483+ while($TmplInst_Info =~ /chan[ ]*:[ ]*@([0-9]+) /)
1484+ {
1485+ $TmplInst_InfoId = $1;
1486+ $TmplInst_Info = $LibInfo{$Version}{$TmplInst_InfoId}{"info"};
1487+ setTemplateInstParams($TmplInst_InfoId);
1488+ }
1489+ }
1490+}
1491+
1492+sub setTemplateInstParams($)
1493+{
1494+ my $TmplInst_Id = $_[0];
1495+ my $Info = $LibInfo{$Version}{$TmplInst_Id}{"info"};
1496+ my ($Params_InfoId, $ElemId) = ();
1497+ if($Info =~ /purp[ ]*:[ ]*@([0-9]+) /)
1498+ {
1499+ $Params_InfoId = $1;
1500+ }
1501+ if($Info =~ /valu[ ]*:[ ]*@([0-9]+) /)
1502+ {
1503+ $ElemId = $1;
1504+ }
1505+ if($Params_InfoId and $ElemId)
1506+ {
1507+ my $Params_Info = $LibInfo{$Version}{$Params_InfoId}{"info"};
1508+ while($Params_Info =~ s/ ([0-9]+)[ ]*:[ ]*@([0-9]+) //)
1509+ {
1510+ my ($Param_Pos, $Param_TypeId) = ($1, $2);
1511+ return if($LibInfo{$Version}{$Param_TypeId}{"info_type"} eq "template_type_parm");
1512+ if($LibInfo{$ElemId}{"info_type"} eq "function_decl")
1513+ {
1514+ $TemplateInstance_Func{$Version}{$ElemId}{$Param_Pos} = $Param_TypeId;
1515+ }
1516+ else
1517+ {
1518+ $TemplateInstance{$Version}{getTypeDeclId($ElemId)}{$ElemId}{$Param_Pos} = $Param_TypeId;
1519+ }
1520+ }
1521+ }
1522+}
1523+
1524+sub getTypeDeclId($)
1525+{
1526+ my $TypeInfo = $LibInfo{$Version}{$_[0]}{"info"};
1527+ if($TypeInfo =~ /name[ ]*:[ ]*@([0-9]+)/)
1528+ {
1529+ return $1;
1530+ }
1531+ else
1532+ {
1533+ return "";
1534+ }
1535+}
1536+
1537+sub isFuncPtr($)
1538+{
1539+ my $Ptd = pointTo($_[0]);
1540+ if($Ptd)
1541+ {
1542+ if(($LibInfo{$Version}{$_[0]}{"info"} =~ m/unql[ ]*:/) and not ($LibInfo{$Version}{$_[0]}{"info"} =~ m/qual[ ]*:/))
1543+ {
1544+ return 0;
1545+ }
1546+ elsif(($LibInfo{$Version}{$_[0]}{"info_type"} eq "pointer_type") and ($LibInfo{$Version}{$Ptd}{"info_type"} eq "function_type" or $LibInfo{$Version}{$Ptd}{"info_type"} eq "method_type"))
1547+ {
1548+ return 1;
1549+ }
1550+ else
1551+ {
1552+ return 0;
1553+ }
1554+ }
1555+ else
1556+ {
1557+ return 0;
1558+ }
1559+}
1560+
1561+sub pointTo($)
1562+{
1563+ my $TypeInfo = $LibInfo{$Version}{$_[0]}{"info"};
1564+ if($TypeInfo =~ /ptd[ ]*:[ ]*@([0-9]+)/)
1565+ {
1566+ return $1;
1567+ }
1568+ else
1569+ {
1570+ return "";
1571+ }
1572+}
1573+
1574+sub getTypeDescr_All()
1575+{
1576+ foreach (sort {int($a)<=>int($b)} keys(%{$LibInfo{$Version}}))
1577+ {
1578+ if($LibInfo{$Version}{$_}{"info_type"}=~/_type\Z/ and $LibInfo{$Version}{$_}{"info_type"}!~/function_type|method_type/)
1579+ {
1580+ getTypeDescr(getTypeDeclId($_), $_);
1581+ }
1582+ }
1583+ $TypeDescr{$Version}{""}{-1}{"Name"} = "...";
1584+ $TypeDescr{$Version}{""}{-1}{"Type"} = "Intrinsic";
1585+ $TypeDescr{$Version}{""}{-1}{"Tid"} = -1;
1586+}
1587+
1588+sub getTypeDescr($$)
1589+{
1590+ my ($TypeDeclId, $TypeId) = @_;
1591+ $Tid_TDid{$Version}{$TypeId} = $TypeDeclId;
1592+ %{$TypeDescr{$Version}{$TypeDeclId}{$TypeId}} = getTypeAttr($TypeDeclId, $TypeId);
1593+ if(not $TypeDescr{$Version}{$TypeDeclId}{$TypeId}{"Name"})
1594+ {
1595+ delete($TypeDescr{$Version}{$TypeDeclId}{$TypeId});
1596+ return;
1597+ }
1598+ if(not $TName_Tid{$Version}{$TypeDescr{$Version}{$TypeDeclId}{$TypeId}{"Name"}})
1599+ {
1600+ $TName_Tid{$Version}{$TypeDescr{$Version}{$TypeDeclId}{$TypeId}{"Name"}} = $TypeId;
1601+ }
1602+}
1603+
1604+sub getTypeAttr($$)
1605+{
1606+ my ($TypeDeclId, $TypeId) = @_;
1607+ my ($BaseTypeSpec, %TypeAttr) = ();
1608+ if($TypeDescr{$Version}{$TypeDeclId}{$TypeId}{"Name"})
1609+ {
1610+ return %{$TypeDescr{$Version}{$TypeDeclId}{$TypeId}};
1611+ }
1612+ $TypeAttr{"Tid"} = $TypeId;
1613+ $TypeAttr{"TDid"} = $TypeDeclId;
1614+ $TypeAttr{"Type"} = getTypeType($TypeDeclId, $TypeId);
1615+ if($TypeAttr{"Type"} eq "Unknown")
1616+ {
1617+ return ();
1618+ }
1619+ elsif($TypeAttr{"Type"} eq "FuncPtr")
1620+ {
1621+ %{$TypeDescr{$Version}{$TypeDeclId}{$TypeId}} = getFuncPtrAttr(pointTo($TypeId), $TypeDeclId, $TypeId);
1622+ $TName_Tid{$Version}{$TypeDescr{$Version}{$TypeDeclId}{$TypeId}{"Name"}} = $TypeId;
1623+ return %{$TypeDescr{$Version}{$TypeDeclId}{$TypeId}};
1624+ }
1625+ elsif($TypeAttr{"Type"} eq "Array")
1626+ {
1627+ ($TypeAttr{"BaseType"}{"Tid"}, $TypeAttr{"BaseType"}{"TDid"}, $BaseTypeSpec) = selectBaseType($TypeDeclId, $TypeId);
1628+ my %BaseTypeAttr = getTypeAttr($TypeAttr{"BaseType"}{"TDid"}, $TypeAttr{"BaseType"}{"Tid"});
1629+ my $ArrayElemNum = getSize($TypeId)/8;
1630+ $ArrayElemNum = $ArrayElemNum/$BaseTypeAttr{"Size"} if($BaseTypeAttr{"Size"});
1631+ $TypeAttr{"Size"} = $ArrayElemNum;
1632+ if($ArrayElemNum)
1633+ {
1634+ $TypeAttr{"Name"} = $BaseTypeAttr{"Name"}."[".$ArrayElemNum."]";
1635+ }
1636+ else
1637+ {
1638+ $TypeAttr{"Name"} = $BaseTypeAttr{"Name"}."[]";
1639+ }
1640+ $TypeAttr{"Name"} = correctName($TypeAttr{"Name"});
1641+ $TypeAttr{"Library"} = $BaseTypeAttr{"Library"};
1642+ $TypeAttr{"Header"} = $BaseTypeAttr{"Header"};
1643+ %{$TypeDescr{$Version}{$TypeDeclId}{$TypeId}} = %TypeAttr;
1644+ $TName_Tid{$Version}{$TypeDescr{$Version}{$TypeDeclId}{$TypeId}{"Name"}} = $TypeId;
1645+ return %TypeAttr;
1646+ }
1647+ elsif($TypeAttr{"Type"} =~ /Intrinsic|Union|Struct|Enum|Class/)
1648+ {
1649+ if($TemplateInstance{$Version}{$TypeDeclId}{$TypeId})
1650+ {
1651+ my @Template_Params = ();
1652+ foreach my $Param_Pos (sort {int($a)<=>int($b)} keys(%{$TemplateInstance{$Version}{$TypeDeclId}{$TypeId}}))
1653+ {
1654+ my $Type_Id = $TemplateInstance{$Version}{$TypeDeclId}{$TypeId}{$Param_Pos};
1655+ my $Param = get_TemplateParam($Type_Id);
1656+ if($Param eq "")
1657+ {
1658+ return ();
1659+ }
1660+ @Template_Params = (@Template_Params, $Param);
1661+ }
1662+ %{$TypeDescr{$Version}{$TypeDeclId}{$TypeId}} = getTrivialTypeAttr($TypeDeclId, $TypeId);
1663+ $TypeDescr{$Version}{$TypeDeclId}{$TypeId}{"Name"} = $TypeDescr{$Version}{$TypeDeclId}{$TypeId}{"Name"}."< ".join(", ", @Template_Params)." >";
1664+ $TypeDescr{$Version}{$TypeDeclId}{$TypeId}{"Name"} = correctName($TypeDescr{$Version}{$TypeDeclId}{$TypeId}{"Name"});
1665+ $TName_Tid{$Version}{$TypeDescr{$Version}{$TypeDeclId}{$TypeId}{"Name"}} = $TypeId;
1666+ return %{$TypeDescr{$Version}{$TypeDeclId}{$TypeId}};
1667+ }
1668+ else
1669+ {
1670+ %{$TypeDescr{$Version}{$TypeDeclId}{$TypeId}} = getTrivialTypeAttr($TypeDeclId, $TypeId);
1671+ return %{$TypeDescr{$Version}{$TypeDeclId}{$TypeId}};
1672+ }
1673+ }
1674+ else
1675+ {
1676+ ($TypeAttr{"BaseType"}{"Tid"}, $TypeAttr{"BaseType"}{"TDid"}, $BaseTypeSpec) = selectBaseType($TypeDeclId, $TypeId);
1677+ my %BaseTypeAttr = getTypeAttr($TypeAttr{"BaseType"}{"TDid"}, $TypeAttr{"BaseType"}{"Tid"});
1678+ if($BaseTypeSpec and $BaseTypeAttr{"Name"})
1679+ {
1680+ if(($TypeAttr{"Type"} eq "Pointer") and $BaseTypeAttr{"Name"}=~/\([\*]+\)/)
1681+ {
1682+ $TypeAttr{"Name"} = $BaseTypeAttr{"Name"};
1683+ $TypeAttr{"Name"} =~ s/\(([*]+)\)/($1*)/g;
1684+ }
1685+ else
1686+ {
1687+ $TypeAttr{"Name"} = $BaseTypeAttr{"Name"}." ".$BaseTypeSpec;
1688+ }
1689+ }
1690+ elsif($BaseTypeAttr{"Name"})
1691+ {
1692+ $TypeAttr{"Name"} = $BaseTypeAttr{"Name"};
1693+ }
1694+ if($TypeAttr{"Type"} eq "Typedef")
1695+ {
1696+ $TypeAttr{"Name"} = getNameByInfo($TypeDeclId);
1697+ $TypeAttr{"NameSpace"} = getNameSpace($TypeDeclId);
1698+ if($TypeAttr{"NameSpace"})
1699+ {
1700+ $TypeAttr{"Name"} = $TypeAttr{"NameSpace"}."::".$TypeAttr{"Name"};
1701+ }
1702+ ($TypeAttr{"Header"}, $TypeAttr{"Line"}) = getLocation($TypeDeclId);
1703+ if($TypeAttr{"NameSpace"}=~/\Astd(::|\Z)/ and $BaseTypeAttr{"NameSpace"}=~/\Astd(::|\Z)/)
1704+ {
1705+ $StdCxxTypedef{$Version}{$BaseTypeAttr{"Name"}} = $TypeAttr{"Name"};
1706+ }
1707+ $Typedef_BaseName{$Version}{$TypeAttr{"Name"}} = $BaseTypeAttr{"Name"};
1708+ }
1709+ if(not $TypeAttr{"Size"})
1710+ {
1711+ if($TypeAttr{"Type"} eq "Pointer")
1712+ {
1713+ $TypeAttr{"Size"} = $POINTER_SIZE;
1714+ }
1715+ else
1716+ {
1717+ $TypeAttr{"Size"} = $BaseTypeAttr{"Size"};
1718+ }
1719+ }
1720+ $TypeAttr{"Name"} = correctName($TypeAttr{"Name"});
1721+ $TypeAttr{"Library"} = $BaseTypeAttr{"Library"};
1722+ $TypeAttr{"Header"} = $BaseTypeAttr{"Header"} if(not $TypeAttr{"Header"});
1723+ %{$TypeDescr{$Version}{$TypeDeclId}{$TypeId}} = %TypeAttr;
1724+ $TName_Tid{$Version}{$TypeDescr{$Version}{$TypeDeclId}{$TypeId}{"Name"}} = $TypeId;
1725+ return %TypeAttr;
1726+ }
1727+}
1728+
1729+sub get_TemplateParam($)
1730+{
1731+ my $Type_Id = $_[0];
1732+ if(getNodeType($Type_Id) eq "integer_cst")
1733+ {
1734+ return getNodeIntCst($Type_Id);
1735+ }
1736+ elsif(getNodeType($Type_Id) eq "string_cst")
1737+ {
1738+ return getNodeStrCst($Type_Id);
1739+ }
1740+ else
1741+ {
1742+ my $Type_DId = getTypeDeclId($Type_Id);
1743+ my %ParamAttr = getTypeAttr($Type_DId, $Type_Id);
1744+ if(not $ParamAttr{"Name"})
1745+ {
1746+ return "";
1747+ }
1748+ if($ParamAttr{"Name"}=~/\>/)
1749+ {
1750+ if($StdCxxTypedef{$Version}{$ParamAttr{"Name"}})
1751+ {
1752+ return $StdCxxTypedef{$Version}{$ParamAttr{"Name"}};
1753+ }
1754+ elsif(my $Covered = cover_stdcxx_typedef($ParamAttr{"Name"}))
1755+ {
1756+ return $Covered;
1757+ }
1758+ else
1759+ {
1760+ return $ParamAttr{"Name"};
1761+ }
1762+ }
1763+ else
1764+ {
1765+ return $ParamAttr{"Name"};
1766+ }
1767+ }
1768+}
1769+
1770+sub cover_stdcxx_typedef($)
1771+{
1772+ my $TypeName = $_[0];
1773+ my $TypeName_Covered = $TypeName;
1774+ while($TypeName=~s/>[ ]*(const|volatile|restrict| |\*|\&)\Z/>/g){};
1775+ if(my $Cover = $StdCxxTypedef{$Version}{$TypeName})
1776+ {
1777+ $TypeName = esc_l($TypeName);
1778+ $TypeName_Covered=~s/$TypeName/$Cover /g;
1779+ }
1780+ return correctName($TypeName_Covered);
1781+}
1782+
1783+sub getNodeType($)
1784+{
1785+ return $LibInfo{$Version}{$_[0]}{"info_type"};
1786+}
1787+
1788+sub getNodeIntCst($)
1789+{
1790+ my $CstId = $_[0];
1791+ my $CstTypeId = getTreeAttr($CstId, "type");
1792+ if($EnumMembName_Id{$Version}{$CstId})
1793+ {
1794+ return $EnumMembName_Id{$Version}{$CstId};
1795+ }
1796+ elsif($LibInfo{$Version}{$_[0]}{"info"} =~ /low[ ]*:[ ]*([^ ]+) /)
1797+ {
1798+ if($1 eq "0")
1799+ {
1800+ if(getNodeType($CstTypeId) eq "boolean_type")
1801+ {
1802+ return "false";
1803+ }
1804+ else
1805+ {
1806+ return "0";
1807+ }
1808+ }
1809+ elsif($1 eq "1")
1810+ {
1811+ if(getNodeType($CstTypeId) eq "boolean_type")
1812+ {
1813+ return "true";
1814+ }
1815+ else
1816+ {
1817+ return "1";
1818+ }
1819+ }
1820+ else
1821+ {
1822+ return $1;
1823+ }
1824+ }
1825+ else
1826+ {
1827+ return "";
1828+ }
1829+}
1830+
1831+sub getNodeStrCst($)
1832+{
1833+ if($LibInfo{$Version}{$_[0]}{"info"} =~ /low[ ]*:[ ]*(.+)[ ]+lngt/)
1834+ {
1835+ return $1;
1836+ }
1837+ else
1838+ {
1839+ return "";
1840+ }
1841+}
1842+
1843+sub esc_l($)
1844+{
1845+ my $String = $_[0];
1846+ $String=~s/([()*])/\\$1/g;
1847+ return $String;
1848+}
1849+
1850+sub getFuncPtrAttr($$$)
1851+{
1852+ my ($FuncTypeId, $TypeDeclId, $TypeId) = @_;
1853+ my $FuncInfo = $LibInfo{$Version}{$FuncTypeId}{"info"};
1854+ my $FuncInfo_Type = $LibInfo{$Version}{$FuncTypeId}{"info_type"};
1855+ my $FuncPtrCorrectName = "";
1856+ my %TypeAttr = ("Size"=>$POINTER_SIZE, "Type"=>"FuncPtr", "TDid"=>$TypeDeclId, "Tid"=>$TypeId);
1857+ my @ParamTypeName;
1858+ if($FuncInfo =~ /retn[ ]*:[ ]*\@([0-9]+) /)
1859+ {
1860+ my $ReturnTypeId = $1;
1861+ my %ReturnAttr = getTypeAttr(getTypeDeclId($ReturnTypeId), $ReturnTypeId);
1862+ $FuncPtrCorrectName .= $ReturnAttr{"Name"};
1863+ $TypeAttr{"Return"} = $ReturnTypeId;
1864+ }
1865+ if($FuncInfo =~ /prms[ ]*:[ ]*@([0-9]+) /)
1866+ {
1867+ my $ParamTypeInfoId = $1;
1868+ my $Position = 0;
1869+ while($ParamTypeInfoId)
1870+ {
1871+ my $ParamTypeInfo = $LibInfo{$Version}{$ParamTypeInfoId}{"info"};
1872+ last if($ParamTypeInfo !~ /valu[ ]*:[ ]*@([0-9]+) /);
1873+ my $ParamTypeId = $1;
1874+ my %ParamAttr = getTypeAttr(getTypeDeclId($ParamTypeId), $ParamTypeId);
1875+ last if($ParamAttr{"Name"} eq "void");
1876+ $TypeAttr{"Memb"}{$Position}{"type"} = $ParamTypeId;
1877+ push(@ParamTypeName, $ParamAttr{"Name"});
1878+ last if($ParamTypeInfo !~ /chan[ ]*:[ ]*@([0-9]+) /);
1879+ $ParamTypeInfoId = $1;
1880+ $Position+=1;
1881+ }
1882+ }
1883+ if($FuncInfo_Type eq "function_type")
1884+ {
1885+ $FuncPtrCorrectName .= " (*) (".join(", ", @ParamTypeName).")";
1886+ }
1887+ elsif($FuncInfo_Type eq "method_type")
1888+ {
1889+ if($FuncInfo =~ /clas[ ]*:[ ]*@([0-9]+) /)
1890+ {
1891+ my $ClassId = $1;
1892+ my $ClassName = $TypeDescr{$Version}{getTypeDeclId($ClassId)}{$ClassId}{"Name"};
1893+ if($ClassName)
1894+ {
1895+ $FuncPtrCorrectName .= " ($ClassName\:\:*) (".join(", ", @ParamTypeName).")";
1896+ }
1897+ else
1898+ {
1899+ $FuncPtrCorrectName .= " (*) (".join(", ", @ParamTypeName).")";
1900+ }
1901+ }
1902+ else
1903+ {
1904+ $FuncPtrCorrectName .= " (*) (".join(", ", @ParamTypeName).")";
1905+ }
1906+ }
1907+ $TypeAttr{"Name"} = correctName($FuncPtrCorrectName);
1908+ return %TypeAttr;
1909+}
1910+
1911+sub getTypeName($)
1912+{
1913+ my $Info = $LibInfo{$Version}{$_[0]}{"info"};
1914+ if($Info =~ /name[ ]*:[ ]*@([0-9]+) /)
1915+ {
1916+ return getNameByInfo($1);
1917+ }
1918+ else
1919+ {
1920+ if($LibInfo{$Version}{$_[0]}{"info_type"} eq "integer_type")
1921+ {
1922+ if($LibInfo{$Version}{$_[0]}{"info"} =~ /unsigned/)
1923+ {
1924+ return "unsigned int";
1925+ }
1926+ else
1927+ {
1928+ return "int";
1929+ }
1930+ }
1931+ else
1932+ {
1933+ return "";
1934+ }
1935+ }
1936+}
1937+
1938+sub selectBaseType($$)
1939+{
1940+ my ($TypeDeclId, $TypeId) = @_;
1941+ my $TypeInfo = $LibInfo{$Version}{$TypeId}{"info"};
1942+ my $BaseTypeDeclId;
1943+ my $Type_Type = getTypeType($TypeDeclId, $TypeId);
1944+ #qualifications
1945+ if(($LibInfo{$Version}{$TypeId}{"info"} =~ /qual[ ]*:[ ]*c /) and ($LibInfo{$Version}{$TypeId}{"info"} =~ /unql[ ]*:[ ]*\@([0-9]+) /))
1946+ {
1947+ return ($1, getTypeDeclId($1), "const");
1948+ }
1949+ elsif(($LibInfo{$Version}{$TypeId}{"info"} =~ /qual[ ]*:[ ]*r /) and ($LibInfo{$Version}{$TypeId}{"info"} =~ /unql[ ]*:[ ]*\@([0-9]+) /))
1950+ {
1951+ return ($1, getTypeDeclId($1), "restrict");
1952+ }
1953+ elsif(($LibInfo{$Version}{$TypeId}{"info"} =~ /qual[ ]*:[ ]*v /) and ($LibInfo{$Version}{$TypeId}{"info"} =~ /unql[ ]*:[ ]*\@([0-9]+) /))
1954+ {
1955+ return ($1, getTypeDeclId($1), "volatile");
1956+ }
1957+ elsif((not ($LibInfo{$Version}{$TypeId}{"info"} =~ /qual[ ]*:/)) and ($LibInfo{$Version}{$TypeId}{"info"} =~ /unql[ ]*:[ ]*\@([0-9]+) /))
1958+ {#typedefs
1959+ return ($1, getTypeDeclId($1), "");
1960+ }
1961+ elsif($LibInfo{$Version}{$TypeId}{"info_type"} eq "reference_type")
1962+ {
1963+ if($TypeInfo =~ /refd[ ]*:[ ]*@([0-9]+) /)
1964+ {
1965+ return ($1, getTypeDeclId($1), "&");
1966+ }
1967+ else
1968+ {
1969+ return (0, 0, "");
1970+ }
1971+ }
1972+ elsif($LibInfo{$Version}{$TypeId}{"info_type"} eq "array_type")
1973+ {
1974+ if($TypeInfo =~ /elts[ ]*:[ ]*@([0-9]+) /)
1975+ {
1976+ return ($1, getTypeDeclId($1), "");
1977+ }
1978+ else
1979+ {
1980+ return (0, 0, "");
1981+ }
1982+ }
1983+ elsif($LibInfo{$Version}{$TypeId}{"info_type"} eq "pointer_type")
1984+ {
1985+ if($TypeInfo =~ /ptd[ ]*:[ ]*@([0-9]+) /)
1986+ {
1987+ return ($1, getTypeDeclId($1), "*");
1988+ }
1989+ else
1990+ {
1991+ return (0, 0, "");
1992+ }
1993+ }
1994+ else
1995+ {
1996+ return (0, 0, "");
1997+ }
1998+}
1999+
2000+sub getFuncDescr_All()
2001+{
2002+ foreach (sort {int($b)<=>int($a)} keys(%{$LibInfo{$Version}}))
2003+ {
2004+ if($LibInfo{$Version}{$_}{"info_type"} eq "function_decl")
2005+ {
2006+ getFuncDescr($_);
2007+ }
2008+ }
2009+}
2010+
2011+sub getVarDescr_All()
2012+{
2013+ foreach (sort {int($b)<=>int($a)} keys(%{$LibInfo{$Version}}))
2014+ {
2015+ if($LibInfo{$Version}{$_}{"info_type"} eq "var_decl")
2016+ {
2017+ getVarDescr($_);
2018+ }
2019+ }
2020+}
2021+
2022+sub getVarDescr($)
2023+{
2024+ my $FuncInfoId = $_[0];
2025+ if($LibInfo{$Version}{getNameSpaceId($FuncInfoId)}{"info_type"} eq "function_decl")
2026+ {
2027+ return;
2028+ }
2029+ ($FuncDescr{$Version}{$FuncInfoId}{"Header"}, $FuncDescr{$Version}{$FuncInfoId}{"Line"}) = getLocation($FuncInfoId);
2030+ if((not $FuncDescr{$Version}{$FuncInfoId}{"Header"}) or ($FuncDescr{$Version}{$FuncInfoId}{"Header"}=~/\<built\-in\>|\<internal\>/))
2031+ {
2032+ delete($FuncDescr{$Version}{$FuncInfoId});
2033+ return;
2034+ }
2035+ $FuncDescr{$Version}{$FuncInfoId}{"ShortName"} = getNameByInfo($FuncInfoId);
2036+ $FuncDescr{$Version}{$FuncInfoId}{"MnglName"} = getFuncMnglName($FuncInfoId);
2037+ if($FuncDescr{$Version}{$FuncInfoId}{"MnglName"} and $FuncDescr{$Version}{$FuncInfoId}{"MnglName"}!~/\A_Z/)
2038+ {
2039+ delete($FuncDescr{$Version}{$FuncInfoId});
2040+ return;
2041+ }
2042+ if(not $FuncDescr{$Version}{$FuncInfoId}{"MnglName"})
2043+ {
2044+ $FuncDescr{$Version}{$FuncInfoId}{"Name"} = $FuncDescr{$Version}{$FuncInfoId}{"ShortName"};
2045+ $FuncDescr{$Version}{$FuncInfoId}{"MnglName"} = $FuncDescr{$Version}{$FuncInfoId}{"ShortName"};
2046+ }
2047+ if(not is_in_library($FuncDescr{$Version}{$FuncInfoId}{"MnglName"}, $Version) and not $CheckHeadersOnly)
2048+ {
2049+ delete $FuncDescr{$Version}{$FuncInfoId};
2050+ return;
2051+ }
2052+ $FuncDescr{$Version}{$FuncInfoId}{"Return"} = getTypeId($FuncInfoId);
2053+ delete($FuncDescr{$Version}{$FuncInfoId}{"Return"}) if(not $FuncDescr{$Version}{$FuncInfoId}{"Return"});
2054+ $FuncDescr{$Version}{$FuncInfoId}{"Data"} = 1;
2055+ set_Class_And_Namespace($FuncInfoId);
2056+ setFuncAccess($FuncInfoId);
2057+ if($FuncDescr{$Version}{$FuncInfoId}{"MnglName"} =~ /\A_ZTV/)
2058+ {
2059+ delete($FuncDescr{$Version}{$FuncInfoId}{"Return"});
2060+ }
2061+ if($FuncDescr{$Version}{$FuncInfoId}{"ShortName"} =~ /\A_Z/)
2062+ {
2063+ delete($FuncDescr{$Version}{$FuncInfoId}{"ShortName"});
2064+ }
2065+}
2066+
2067+sub getTrivialTypeAttr($$)
2068+{
2069+ my ($TypeInfoId, $TypeId) = @_;
2070+ my %TypeAttr = ();
2071+ return if(getTypeTypeByTypeId($TypeId)!~/Intrinsic|Union|Struct|Enum/);
2072+ setTypeAccess($TypeId, \%TypeAttr);
2073+ ($TypeAttr{"Header"}, $TypeAttr{"Line"}) = getLocation($TypeInfoId);
2074+ if(($TypeAttr{"Header"} eq "<built-in>") or ($TypeAttr{"Header"} eq "<internal>"))
2075+ {
2076+ delete($TypeAttr{"Header"});
2077+ }
2078+ $TypeAttr{"Name"} = getNameByInfo($TypeInfoId);
2079+ $TypeAttr{"Name"} = getTypeName($TypeId) if(not $TypeAttr{"Name"});
2080+ my $NameSpaceId = getNameSpaceId($TypeInfoId);
2081+ if($NameSpaceId ne $TypeId)
2082+ {
2083+ $TypeAttr{"NameSpace"} = getNameSpace($TypeInfoId);
2084+ }
2085+ if($TypeAttr{"NameSpace"} and isNotAnon($TypeAttr{"Name"}))
2086+ {
2087+ $TypeAttr{"Name"} = $TypeAttr{"NameSpace"}."::".$TypeAttr{"Name"};
2088+ }
2089+ $TypeAttr{"Name"} = correctName($TypeAttr{"Name"});
2090+ if(isAnon($TypeAttr{"Name"}))
2091+ {
2092+ $TypeAttr{"Name"} = "anon-";
2093+ $TypeAttr{"Name"} .= $TypeAttr{"Header"}."-".$TypeAttr{"Line"};
2094+ }
2095+ $TypeAttr{"Size"} = getSize($TypeId)/8;
2096+ $TypeAttr{"Type"} = getTypeType($TypeInfoId, $TypeId);
2097+ if($TypeAttr{"Type"} eq "Struct" and has_methods($TypeId))
2098+ {
2099+ $TypeAttr{"Type"} = "Class";
2100+ }
2101+ if(($TypeAttr{"Type"} eq "Struct") or ($TypeAttr{"Type"} eq "Class"))
2102+ {
2103+ setBaseClasses($TypeInfoId, $TypeId, \%TypeAttr);
2104+ }
2105+ setTypeMemb($TypeInfoId, $TypeId, \%TypeAttr);
2106+ $TypeAttr{"Tid"} = $TypeId;
2107+ $TypeAttr{"TDid"} = $TypeInfoId;
2108+ $Tid_TDid{$Version}{$TypeId} = $TypeInfoId;
2109+ if(not $TName_Tid{$Version}{$TypeAttr{"Name"}})
2110+ {
2111+ $TName_Tid{$Version}{$TypeAttr{"Name"}} = $TypeId;
2112+ }
2113+ return %TypeAttr;
2114+}
2115+
2116+sub has_methods($)
2117+{
2118+ my $TypeId = $_[0];
2119+ my $Info = $LibInfo{$Version}{$TypeId}{"info"};
2120+ return ($Info=~/(fncs)[ ]*:[ ]*@([0-9]+) /);
2121+}
2122+
2123+sub setBaseClasses($$$)
2124+{
2125+ my ($TypeInfoId, $TypeId, $TypeAttr) = @_;
2126+ my $Info = $LibInfo{$Version}{$TypeId}{"info"};
2127+ if($Info =~ /binf[ ]*:[ ]*@([0-9]+) /)
2128+ {
2129+ $Info = $LibInfo{$Version}{$1}{"info"};
2130+ while($Info =~ /accs[ ]*:[ ]*([a-z]+) /)
2131+ {
2132+ last if($Info !~ s/accs[ ]*:[ ]*([a-z]+) //);
2133+ my $Access = $1;
2134+ last if($Info !~ s/binf[ ]*:[ ]*@([0-9]+) //);
2135+ my $BInfoId = $1;
2136+ my $ClassId = getBinfClassId($BInfoId);
2137+ if($Access eq "pub")
2138+ {
2139+ $TypeAttr->{"BaseClass"}{$ClassId} = "public";
2140+ }
2141+ elsif($Access eq "prot")
2142+ {
2143+ $TypeAttr->{"BaseClass"}{$ClassId} = "protected";
2144+ }
2145+ elsif($Access eq "priv")
2146+ {
2147+ $TypeAttr->{"BaseClass"}{$ClassId} = "private";
2148+ }
2149+ else
2150+ {
2151+ $TypeAttr->{"BaseClass"}{$ClassId} = "private";
2152+ }
2153+ }
2154+ }
2155+}
2156+
2157+sub getBinfClassId($)
2158+{
2159+ my $Info = $LibInfo{$Version}{$_[0]}{"info"};
2160+ $Info =~ /type[ ]*:[ ]*@([0-9]+) /;
2161+ return $1;
2162+}
2163+
2164+sub get_func_signature($)
2165+{
2166+ my $FuncInfoId = $_[0];
2167+ my $PureSignature = $FuncDescr{$Version}{$FuncInfoId}{"ShortName"};
2168+ my @ParamTypes = ();
2169+ foreach my $ParamPos (sort {int($a) <=> int($b)} keys(%{$FuncDescr{$Version}{$FuncInfoId}{"Param"}}))
2170+ {#checking parameters
2171+ my $ParamType_Id = $FuncDescr{$Version}{$FuncInfoId}{"Param"}{$ParamPos}{"type"};
2172+ my $ParamType_Name = uncover_typedefs($TypeDescr{$Version}{getTypeDeclId($ParamType_Id)}{$ParamType_Id}{"Name"});
2173+ @ParamTypes = (@ParamTypes, $ParamType_Name);
2174+ }
2175+ $PureSignature = $PureSignature."(".join(", ", @ParamTypes).")";
2176+ $PureSignature = delete_keywords($PureSignature);
2177+ return correctName($PureSignature);
2178+}
2179+
2180+sub delete_keywords($)
2181+{
2182+ my $TypeName = $_[0];
2183+ $TypeName =~ s/(\W|\A)(enum |struct |union |class )/$1/g;
2184+ return $TypeName;
2185+}
2186+
2187+sub uncover_typedefs($)
2188+{
2189+ my $TypeName = $_[0];
2190+ return "" if(not $TypeName);
2191+ return $Cache{"uncover_typedefs"}{$Version}{$TypeName} if(defined $Cache{"uncover_typedefs"}{$Version}{$TypeName});
2192+ my ($TypeName_New, $TypeName_Pre) = (correctName($TypeName), "");
2193+ while($TypeName_New ne $TypeName_Pre)
2194+ {
2195+ $TypeName_Pre = $TypeName_New;
2196+ my $TypeName_Copy = $TypeName_New;
2197+ my %Words = ();
2198+ while($TypeName_Copy=~s/(\W|\A)([a-z_][\w:]*)(\W|\Z)//io)
2199+ {
2200+ my $Word = $2;
2201+ next if(not $Word or $Word=~/\A(true|false|const|int|long|void|short|float|unsigned|char|double|class|struct|union|enum)\Z/);
2202+ $Words{$Word} = 1;
2203+ }
2204+ foreach my $Word (keys(%Words))
2205+ {
2206+ my $BaseType_Name = $Typedef_BaseName{$Version}{$Word};
2207+ next if($TypeName_New=~/(\W|\A)(struct $Word|union $Word|enum $Word)(\W|\Z)/);
2208+ next if(not $BaseType_Name);
2209+ if($BaseType_Name=~/\([*]+\)/)
2210+ {
2211+ $TypeName_New =~ /$Word(.*)\Z/;
2212+ my $Type_Suffix = $1;
2213+ $TypeName_New = $BaseType_Name;
2214+ if($TypeName_New =~ s/\(([*]+)\)/($1 $Type_Suffix)/)
2215+ {
2216+ $TypeName_New = correctName($TypeName_New);
2217+ }
2218+ }
2219+ else
2220+ {
2221+ if($TypeName_New =~ s/(\W|\A)$Word(\W|\Z)/$1$BaseType_Name$2/g)
2222+ {
2223+ $TypeName_New = correctName($TypeName_New);
2224+ }
2225+ }
2226+ }
2227+ }
2228+ $Cache{"uncover_typedefs"}{$Version}{$TypeName} = $TypeName_New;
2229+ return $TypeName_New;
2230+}
2231+
2232+sub isInternal($)
2233+{
2234+ my $FuncInfoId = $_[0];
2235+ my $FuncInfo = $LibInfo{$Version}{$_[0]}{"info"};
2236+ return 0 if($FuncInfo !~ /mngl[ ]*:[ ]*@([0-9]+) /);
2237+ my $FuncMnglNameInfoId = $1;
2238+ return ($LibInfo{$Version}{$FuncMnglNameInfoId}{"info"} =~ /\*[ ]*INTERNAL[ ]*\*/);
2239+}
2240+
2241+sub set_Class_And_Namespace($)
2242+{
2243+ my $FuncInfoId = $_[0];
2244+ my $FuncInfo = $LibInfo{$Version}{$FuncInfoId}{"info"};
2245+ if($FuncInfo =~ /scpe[ ]*:[ ]*@([0-9]+) /)
2246+ {
2247+ my $NameSpaceInfoId = $1;
2248+ if($LibInfo{$Version}{$NameSpaceInfoId}{"info_type"} eq "namespace_decl")
2249+ {
2250+ my $NameSpaceInfo = $LibInfo{$Version}{$NameSpaceInfoId}{"info"};
2251+ if($NameSpaceInfo =~ /name[ ]*:[ ]*@([0-9]+) /)
2252+ {
2253+ my $NameSpaceId = $1;
2254+ my $NameSpaceIdentifier = $LibInfo{$Version}{$NameSpaceId}{"info"};
2255+ if($NameSpaceIdentifier =~ /strg[ ]*:[ ]*(.*)[ ]+lngt/)
2256+ {
2257+ my $NameSpace = $1;
2258+ $NameSpace =~ s/[ ]+\Z//g;
2259+ $FuncDescr{$Version}{$FuncInfoId}{"NameSpace"} = $NameSpace;
2260+ }
2261+ }
2262+ }
2263+ elsif($LibInfo{$Version}{$NameSpaceInfoId}{"info_type"} eq "record_type")
2264+ {
2265+ $FuncDescr{$Version}{$FuncInfoId}{"Class"} = $NameSpaceInfoId;
2266+ }
2267+ }
2268+}
2269+
2270+sub getFuncDescr($)
2271+{
2272+ my $FuncInfoId = $_[0];
2273+ return if(isInternal($FuncInfoId));
2274+ ($FuncDescr{$Version}{$FuncInfoId}{"Header"}, $FuncDescr{$Version}{$FuncInfoId}{"Line"}) = getLocation($FuncInfoId);
2275+ if(not $FuncDescr{$Version}{$FuncInfoId}{"Header"} or $FuncDescr{$Version}{$FuncInfoId}{"Header"}=~/\<built\-in\>|\<internal\>/)
2276+ {
2277+ delete($FuncDescr{$Version}{$FuncInfoId});
2278+ return;
2279+ }
2280+ setFuncAccess($FuncInfoId);
2281+ setFuncKind($FuncInfoId);
2282+ if($FuncDescr{$Version}{$FuncInfoId}{"PseudoTemplate"})
2283+ {
2284+ delete($FuncDescr{$Version}{$FuncInfoId});
2285+ return;
2286+ }
2287+ $FuncDescr{$Version}{$FuncInfoId}{"Type"} = getFuncType($FuncInfoId);
2288+ $FuncDescr{$Version}{$FuncInfoId}{"Return"} = getFuncReturn($FuncInfoId);
2289+ delete($FuncDescr{$Version}{$FuncInfoId}{"Return"}) if(not $FuncDescr{$Version}{$FuncInfoId}{"Return"});
2290+ $FuncDescr{$Version}{$FuncInfoId}{"ShortName"} = getFuncShortName(getFuncOrig($FuncInfoId));
2291+ if($FuncDescr{$Version}{$FuncInfoId}{"ShortName"} =~ /\._/)
2292+ {
2293+ delete($FuncDescr{$Version}{$FuncInfoId});
2294+ return;
2295+ }
2296+ if(defined $TemplateInstance_Func{$Version}{$FuncInfoId})
2297+ {
2298+ my @TmplParams = ();
2299+ foreach my $ParamPos (sort {int($a) <=> int($b)} keys(%{$TemplateInstance_Func{$Version}{$FuncInfoId}}))
2300+ {
2301+ my $Param = get_TemplateParam($TemplateInstance_Func{$Version}{$FuncInfoId}{$ParamPos});
2302+ if($Param eq "")
2303+ {
2304+ delete($FuncDescr{$Version}{$FuncInfoId});
2305+ return;
2306+ }
2307+ push(@TmplParams, $Param);
2308+ }
2309+ $FuncDescr{$Version}{$FuncInfoId}{"ShortName"} .= "<".join(", ", @TmplParams).">";
2310+ }
2311+ setFuncParams($FuncInfoId);
2312+ $FuncDescr{$Version}{$FuncInfoId}{"MnglName"} = getFuncMnglName($FuncInfoId);
2313+ if($FuncDescr{$Version}{$FuncInfoId}{"MnglName"} and $FuncDescr{$Version}{$FuncInfoId}{"MnglName"}!~/\A_Z/)
2314+ {
2315+ delete($FuncDescr{$Version}{$FuncInfoId});
2316+ return;
2317+ }
2318+
2319+ if((is_in_library($FuncDescr{$Version}{$FuncInfoId}{"ShortName"}, $Version) or $CheckHeadersOnly) and not $FuncDescr{$Version}{$FuncInfoId}{"MnglName"} and ($FuncDescr{$Version}{$FuncInfoId}{"Type"} eq "Function"))
2320+ {
2321+ $FuncDescr{$Version}{$FuncInfoId}{"MnglName"} = $FuncDescr{$Version}{$FuncInfoId}{"ShortName"};
2322+ }
2323+ set_Class_And_Namespace($FuncInfoId);
2324+ if(not $FuncDescr{$Version}{$FuncInfoId}{"MnglName"} and not $FuncDescr{$Version}{$FuncInfoId}{"Class"})
2325+ {#this section only for c++ functions without class that have not been mangled in the tree
2326+ $FuncDescr{$Version}{$FuncInfoId}{"MnglName"} = $mangled_name{get_func_signature($FuncInfoId)};
2327+ }
2328+ if(not is_in_library($FuncDescr{$Version}{$FuncInfoId}{"MnglName"}, $Version) and not $CheckHeadersOnly)
2329+ {#src only
2330+ delete($FuncDescr{$Version}{$FuncInfoId});
2331+ return;
2332+ }
2333+ if($FuncDescr{$Version}{$FuncInfoId}{"Constructor"} or $FuncDescr{$Version}{$FuncInfoId}{"Destructor"})
2334+ {
2335+ delete($FuncDescr{$Version}{$FuncInfoId}{"Return"});
2336+ }
2337+ my $FuncBody = getFuncBody($FuncInfoId);
2338+ if($FuncBody eq "defined")
2339+ {
2340+ $FuncDescr{$Version}{$FuncInfoId}{"InLine"} = 1;
2341+ }
2342+ if($CheckHeadersOnly and $FuncDescr{$Version}{$FuncInfoId}{"InLine"})
2343+ {
2344+ delete($FuncDescr{$Version}{$FuncInfoId});
2345+ return;
2346+ }
2347+ if(($FuncDescr{$Version}{$FuncInfoId}{"Type"} eq "Method") or $FuncDescr{$Version}{$FuncInfoId}{"Constructor"} or $FuncDescr{$Version}{$FuncInfoId}{"Destructor"})
2348+ {
2349+ if($FuncDescr{$Version}{$FuncInfoId}{"MnglName"}!~/\A_Z/)
2350+ {
2351+ delete($FuncDescr{$Version}{$FuncInfoId});
2352+ return;
2353+ }
2354+ }
2355+ if(getFuncSpec($FuncInfoId) eq "Virt")
2356+ {#virtual methods
2357+ $FuncDescr{$Version}{$FuncInfoId}{"Virt"} = 1;
2358+ }
2359+ if(getFuncSpec($FuncInfoId) eq "PureVirt")
2360+ {#pure virtual methods
2361+ $FuncDescr{$Version}{$FuncInfoId}{"PureVirt"} = 1;
2362+ }
2363+ if($FuncDescr{$Version}{$FuncInfoId}{"MnglName"} =~ /\A_Z/ and $FuncDescr{$Version}{$FuncInfoId}{"Class"})
2364+ {
2365+ if($FuncDescr{$Version}{$FuncInfoId}{"Type"} eq "Function")
2366+ {#static methods
2367+ $FuncDescr{$Version}{$FuncInfoId}{"Static"} = 1;
2368+ }
2369+ }
2370+ if(getFuncLink($FuncInfoId) eq "Static")
2371+ {
2372+ $FuncDescr{$Version}{$FuncInfoId}{"Static"} = 1;
2373+ }
2374+ delete($FuncDescr{$Version}{$FuncInfoId}{"Type"});
2375+}
2376+
2377+sub getFuncBody($)
2378+{
2379+ my $FuncInfo = $LibInfo{$Version}{$_[0]}{"info"};
2380+ if($FuncInfo =~ /body[ ]*:[ ]*undefined(\ |\Z)/i)
2381+ {
2382+ return "undefined";
2383+ }
2384+ elsif($FuncInfo =~ /body[ ]*:[ ]*@([0-9]+)(\ |\Z)/i)
2385+ {
2386+ return "defined";
2387+ }
2388+ else
2389+ {
2390+ return "";
2391+ }
2392+}
2393+
2394+sub getTypeShortName($)
2395+{
2396+ my $TypeName = $_[0];
2397+ $TypeName =~ s/\<.*\>//g;
2398+ $TypeName =~ s/.*\:\://g;
2399+ return $TypeName;
2400+}
2401+
2402+sub getBackRef($)
2403+{
2404+ my $TypeInfo = $LibInfo{$Version}{$_[0]}{"info"};
2405+ if($TypeInfo =~ /name[ ]*:[ ]*@([0-9]+) /)
2406+ {
2407+ return $1;
2408+ }
2409+ else
2410+ {
2411+ return "";
2412+ }
2413+}
2414+
2415+sub getTypeId($)
2416+{
2417+ my $TypeInfo = $LibInfo{$Version}{$_[0]}{"info"};
2418+ if($TypeInfo =~ /type[ ]*:[ ]*@([0-9]+) /)
2419+ {
2420+ return $1;
2421+ }
2422+ else
2423+ {
2424+ return "";
2425+ }
2426+}
2427+
2428+sub getFuncId($)
2429+{
2430+ my $FuncInfo = $LibInfo{$Version}{$_[0]}{"info"};
2431+ if($FuncInfo =~ /type[ ]*:[ ]*@([0-9]+) /)
2432+ {
2433+ return $1;
2434+ }
2435+ else
2436+ {
2437+ return "";
2438+ }
2439+}
2440+
2441+sub setTypeMemb($$)
2442+{
2443+ my ($TypeDeclId, $TypeId, $TypeAttr) = @_;
2444+ my $TypeInfo = $LibInfo{$Version}{$TypeId}{"info"};
2445+ my $TypeMembInfoId;
2446+ my $TypeType = $TypeAttr->{"Type"};
2447+ my $Position = 0;
2448+ my $BasePosition = 0;
2449+ my $TypeTypeInfoId;
2450+ my $StructMembName;
2451+ if($TypeType eq "Enum")
2452+ {
2453+ $TypeMembInfoId = getEnumMembInfoId($TypeId);
2454+ while($TypeMembInfoId)
2455+ {
2456+ $TypeAttr->{"Memb"}{$Position}{"value"} = getEnumMembVal($TypeMembInfoId);
2457+ my $MembName = getEnumMembName($TypeMembInfoId);
2458+ $TypeAttr->{"Memb"}{$Position}{"name"} = getEnumMembName($TypeMembInfoId);
2459+ $EnumMembName_Id{$Version}{getTreeAttr($TypeMembInfoId, "valu")} = ($TypeAttr->{"NameSpace"})?$TypeAttr->{"NameSpace"}."::".$MembName:$MembName;
2460+ $TypeMembInfoId = getNextMembInfoId($TypeMembInfoId);
2461+ $Position += 1;
2462+ }
2463+ }
2464+ elsif(($TypeType eq "Struct") or ($TypeType eq "Class") or ($TypeType eq "Union"))
2465+ {
2466+ $TypeMembInfoId = getStructMembInfoId($TypeId);
2467+ while($TypeMembInfoId)
2468+ {
2469+ if($LibInfo{$Version}{$TypeMembInfoId}{"info_type"} ne "field_decl")
2470+ {
2471+ $TypeMembInfoId = getNextStructMembInfoId($TypeMembInfoId);
2472+ next;
2473+ }
2474+ $StructMembName = getStructMembName($TypeMembInfoId);
2475+ if($StructMembName =~ /_vptr\./)
2476+ {#virtual tables
2477+ $TypeMembInfoId = getNextStructMembInfoId($TypeMembInfoId);
2478+ next;
2479+ }
2480+ if(not $StructMembName)
2481+ {#base classes
2482+ #$TypeAttr->{"Base"}{$BasePosition}{"type"} = getStructMembType($TypeMembInfoId);
2483+ #$TypeAttr->{"Base"}{$BasePosition}{"access"} = getStructMembAccess($TypeMembInfoId);
2484+ $BasePosition += 1;
2485+ $TypeMembInfoId = getNextStructMembInfoId($TypeMembInfoId);
2486+ next;
2487+ }
2488+ $TypeAttr->{"Memb"}{$Position}{"type"} = getStructMembType($TypeMembInfoId);
2489+ $TypeAttr->{"Memb"}{$Position}{"name"} = $StructMembName;
2490+ $TypeAttr->{"Memb"}{$Position}{"access"} = getStructMembAccess($TypeMembInfoId);
2491+ $TypeAttr->{"Memb"}{$Position}{"bitfield"} = getStructMembBitFieldSize($TypeMembInfoId);
2492+
2493+ $TypeMembInfoId = getNextStructMembInfoId($TypeMembInfoId);
2494+ $Position += 1;
2495+ }
2496+ }
2497+}
2498+
2499+sub setFuncParams($)
2500+{
2501+ my $FuncInfoId = $_[0];
2502+ my $ParamInfoId = getFuncParamInfoId($FuncInfoId);
2503+ my $FunctionType = getFuncType($FuncInfoId);
2504+ if($FunctionType eq "Method")
2505+ {
2506+ $ParamInfoId = getNextElem($ParamInfoId);
2507+ }
2508+ my $Position = 0;
2509+ while($ParamInfoId)
2510+ {
2511+ my $ParamTypeId = getFuncParamType($ParamInfoId);
2512+ last if($TypeDescr{$Version}{getTypeDeclId($ParamTypeId)}{$ParamTypeId}{"Name"} eq "void");
2513+ if($TypeDescr{$Version}{getTypeDeclId($ParamTypeId)}{$ParamTypeId}{"Type"} eq "Restrict")
2514+ {#delete restrict spec
2515+ $ParamTypeId = getRestrictBase($ParamTypeId);
2516+ }
2517+ $FuncDescr{$Version}{$FuncInfoId}{"Param"}{$Position}{"type"} = $ParamTypeId;
2518+ $FuncDescr{$Version}{$FuncInfoId}{"Param"}{$Position}{"name"} = getFuncParamName($ParamInfoId);
2519+ if(not $FuncDescr{$Version}{$FuncInfoId}{"Param"}{$Position}{"name"})
2520+ {
2521+ $FuncDescr{$Version}{$FuncInfoId}{"Param"}{$Position}{"name"} = "p".($Position+1);
2522+ }
2523+ $ParamInfoId = getNextElem($ParamInfoId);
2524+ $Position += 1;
2525+ }
2526+ if(detect_nolimit_args($FuncInfoId))
2527+ {
2528+ $FuncDescr{$Version}{$FuncInfoId}{"Param"}{$Position}{"type"} = -1;
2529+ }
2530+}
2531+
2532+sub detect_nolimit_args($)
2533+{
2534+ my $FuncInfoId = $_[0];
2535+ my $FuncTypeId = getFuncTypeId($FuncInfoId);
2536+ my $ParamListElemId = getFuncParamTreeListId($FuncTypeId);
2537+ my $HaveVoid = 0;
2538+ my $Position = 0;
2539+ while($ParamListElemId)
2540+ {
2541+ my $ParamTypeId = getTreeAttr($ParamListElemId, "valu");
2542+ if($TypeDescr{$Version}{getTypeDeclId($ParamTypeId)}{$ParamTypeId}{"Name"} eq "void")
2543+ {
2544+ $HaveVoid = 1;
2545+ last;
2546+ }
2547+ $ParamListElemId = getNextElem($ParamListElemId);
2548+ $Position += 1;
2549+ }
2550+ return ($Position>=1 and not $HaveVoid);
2551+}
2552+
2553+sub getFuncParamTreeListId($)
2554+{
2555+ my $FuncTypeId = $_[0];
2556+ if($LibInfo{$Version}{$FuncTypeId}{"info"} =~ /prms[ ]*:[ ]*@([0-9]+) /)
2557+ {
2558+ return $1;
2559+ }
2560+ else
2561+ {
2562+ return "";
2563+ }
2564+}
2565+
2566+sub getTreeAttr($$)
2567+{
2568+ my ($Id, $Attr) = @_;
2569+ if($LibInfo{$Version}{$Id}{"info"} =~ /$Attr[ ]*:[ ]*@([0-9]+) /)
2570+ {
2571+ return $1;
2572+ }
2573+ else
2574+ {
2575+ return "";
2576+ }
2577+}
2578+
2579+sub getRestrictBase($)
2580+{
2581+ my $TypeId = $_[0];
2582+ my $TypeDeclId = getTypeDeclId($TypeId);
2583+ my $BaseTypeId = $TypeDescr{$Version}{$TypeDeclId}{$TypeId}{"BaseType"}{"Tid"};
2584+ my $BaseTypeDeclId = $TypeDescr{$Version}{$TypeDeclId}{$TypeId}{"BaseType"}{"TDid"};
2585+ return $BaseTypeId;
2586+}
2587+
2588+sub setFuncAccess($)
2589+{
2590+ my $FuncInfoId = $_[0];
2591+ if($LibInfo{$Version}{$FuncInfoId}{"info"} =~ /accs[ ]*:[ ]*([a-zA-Z]+) /)
2592+ {
2593+ my $Access = $1;
2594+ if($Access eq "prot")
2595+ {
2596+ $FuncDescr{$Version}{$FuncInfoId}{"Protected"} = 1;
2597+ }
2598+ elsif($Access eq "priv")
2599+ {
2600+ $FuncDescr{$Version}{$FuncInfoId}{"Private"} = 1;
2601+ }
2602+ }
2603+}
2604+
2605+sub setTypeAccess($$)
2606+{
2607+ my ($TypeId, $TypeAttr) = @_;
2608+ my $TypeInfo = $LibInfo{$Version}{$TypeId}{"info"};
2609+ if($TypeInfo =~ /accs[ ]*:[ ]*([a-zA-Z]+) /)
2610+ {
2611+ my $Access = $1;
2612+ if($Access eq "prot")
2613+ {
2614+ $TypeAttr->{"Protected"} = 1;
2615+ }
2616+ elsif($Access eq "priv")
2617+ {
2618+ $TypeAttr->{"Private"} = 1;
2619+ }
2620+ }
2621+}
2622+
2623+sub setFuncKind($)
2624+{
2625+ my $FuncInfoId = $_[0];
2626+ if($LibInfo{$Version}{$FuncInfoId}{"info"} =~ /pseudo tmpl/)
2627+ {
2628+ $FuncDescr{$Version}{$FuncInfoId}{"PseudoTemplate"} = 1;
2629+ }
2630+ elsif($LibInfo{$Version}{$FuncInfoId}{"info"} =~ /note[ ]*:[ ]*constructor /)
2631+ {
2632+ $FuncDescr{$Version}{$FuncInfoId}{"Constructor"} = 1;
2633+ }
2634+ elsif($LibInfo{$Version}{$FuncInfoId}{"info"} =~ /note[ ]*:[ ]*destructor /)
2635+ {
2636+ $FuncDescr{$Version}{$FuncInfoId}{"Destructor"} = 1;
2637+ }
2638+}
2639+
2640+sub getFuncSpec($)
2641+{
2642+ my $FuncInfoId = $_[0];
2643+ my $FuncInfo = $LibInfo{$Version}{$FuncInfoId}{"info"};
2644+ if($FuncInfo =~ m/spec[ ]*:[ ]*pure /)
2645+ {
2646+ return "PureVirt";
2647+ }
2648+ elsif($FuncInfo =~ m/spec[ ]*:[ ]*virt /)
2649+ {
2650+ return "Virt";
2651+ }
2652+ else
2653+ {
2654+ if($FuncInfo =~ /spec[ ]*:[ ]*([a-zA-Z]+) /)
2655+ {
2656+ return $1;
2657+ }
2658+ else
2659+ {
2660+ return "";
2661+ }
2662+ }
2663+}
2664+
2665+sub getFuncClass($)
2666+{
2667+ my $FuncInfoId = $_[0];
2668+ my $FuncInfo = $LibInfo{$Version}{$FuncInfoId}{"info"};
2669+ if($FuncInfo =~ /scpe[ ]*:[ ]*@([0-9]+) /)
2670+ {
2671+ return $1;
2672+ }
2673+ else
2674+ {
2675+ return "";
2676+ }
2677+}
2678+
2679+sub getFuncLink($)
2680+{
2681+ my $FuncInfoId = $_[0];
2682+ my $FuncInfo = $LibInfo{$Version}{$FuncInfoId}{"info"};
2683+ if($FuncInfo =~ /link[ ]*:[ ]*static /)
2684+ {
2685+ return "Static";
2686+ }
2687+ else
2688+ {
2689+ if($FuncInfo =~ /link[ ]*:[ ]*([a-zA-Z]+) /)
2690+ {
2691+ return $1;
2692+ }
2693+ else
2694+ {
2695+ return "";
2696+ }
2697+ }
2698+}
2699+
2700+sub getNextElem($)
2701+{
2702+ my $FuncInfoId = $_[0];
2703+ my $FuncInfo = $LibInfo{$Version}{$FuncInfoId}{"info"};
2704+ if($FuncInfo =~ /chan[ ]*:[ ]*@([0-9]+) /)
2705+ {
2706+ return $1;
2707+ }
2708+ else
2709+ {
2710+ return "";
2711+ }
2712+}
2713+
2714+sub getFuncParamInfoId($)
2715+{
2716+ my $FuncInfoId = $_[0];
2717+ my $FuncInfo = $LibInfo{$Version}{$FuncInfoId}{"info"};
2718+ if($FuncInfo =~ /args[ ]*:[ ]*@([0-9]+) /)
2719+ {
2720+ return $1;
2721+ }
2722+ else
2723+ {
2724+ return "";
2725+ }
2726+}
2727+
2728+sub getFuncParamType($)
2729+{
2730+ my $ParamInfoId = $_[0];
2731+ my $ParamInfo = $LibInfo{$Version}{$ParamInfoId}{"info"};
2732+ if($ParamInfo =~ /type[ ]*:[ ]*@([0-9]+) /)
2733+ {
2734+ return $1;
2735+ }
2736+ else
2737+ {
2738+ return "";
2739+ }
2740+}
2741+
2742+sub getFuncParamName($)
2743+{
2744+ my $ParamInfoId = $_[0];
2745+ my $ParamInfo = $LibInfo{$Version}{$ParamInfoId}{"info"};
2746+ return "" if($ParamInfo !~ /name[ ]*:[ ]*@([0-9]+) /);
2747+ my $NameInfoId = $1;
2748+ return "" if($LibInfo{$Version}{$NameInfoId}{"info"} !~ /strg[ ]*:[ ]*(.*)[ ]+lngt/);
2749+ my $FuncParamName = $1;
2750+ $FuncParamName =~ s/[ ]+\Z//g;
2751+ return $FuncParamName;
2752+}
2753+
2754+sub getEnumMembInfoId($)
2755+{
2756+ my $TypeInfoId = $_[0];
2757+ my $TypeInfo = $LibInfo{$Version}{$TypeInfoId}{"info"};
2758+ if($TypeInfo =~ /csts[ ]*:[ ]*@([0-9]+) /)
2759+ {
2760+ return $1;
2761+ }
2762+ else
2763+ {
2764+ return "";
2765+ }
2766+}
2767+
2768+sub getStructMembInfoId($)
2769+{
2770+ my $TypeInfoId = $_[0];
2771+ my $TypeInfo = $LibInfo{$Version}{$TypeInfoId}{"info"};
2772+ if($TypeInfo =~ /flds[ ]*:[ ]*@([0-9]+) /)
2773+ {
2774+ return $1;
2775+ }
2776+ else
2777+ {
2778+ return "";
2779+ }
2780+}
2781+
2782+sub getNameSpace($)
2783+{
2784+ my $TypeInfoId = $_[0];
2785+ my $TypeInfo = $LibInfo{$Version}{$TypeInfoId}{"info"};
2786+ return "" if($TypeInfo !~ /scpe[ ]*:[ ]*@([0-9]+) /);
2787+ my $NameSpaceInfoId = $1;
2788+ if($LibInfo{$Version}{$NameSpaceInfoId}{"info_type"} eq "namespace_decl")
2789+ {
2790+ my $NameSpaceInfo = $LibInfo{$Version}{$NameSpaceInfoId}{"info"};
2791+ if($NameSpaceInfo =~ /name[ ]*:[ ]*@([0-9]+) /)
2792+ {
2793+ my $NameSpaceId = $1;
2794+ my $NameSpaceIdentifier = $LibInfo{$Version}{$NameSpaceId}{"info"};
2795+ return "" if($NameSpaceIdentifier !~ /strg[ ]*:[ ]*(.*)[ ]+lngt/);
2796+ my $NameSpace = $1;
2797+ $NameSpace =~ s/[ ]+\Z//g;
2798+ my $BaseNameSpace = getNameSpace($NameSpaceInfoId);
2799+ $NameSpace = $BaseNameSpace."::".$NameSpace if($BaseNameSpace);
2800+ return $NameSpace;
2801+ }
2802+ else
2803+ {
2804+ return "";
2805+ }
2806+ }
2807+ elsif($LibInfo{$Version}{$NameSpaceInfoId}{"info_type"} eq "record_type")
2808+ {
2809+ my %NameSpaceAttr = getTypeAttr(getTypeDeclId($NameSpaceInfoId), $NameSpaceInfoId);
2810+ return $NameSpaceAttr{"Name"};
2811+ }
2812+ else
2813+ {
2814+ return "";
2815+ }
2816+}
2817+
2818+sub getNameSpaceId($)
2819+{
2820+ my $TypeInfoId = $_[0];
2821+ my $TypeInfo = $LibInfo{$Version}{$TypeInfoId}{"info"};
2822+ if($TypeInfo =~ /scpe[ ]*:[ ]*@([0-9]+) /)
2823+ {
2824+ return $1;
2825+ }
2826+ else
2827+ {
2828+ return "";
2829+ }
2830+}
2831+
2832+sub getEnumMembName($)
2833+{
2834+ my $TypeMembInfoId = $_[0];
2835+ return "" if($LibInfo{$Version}{$TypeMembInfoId}{"info"} !~ /purp[ ]*:[ ]*@([0-9]+)/);
2836+ my $Purp = $1;
2837+ return "" if($LibInfo{$Version}{$Purp}{"info"} !~ /strg[ ]*:[ ]*(.*)[ ]+lngt/);
2838+ my $EnumMembName = $1;
2839+ $EnumMembName =~ s/[ ]+\Z//g;
2840+ return $EnumMembName;
2841+}
2842+
2843+sub getStructMembName($)
2844+{
2845+ my $TypeMembInfoId = $_[0];
2846+ return "" if($LibInfo{$Version}{$TypeMembInfoId}{"info"} !~ /name[ ]*:[ ]*@([0-9]+) /);
2847+ my $NameInfoId = $1;
2848+ return "" if($LibInfo{$Version}{$NameInfoId}{"info"} !~ /strg[ ]*:[ ]*(.*)[ ]+lngt/);
2849+ my $StructMembName = $1;
2850+ $StructMembName =~ s/[ ]+\Z//g;
2851+ return $StructMembName;
2852+}
2853+
2854+sub getEnumMembVal($)
2855+{
2856+ my $TypeMembInfoId = $_[0];
2857+ return "" if($LibInfo{$Version}{$TypeMembInfoId}{"info"} !~ /valu[ ]*:[ ]*@([0-9]+) /);
2858+ my $Valu = $1;
2859+ if($LibInfo{$Version}{$Valu}{"info"} =~ /low[ ]*:[ ]*(-?[0-9]+) /)
2860+ {
2861+ return $1;
2862+ }
2863+ else
2864+ {
2865+ return "";
2866+ }
2867+}
2868+
2869+sub getSize($)
2870+{
2871+ my $Info = $LibInfo{$Version}{$_[0]}{"info"};
2872+ if($Info =~ /size[ ]*:[ ]*@([0-9]+) /)
2873+ {
2874+ my $SizeInfoId = $1;
2875+ if($LibInfo{$Version}{$SizeInfoId}{"info"} =~ /low[ ]*:[ ]*(-?[0-9]+) /)
2876+ {
2877+ return $1;
2878+ }
2879+ else
2880+ {
2881+ return "";
2882+ }
2883+ }
2884+ else
2885+ {
2886+ return 0;
2887+ }
2888+}
2889+
2890+sub getStructMembType($)
2891+{
2892+ my $TypeMembInfoId = $_[0];
2893+ if($LibInfo{$Version}{$TypeMembInfoId}{"info"} =~ /type[ ]*:[ ]*@([0-9]+) /)
2894+ {
2895+ return $1;
2896+ }
2897+ else
2898+ {
2899+ return "";
2900+ }
2901+}
2902+
2903+sub getStructMembBitFieldSize($)
2904+{
2905+ my $TypeMembInfoId = $_[0];
2906+ if($LibInfo{$Version}{$TypeMembInfoId}{"info"} =~ / bitfield /)
2907+ {
2908+ return getSize($TypeMembInfoId);
2909+ }
2910+ else
2911+ {
2912+ return 0;
2913+ }
2914+}
2915+
2916+sub getStructMembAccess($)
2917+{
2918+ my $MembInfo = $LibInfo{$Version}{$_[0]}{"info"};
2919+ if($MembInfo =~ /accs[ ]*:[ ]*([a-zA-Z]+) /)
2920+ {
2921+ my $Access = $1;
2922+ if($Access eq "prot")
2923+ {
2924+ return "protected";
2925+ }
2926+ elsif($Access eq "priv")
2927+ {
2928+ return "private";
2929+ }
2930+ else
2931+ {
2932+ return "public";
2933+ }
2934+ }
2935+ else
2936+ {
2937+ return "public";
2938+ }
2939+}
2940+
2941+sub getNextMembInfoId($)
2942+{
2943+ my $TypeMembInfoId = $_[0];
2944+ if($LibInfo{$Version}{$TypeMembInfoId}{"info"} =~ /chan[ ]*:[ ]*@([0-9]+) /)
2945+ {
2946+ return $1;
2947+ }
2948+ else
2949+ {
2950+ return "";
2951+ }
2952+}
2953+
2954+sub getNextStructMembInfoId($)
2955+{
2956+ my $TypeMembInfoId = $_[0];
2957+ if($LibInfo{$Version}{$TypeMembInfoId}{"info"} =~ /chan[ ]*:[ ]*@([0-9]+) /)
2958+ {
2959+ return $1;
2960+ }
2961+ else
2962+ {
2963+ return "";
2964+ }
2965+}
2966+
2967+sub fieldHasName($)
2968+{
2969+ my $TypeMembInfoId = $_[0];
2970+ if($LibInfo{$Version}{$TypeMembInfoId}{"info_type"} eq "field_decl")
2971+ {
2972+ if($LibInfo{$Version}{$TypeMembInfoId}{"info"} =~ /name[ ]*:[ ]*@([0-9]+) /)
2973+ {
2974+ return $1;
2975+ }
2976+ else
2977+ {
2978+ return "";
2979+ }
2980+ }
2981+ else
2982+ {
2983+ return 0;
2984+ }
2985+}
2986+
2987+sub getTypeHeader($)
2988+{
2989+ my $TypeInfo = $LibInfo{$Version}{$_[0]}{"info"};
2990+ if($TypeInfo =~ /srcp[ ]*:[ ]*([0-9a-zA-Z\_\-\<\>\.\+]+):([0-9]+) /)
2991+ {
2992+ return ($1, $2);
2993+ }
2994+ else
2995+ {
2996+ return ();
2997+ }
2998+}
2999+
3000+sub register_header($$$)
3001+{
3002+ my ($Destination, $Position, $LibVersion) = @_;
3003+ return if(not $Destination);
3004+ if($Destination=~/\A\// and not -f $Destination)
3005+ {
3006+ print "\nERROR: specified header \'$Destination\' does not exist\n";
3007+ return;
3008+ }
3009+ my $Header_Name = get_FileName($Destination);
3010+ $Headers{$LibVersion}{$Destination}{"Name"} = $Header_Name;
3011+ $Headers{$LibVersion}{$Destination}{"Position"} = $Position;
3012+ $Headers{$LibVersion}{$Destination}{"Identity"} = $Destination;
3013+ $HeaderName_Destinations{$LibVersion}{$Header_Name}{$Destination} = 1;
3014+}
3015+
3016+sub headerSearch($)
3017+{
3018+ my $LibVersion = $_[0];
3019+ foreach my $Dest (split("\n", $Descriptor{$LibVersion}{"Include_Paths"}))
3020+ {
3021+ $Dest =~ s/\A\s+|\s+\Z//g;
3022+ next if(not $Dest);
3023+ if(not -e $Dest)
3024+ {
3025+ print "ERROR: can't access \'$Dest\'\n";
3026+ }
3027+ $Header_Dependency{$LibVersion}{$Dest} = 1;
3028+ }
3029+ foreach my $Dest (split("\n", $Descriptor{$LibVersion}{"Headers"}))
3030+ {#fill %Header_Dependency
3031+ if(-d $Dest)
3032+ {
3033+ foreach my $Dir (cmd_find($Dest,"d",""))
3034+ {
3035+ chomp($Dir);
3036+ $Header_Dependency{$LibVersion}{$Dir} = 1;
3037+ }
3038+ }
3039+ elsif(-f $Dest)
3040+ {
3041+ $Header_Dependency{$LibVersion}{get_Dir($Dest)} = 1;
3042+ }
3043+ }
3044+ my $Position = 0;
3045+ foreach my $Dest (split("\n", $Descriptor{$LibVersion}{"Headers"}))
3046+ {
3047+ $Dest =~ s/\A\s+|\s+\Z//g;
3048+ next if(not $Dest);
3049+ if(is_header($Dest, $LibVersion))
3050+ {
3051+ register_header($Dest, $Position, $LibVersion);
3052+ $Position += 1;
3053+ }
3054+ elsif(-d $Dest)
3055+ {
3056+ foreach my $Destination (sort {lc($a) cmp lc($b)} (cmd_find($Dest,"f","")))
3057+ {
3058+ chomp($Destination);
3059+ next if(not is_header($Destination, $LibVersion));
3060+ register_header($Destination, $Position, $LibVersion);
3061+ $Position += 1;
3062+ }
3063+ }
3064+ else
3065+ {
3066+ print "WARNING: \'$Dest\' was not found in the specified include paths\n";
3067+ register_header($Dest, $Position, $LibVersion);
3068+ $Position += 1;
3069+ }
3070+ }
3071+ if(keys(%{$Headers{$LibVersion}})==1)
3072+ {
3073+ my $Destination = (keys(%{$Headers{$LibVersion}}))[0];
3074+ $Headers{$LibVersion}{$Destination}{"Identity"} = $Headers{$LibVersion}{$Destination}{"Name"};
3075+ }
3076+ foreach my $Header_Name (keys(%{$HeaderName_Destinations{$LibVersion}}))
3077+ {#set relative paths (for dublicates)
3078+ if(keys(%{$HeaderName_Destinations{$LibVersion}{$Header_Name}})>1)
3079+ {
3080+ my $FirstDest = (keys(%{$HeaderName_Destinations{$LibVersion}{$Header_Name}}))[0];
3081+ my $Prefix = get_Dir($FirstDest);
3082+ while($Prefix =~ /\A(.+)\/[^\/]+\Z/)
3083+ {
3084+ my $NewPrefix = $1;
3085+ my $Changes_Number = 0;
3086+ my %Identity = ();
3087+ foreach my $Dest (keys(%{$HeaderName_Destinations{$LibVersion}{$Header_Name}}))
3088+ {
3089+ if($Dest =~ /\A$Prefix\/(.*)\Z/)
3090+ {
3091+ $Identity{$Dest} = $1;
3092+ $Changes_Number+=1;
3093+ }
3094+ }
3095+ if($Changes_Number eq keys(%{$HeaderName_Destinations{$LibVersion}{$Header_Name}}))
3096+ {
3097+ foreach my $Dest (keys(%{$HeaderName_Destinations{$LibVersion}{$Header_Name}}))
3098+ {
3099+ $Headers{$LibVersion}{$Dest}{"Identity"} = $Identity{$Dest};
3100+ }
3101+ last;
3102+ }
3103+ $Prefix = $NewPrefix;
3104+ }
3105+ }
3106+ }
3107+ if(not keys(%{$Headers{$LibVersion}}))
3108+ {
3109+ print "ERROR: header files were not found\n";
3110+ exit(1);
3111+ }
3112+}
3113+
3114+sub get_FileName($)
3115+{
3116+ my $Path = $_[0];
3117+ if($Path =~ /\A(.*\/)([^\/]*)\Z/)
3118+ {
3119+ return $2;
3120+ }
3121+ else
3122+ {
3123+ return $Path;
3124+ }
3125+}
3126+
3127+sub get_Dir($)
3128+{
3129+ my $Path = $_[0];
3130+ return "" if($Path =~ m*\A\./*);
3131+ if($Path =~ /\A(.*)\/([^\/]*)\Z/)
3132+ {
3133+ return $1;
3134+ }
3135+ else
3136+ {
3137+ return "";
3138+ }
3139+}
3140+
3141+sub esc($)
3142+{
3143+ my $Str = $_[0];
3144+ $Str =~ s/([()\[\]{}$ &'"`;,<>])/\\$1/g;
3145+ return $Str;
3146+}
3147+
3148+sub getLocation($)
3149+{
3150+ my $TypeInfo = $LibInfo{$Version}{$_[0]}{"info"};
3151+ if($TypeInfo =~ /srcp[ ]*:[ ]*([0-9a-zA-Z\_\-\<\>\.\+]+):([0-9]+) /)
3152+ {
3153+ return ($1, $2);
3154+ }
3155+ else
3156+ {
3157+ return ();
3158+ }
3159+}
3160+
3161+sub getHeader($)
3162+{
3163+ my $TypeInfo = $LibInfo{$Version}{$_[0]}{"info"};
3164+ if($TypeInfo =~ /srcp[ ]*:[ ]*([0-9a-zA-Z\_\-\<\>\.\+]+):([0-9]+) /)
3165+ {
3166+ return $1;
3167+ }
3168+ else
3169+ {
3170+ return "";
3171+ }
3172+}
3173+
3174+sub getLine($)
3175+{
3176+ my $TypeInfo = $LibInfo{$Version}{$_[0]}{"info"};
3177+ if($TypeInfo =~ /srcp[ ]*:[ ]*([0-9a-zA-Z\_\-\<\>\.\+]+):([0-9]+) /)
3178+ {
3179+ return $2;
3180+ }
3181+ else
3182+ {
3183+ return "";
3184+ }
3185+}
3186+
3187+sub getTypeType($$)
3188+{
3189+ my ($TypeDeclId, $TypeId) = @_;
3190+ return "Const" if($LibInfo{$Version}{$TypeId}{"info"} =~ /qual[ ]*:[ ]*c / and $LibInfo{$Version}{$TypeId}{"info"} =~ /unql[ ]*:[ ]*\@/);
3191+ return "Typedef" if($LibInfo{$Version}{$TypeId}{"info"} =~ /unql[ ]*:/ and $LibInfo{$Version}{$TypeId}{"info"} !~ /qual[ ]*:/);
3192+ return "Volatile" if($LibInfo{$Version}{$TypeId}{"info"} =~ /qual[ ]*:[ ]*v / and $LibInfo{$Version}{$TypeId}{"info"} =~ /unql[ ]*:[ ]*\@/);
3193+ return "Restrict" if($LibInfo{$Version}{$TypeId}{"info"} =~ /qual[ ]*:[ ]*r / and $LibInfo{$Version}{$TypeId}{"info"} =~ /unql[ ]*:[ ]*\@/);
3194+ my $TypeType = getTypeTypeByTypeId($TypeId);
3195+ if($TypeType eq "Struct")
3196+ {
3197+ if($TypeDeclId and $LibInfo{$Version}{$TypeDeclId}{"info_type"} eq "template_decl")
3198+ {
3199+ return "Template";
3200+ }
3201+ else
3202+ {
3203+ return "Struct";
3204+ }
3205+ }
3206+ else
3207+ {
3208+ return $TypeType;
3209+ }
3210+
3211+}
3212+
3213+sub getTypeTypeByTypeId($)
3214+{
3215+ my $TypeId = $_[0];
3216+ my $TypeType = $LibInfo{$Version}{$TypeId}{"info_type"};
3217+ if($TypeType =~ /integer_type|real_type|boolean_type|void_type|complex_type/)
3218+ {
3219+ return "Intrinsic";
3220+ }
3221+ elsif(isFuncPtr($TypeId))
3222+ {
3223+ return "FuncPtr";
3224+ }
3225+ elsif($TypeType eq "pointer_type")
3226+ {
3227+ return "Pointer";
3228+ }
3229+ elsif($TypeType eq "reference_type")
3230+ {
3231+ return "Ref";
3232+ }
3233+ elsif($TypeType eq "union_type")
3234+ {
3235+ return "Union";
3236+ }
3237+ elsif($TypeType eq "enumeral_type")
3238+ {
3239+ return "Enum";
3240+ }
3241+ elsif($TypeType eq "record_type")
3242+ {
3243+ return "Struct";
3244+ }
3245+ elsif($TypeType eq "array_type")
3246+ {
3247+ return "Array";
3248+ }
3249+ elsif($TypeType eq "complex_type")
3250+ {
3251+ return "Intrinsic";
3252+ }
3253+ elsif($TypeType eq "function_type")
3254+ {
3255+ return "FunctionType";
3256+ }
3257+ elsif($TypeType eq "method_type")
3258+ {
3259+ return "MethodType";
3260+ }
3261+ else
3262+ {
3263+ return "Unknown";
3264+ }
3265+}
3266+
3267+sub getNameByInfo($)
3268+{
3269+ my $TypeInfo = $LibInfo{$Version}{$_[0]}{"info"};
3270+ return "" if($TypeInfo !~ /name[ ]*:[ ]*@([0-9]+) /);
3271+ my $TypeNameInfoId = $1;
3272+ return "" if($LibInfo{$Version}{$TypeNameInfoId}{"info"} !~ /strg[ ]*:[ ]*(.*)[ ]+lngt/);
3273+ my $TypeName = $1;
3274+ $TypeName =~ s/[ ]+\Z//g;
3275+ return $TypeName;
3276+}
3277+
3278+sub getFuncShortName($)
3279+{
3280+ my $FuncInfo = $LibInfo{$Version}{$_[0]}{"info"};
3281+ if($FuncInfo =~ / operator /)
3282+ {
3283+ if($FuncInfo =~ /note[ ]*:[ ]*conversion /)
3284+ {
3285+ return "operator ".get_TypeName($FuncDescr{$Version}{$_[0]}{"Return"});
3286+ }
3287+ else
3288+ {
3289+ return "" if($FuncInfo !~ / operator[ ]+([a-zA-Z]+) /);
3290+ return "operator".$Operator_Indication{$1};
3291+ }
3292+ }
3293+ else
3294+ {
3295+ return "" if($FuncInfo !~ /name[ ]*:[ ]*@([0-9]+) /);
3296+ my $FuncNameInfoId = $1;
3297+ return "" if($LibInfo{$Version}{$FuncNameInfoId}{"info"} !~ /strg[ ]*:[ ]*([^ ]*)[ ]+lngt/);
3298+ return $1;
3299+ }
3300+}
3301+
3302+sub getFuncMnglName($)
3303+{
3304+ my $FuncInfo = $LibInfo{$Version}{$_[0]}{"info"};
3305+ return "" if($FuncInfo !~ /mngl[ ]*:[ ]*@([0-9]+) /);
3306+ my $FuncMnglNameInfoId = $1;
3307+ return "" if($LibInfo{$Version}{$FuncMnglNameInfoId}{"info"} !~ /strg[ ]*:[ ]*([^ ]*)[ ]+/);
3308+ my $FuncMnglName = $1;
3309+ $FuncMnglName =~ s/[ ]+\Z//g;
3310+ return $FuncMnglName;
3311+}
3312+
3313+sub getFuncReturn($)
3314+{
3315+ my $FuncInfo = $LibInfo{$Version}{$_[0]}{"info"};
3316+ return "" if($FuncInfo !~ /type[ ]*:[ ]*@([0-9]+) /);
3317+ my $FuncTypeInfoId = $1;
3318+ return "" if($LibInfo{$Version}{$FuncTypeInfoId}{"info"} !~ /retn[ ]*:[ ]*@([0-9]+) /);
3319+ my $FuncReturnTypeId = $1;
3320+ if($TypeDescr{$Version}{getTypeDeclId($FuncReturnTypeId)}{$FuncReturnTypeId}{"Type"} eq "Restrict")
3321+ {#delete restrict spec
3322+ $FuncReturnTypeId = getRestrictBase($FuncReturnTypeId);
3323+ }
3324+ return $FuncReturnTypeId;
3325+}
3326+
3327+sub getFuncOrig($)
3328+{
3329+ my $FuncInfo = $LibInfo{$Version}{$_[0]}{"info"};
3330+ if($FuncInfo =~ /orig[ ]*:[ ]*@([0-9]+) /)
3331+ {
3332+ return $1;
3333+ }
3334+ else
3335+ {
3336+ return $_[0];
3337+ }
3338+}
3339+
3340+sub unmangleArray(@)
3341+{
3342+ if($#_>$MAX_COMMAND_LINE_ARGUMENTS)
3343+ {
3344+ my @Half = splice(@_, 0, ($#_+1)/2);
3345+ return (unmangleArray(@Half), unmangleArray(@_))
3346+ }
3347+ else
3348+ {
3349+ my $UnmangleCommand = "c++filt ".join(" ", @_);
3350+ return split("\n", `$UnmangleCommand`);
3351+ }
3352+}
3353+
3354+sub get_Signature($$)
3355+{
3356+ my ($Interface, $LibVersion) = @_;
3357+ return $Cache{"get_Signature"}{$Interface}{$LibVersion} if($Cache{"get_Signature"}{$Interface}{$LibVersion});
3358+ my ($MnglName, $SymbolVersion) = ($Interface, "");
3359+ if($Interface =~ /\A([^@]+)[\@]+([^@]+)\Z/)
3360+ {
3361+ ($MnglName, $SymbolVersion) = ($1, $2);
3362+ }
3363+ if($MnglName =~ /\A(_ZGV|_ZTI|_ZTS|_ZTT|_ZTV|_ZThn|_ZTv0_n)/)
3364+ {
3365+ $Cache{"get_Signature"}{$Interface}{$LibVersion} = $tr_name{$MnglName}.(($SymbolVersion)?"\@".$SymbolVersion:"");
3366+ return $Cache{"get_Signature"}{$Interface}{$LibVersion};
3367+ }
3368+ if(not $CompleteSignature{$LibVersion}{$Interface})
3369+ {
3370+ if($Interface =~ /\A_Z/)
3371+ {
3372+ $Cache{"get_Signature"}{$Interface}{$LibVersion} = $tr_name{$MnglName}.(($SymbolVersion)?"\@".$SymbolVersion:"");
3373+ return $Cache{"get_Signature"}{$Interface}{$LibVersion};
3374+ }
3375+ else
3376+ {
3377+ $Cache{"get_Signature"}{$Interface}{$LibVersion} = $Interface;
3378+ return $Interface;
3379+ }
3380+ }
3381+ my ($Func_Signature, @Param_Types_FromUnmangledName) = ();
3382+ my $ShortName = $CompleteSignature{$LibVersion}{$Interface}{"ShortName"};
3383+ if($Interface =~ /\A_Z/)
3384+ {
3385+ if($CompleteSignature{$LibVersion}{$Interface}{"Class"})
3386+ {
3387+ $Func_Signature = get_TypeName($CompleteSignature{$LibVersion}{$Interface}{"Class"}, $LibVersion)."::".(($CompleteSignature{$LibVersion}{$Interface}{"Destructor"})?"~":"").$ShortName;
3388+ }
3389+ else
3390+ {
3391+ $Func_Signature = $ShortName;
3392+ }
3393+ @Param_Types_FromUnmangledName = get_Signature_Parts($tr_name{$MnglName}, 0);
3394+ }
3395+ else
3396+ {
3397+ $Func_Signature = $MnglName;
3398+ }
3399+ my @ParamArray = ();
3400+ foreach my $Pos (sort {int($a) <=> int($b)} keys(%{$CompleteSignature{$LibVersion}{$Interface}{"Param"}}))
3401+ {
3402+ next if($Pos eq "");
3403+ my $ParamTypeId = $CompleteSignature{$LibVersion}{$Interface}{"Param"}{$Pos}{"type"};
3404+ my $ParamTypeName = $TypeDescr{$LibVersion}{$Tid_TDid{$LibVersion}{$ParamTypeId}}{$ParamTypeId}{"Name"};
3405+ $ParamTypeName = $Param_Types_FromUnmangledName[$Pos] if(not $ParamTypeName);
3406+ if(my $ParamName = $CompleteSignature{$LibVersion}{$Interface}{"Param"}{$Pos}{"name"})
3407+ {
3408+ if($ParamTypeName=~/\([*]+\)/)
3409+ {
3410+ $ParamTypeName=~s/\(([*]+)\)/\($1$ParamName\)/;
3411+ push(@ParamArray, $ParamTypeName);
3412+ }
3413+ else
3414+ {
3415+ push(@ParamArray, $ParamTypeName." ".$ParamName);
3416+ }
3417+ }
3418+ else
3419+ {
3420+ push(@ParamArray, $ParamTypeName);
3421+ }
3422+ }
3423+ if(not $CompleteSignature{$LibVersion}{$Interface}{"Data"})
3424+ {
3425+ if($Interface=~/\A_Z/)
3426+ {
3427+ if($CompleteSignature{$LibVersion}{$Interface}{"Constructor"})
3428+ {
3429+ if($Interface=~/C1/)
3430+ {
3431+ $Func_Signature .= " [in-charge]";
3432+ }
3433+ elsif($Interface=~/C2/)
3434+ {
3435+ $Func_Signature .= " [not-in-charge]";
3436+ }
3437+ }
3438+ elsif($CompleteSignature{$LibVersion}{$Interface}{"Destructor"})
3439+ {
3440+ if($Interface=~/D1/)
3441+ {
3442+ $Func_Signature .= " [in-charge]";
3443+ }
3444+ elsif($Interface=~/D2/)
3445+ {
3446+ $Func_Signature .= " [not-in-charge]";
3447+ }
3448+ elsif($Interface=~/D0/)
3449+ {
3450+ $Func_Signature .= " [in-charge-deleting]";
3451+ }
3452+ }
3453+ }
3454+ $Func_Signature .= " (".join(", ", @ParamArray).")";
3455+ }
3456+ if($Interface=~/\A_ZNK/)
3457+ {
3458+ $Func_Signature .= " const";
3459+ }
3460+ $Func_Signature .= "\@".$SymbolVersion if($SymbolVersion);
3461+ $Cache{"get_Signature"}{$Interface}{$LibVersion} = $Func_Signature;
3462+ return $Func_Signature;
3463+}
3464+
3465+sub getVarNameByAttr($)
3466+{
3467+ my $FuncInfoId = $_[0];
3468+ my $VarName;
3469+ return "" if(not $FuncDescr{$Version}{$FuncInfoId}{"ShortName"});
3470+ if($FuncDescr{$Version}{$FuncInfoId}{"Class"})
3471+ {
3472+ $VarName .= $TypeDescr{$Version}{getTypeDeclId($FuncDescr{$Version}{$FuncInfoId}{"Class"})}{$FuncDescr{$Version}{$FuncInfoId}{"Class"}}{"Name"};
3473+ $VarName .= "::";
3474+ }
3475+ $VarName .= $FuncDescr{$Version}{$FuncInfoId}{"ShortName"};
3476+ return $VarName;
3477+}
3478+
3479+sub mangleFuncName($)
3480+{
3481+ my $FuncId = $_[0];
3482+}
3483+
3484+sub getFuncType($)
3485+{
3486+ my $FuncInfo = $LibInfo{$Version}{$_[0]}{"info"};
3487+ return "" if($FuncInfo !~ /type[ ]*:[ ]*@([0-9]+) /);
3488+ my $FuncTypeInfoId = $1;
3489+ my $FunctionType = $LibInfo{$Version}{$FuncTypeInfoId}{"info_type"};
3490+ if($FunctionType eq "method_type")
3491+ {
3492+ return "Method";
3493+ }
3494+ elsif($FunctionType eq "function_type")
3495+ {
3496+ return "Function";
3497+ }
3498+ else
3499+ {
3500+ return $FunctionType;
3501+ }
3502+}
3503+
3504+sub getFuncTypeId($)
3505+{
3506+ my $FuncInfo = $LibInfo{$Version}{$_[0]}{"info"};
3507+ if($FuncInfo =~ /type[ ]*:[ ]*@([0-9]+)( |\Z)/)
3508+ {
3509+ return $1;
3510+ }
3511+ else
3512+ {
3513+ return 0;
3514+ }
3515+}
3516+
3517+sub isNotAnon($)
3518+{
3519+ return (not isAnon($_[0]));
3520+}
3521+
3522+sub isAnon($)
3523+{
3524+ return (($_[0] =~ m/\.\_[0-9]+/) or ($_[0] =~ m/anon-/));
3525+}
3526+
3527+sub unmangled_Compact($$)
3528+#Removes all non-essential (for C++ language) whitespace from a string. If
3529+#the whitespace is essential it will be replaced with exactly one ' '
3530+#character. Works correctly only for unmangled names.
3531+#If level > 1 is supplied, can relax its intent to compact the string.
3532+{
3533+ my $result=$_[0];
3534+ my $level = $_[1] || 1;
3535+ my $o1 = ($level>1)?' ':'';
3536+ #First, we reduce all spaces that we can
3537+ my $coms='[-()<>:*&~!|+=%@~"?.,/[^'."']";
3538+ my $coms_nobr='[-()<:*&~!|+=%@~"?.,'."']";
3539+ my $clos='[),;:\]]';
3540+ $result=~s/^\s+//gm;
3541+ $result=~s/\s+$//gm;
3542+ $result=~s/((?!\n)\s)+/ /g;
3543+ $result=~s/(\w+)\s+($coms+)/$1$o1$2/gm;
3544+ #$result=~s/(\w)(\()/$1$o1$2/gm if $o1;
3545+ $result=~s/($coms+)\s+(\w+)/$1$o1$2/gm;
3546+ $result=~s/(\()\s+(\w)/$1$2/gm if $o1;
3547+ $result=~s/(\w)\s+($clos)/$1$2/gm;
3548+ $result=~s/($coms+)\s+($coms+)/$1 $2/gm;
3549+ $result=~s/($coms_nobr+)\s+($coms+)/$1$o1$2/gm;
3550+ $result=~s/($coms+)\s+($coms_nobr+)/$1$o1$2/gm;
3551+ #don't forget about >> and <:. In unmangled names global-scope modifier
3552+ #is not used, so <: will always be a digraph and requires no special treatment.
3553+ #We also try to remove other parts that are better to be removed here than in other places
3554+ #double-cv
3555+ $result=~s/\bconst\s+const\b/const/gm;
3556+ $result=~s/\bvolatile\s+volatile\b/volatile/gm;
3557+ $result=~s/\bconst\s+volatile\b\s+const\b/const volatile/gm;
3558+ $result=~s/\bvolatile\s+const\b\s+volatile\b/const volatile/gm;
3559+ #Place cv in proper order
3560+ $result=~s/\bvolatile\s+const\b/const volatile/gm;
3561+ return $result;
3562+}
3563+
3564+sub unmangled_PostProcess($)
3565+{
3566+ my $result = $_[0];
3567+ #s/\bunsigned int\b/unsigned/g;
3568+ $result =~ s/\bshort unsigned int\b/unsigned short/g;
3569+ $result =~ s/\bshort int\b/short/g;
3570+ $result =~ s/\blong long unsigned int\b/unsigned long long/g;
3571+ $result =~ s/\blong unsigned int\b/unsigned long/g;
3572+ $result =~ s/\blong long int\b/long long/g;
3573+ $result =~ s/\blong int\b/long/g;
3574+ $result =~ s/\)const\b/\) const/g;
3575+ $result =~ s/\blong long unsigned\b/unsigned long long/g;
3576+ $result =~ s/\blong unsigned\b/unsigned long/g;
3577+ return $result;
3578+}
3579+
3580+# From libtodb2/libtodb.pm
3581+# Trim string spaces.
3582+sub trim($)
3583+{
3584+ my $string = shift;
3585+ $string =~ s/^\s+//;
3586+ $string =~ s/\s+$//;
3587+ return $string;
3588+}
3589+
3590+sub correctName($)
3591+{#type name correction
3592+ my $CorrectName = $_[0];
3593+ $CorrectName = unmangled_Compact($CorrectName, 1);
3594+ $CorrectName = unmangled_PostProcess($CorrectName);
3595+ return $CorrectName;
3596+}
3597+
3598+sub getDump_AllInOne()
3599+{
3600+ return if(not keys(%Headers));
3601+ `mkdir -p temp && rm -f temp/*`;
3602+ my $Header_Depend = "";
3603+ foreach my $Dep (sort {length($a) <=> length($b)} keys(%{$Header_Dependency{$Version}}))
3604+ {
3605+ $Header_Depend .= " -I".esc($Dep);
3606+ }
3607+ my $Lib_VersionName = esc($TargetLibraryName)."_v".$Version;
3608+ open(LIB_HEADER, ">temp/$TargetLibraryName"."_v$Version.h");
3609+ foreach my $Preamble_Header (sort {int($Include_Preamble{$Version}{$a}{"Position"})<=>int($Include_Preamble{$Version}{$b}{"Position"})} keys(%{$Include_Preamble{$Version}}))
3610+ {
3611+ print LIB_HEADER "#include <$Preamble_Header>\n";
3612+ }
3613+ foreach my $Destination (sort {int($Headers{$Version}{$a}{"Position"})<=>int($Headers{$Version}{$b}{"Position"})} keys(%{$Headers{$Version}}))
3614+ {
3615+ my $HName = get_FileName($Destination);
3616+ next if($Include_Preamble{$Version}{$Destination} or ($Include_Preamble{$Version}{$HName} and $HeaderName_Destinations{$Version}{$HName} and keys(%{$HeaderName_Destinations{$Version}{$HName}})==1));
3617+ print LIB_HEADER "#include <$Destination>\n";
3618+ }
3619+ close(LIB_HEADER);
3620+ system("g++ >".esc($ERR_PATH{$Version})." 2>&1 -fdump-translation-unit temp/$Lib_VersionName.h $CompilerOptions{$Version} $Header_Depend");
3621+ if($?)
3622+ {
3623+ print "WARNING: some errors have occured while compiling header(s), fix it first!\nyou can see compilation errors in the file \'$ERR_PATH{$Version}\'\n";
3624+ }
3625+ $ConstantsSrc{$Version} = cmd_preprocessor("temp/$Lib_VersionName.h", $CompilerOptions{$Version}." ".$Header_Depend, "define\\ \\|undef\\ \\|#[ ]\\+[0-9]\\+ \".*\"");
3626+ system("mkdir", "-p", "header_compile_errors/$TargetLibraryName/temp/");
3627+ system("cp", "-f", "temp/$TargetLibraryName"."_v$Version.h", "header_compile_errors/$TargetLibraryName/temp/");
3628+ return (split("\n", `find . -maxdepth 1 -name "$Lib_VersionName\.h*\.tu"`))[0];
3629+}
3630+
3631+sub getDump_Separately($)
3632+{
3633+ `mkdir -p temp`;
3634+ `rm -f temp/*`;
3635+ my $Destination = $_[0];
3636+ my $Header_Depend = "";
3637+ foreach my $Dep (sort {length($a) <=> length($b)} keys(%{$Header_Dependency{$Version}}))
3638+ {
3639+ $Header_Depend .= " -I".esc($Dep);
3640+ }
3641+ my $Lib_VersionName = esc($TargetLibraryName)."_v".$Version;
3642+ open(LIB_HEADER, ">temp/$TargetLibraryName"."_v$Version.h");
3643+ foreach my $Preamble_Header (sort {int($Include_Preamble{$Version}{$a}{"Position"})<=>int($Include_Preamble{$Version}{$b}{"Position"})} keys(%{$Include_Preamble{$Version}}))
3644+ {
3645+ print LIB_HEADER "#include <$Preamble_Header>\n";
3646+ }
3647+ my $Destination_HName = get_FileName($Destination);
3648+ if(not ( $Include_Preamble{$Version}{$Destination} or ($Include_Preamble{$Version}{$Destination_HName} and $HeaderName_Destinations{$Version}{$Destination_HName} and keys(%{$HeaderName_Destinations{$Version}{$Destination_HName}})==1) ))
3649+ {
3650+ print LIB_HEADER "#include <$Destination>\n";
3651+ }
3652+ close(LIB_HEADER);
3653+ system("g++ >>".esc($ERR_PATH{$Version})." 2>&1 -fdump-translation-unit temp/$Lib_VersionName.h $CompilerOptions{$Version} $Header_Depend");
3654+ if($?)
3655+ {
3656+ $HeaderCompileError{get_FileName($Destination)} = 1;
3657+ }
3658+ $ConstantsSrc{$Version} .= cmd_preprocessor("temp/$Lib_VersionName.h", $CompilerOptions{$Version}." ".$Header_Depend, "define\\ \\|undef\\ \\|#[ ]\\+[0-9]\\+ \".*\"");
3659+ return (split("\n", `find . -maxdepth 1 -name "$Lib_VersionName\.h*\.tu"`))[0];
3660+}
3661+
3662+sub cmd_file($)
3663+{
3664+ my $Path = $_[0];
3665+ return "" if(not $Path or not -e $Path);
3666+ my $Cmd = "file ".esc($Path);
3667+ my $Cmd_Out = `$Cmd`;
3668+ return $Cmd_Out;
3669+}
3670+
3671+sub cmd_preprocessor($$$)
3672+{
3673+ my ($Path, $AddOpt, $Grep) = @_;
3674+ return "" if(not $Path or not -f $Path);
3675+ my $Cmd = "g++ -dD -E -x c++-header ".esc($Path)." 2>/dev/null $AddOpt";
3676+ if($Grep)
3677+ {
3678+ $Cmd .= " | grep \"$Grep\"";
3679+ }
3680+ my $Cmd_Out = `$Cmd`;
3681+ return $Cmd_Out;
3682+}
3683+
3684+sub cmd_cat($$)
3685+{
3686+ my ($Path, $Grep) = @_;
3687+ return "" if(not $Path or not -e $Path);
3688+ my $Cmd = "cat ".esc($Path);
3689+ if($Grep)
3690+ {
3691+ $Cmd .= " | grep \"$Grep\"";
3692+ }
3693+ my $Cmd_Out = `$Cmd`;
3694+ return $Cmd_Out;
3695+}
3696+
3697+sub cmd_find($$$)
3698+{
3699+ my ($Path, $Type, $Name) = @_;
3700+ return () if(not $Path or not -e $Path);
3701+ my $Cmd = "find ".esc($Path);
3702+ if($Type)
3703+ {
3704+ $Cmd .= " -type $Type";
3705+ }
3706+ if($Name)
3707+ {
3708+ $Cmd .= " -name \"$Name\"";
3709+ }
3710+ return split("\n", `$Cmd`);
3711+}
3712+
3713+sub cmd_tar($)
3714+{
3715+ my $Path = $_[0];
3716+ return "" if(not $Path or not -e $Path);
3717+ my $Cmd = "tar -xvzf ".esc($Path);
3718+ my $Cmd_Out = `$Cmd`;
3719+ return $Cmd_Out;
3720+}
3721+
3722+sub is_header($$)
3723+{
3724+ my ($Destination, $LibVersion) = @_;
3725+ return 0 if(-d $Destination);
3726+ return 1 if($Destination =~ /\.(h|hh|hhh|hpp|tcc)\Z/i);
3727+ return 0 if($Destination =~ /\.\w+\Z/i);#cpp|c|gch|tu|fs|pas
3728+ if($Destination =~ /\A\//)
3729+ {
3730+ return (cmd_file($Destination) =~ /:[ ]*ASCII C[\+]* program text/);
3731+ }
3732+ else
3733+ {
3734+ foreach my $Prefix (keys(%{$Header_Dependency{$LibVersion}}))
3735+ {
3736+ my $Path = $Prefix."/".$Destination;
3737+ if(-f $Path)
3738+ {
3739+ if(cmd_file($Path) =~ /:[ ]*ASCII C[\+]* program text/)
3740+ {
3741+ return 1;
3742+ }
3743+ }
3744+ }
3745+ return 0;
3746+ }
3747+}
3748+
3749+sub parseHeaders_AllInOne($)
3750+{
3751+ $Version = $_[0];
3752+ print "checking header(s) ".$Descriptor{$Version}{"Version"}." ...\n";
3753+ system("mkdir", "-p", "header_compile_errors/".$TargetLibraryName);
3754+ system("rm", "-fr", $ERR_PATH{$Version});
3755+ my $DumpPath = getDump_AllInOne();
3756+ if(not $DumpPath)
3757+ {
3758+ print "\nERROR: can't create gcc syntax tree for header(s)\nyou can see compilation errors in the file '$ERR_PATH{$Version}'\n";
3759+ exit(1);
3760+ }
3761+ getInfo($DumpPath);
3762+ parse_constants();
3763+ system("rm", "-fr", "temp");
3764+}
3765+
3766+sub parseHeader($)
3767+{
3768+ my $Destination = $_[0];
3769+ my $DumpPath = getDump_Separately($Destination);
3770+ if(not $DumpPath)
3771+ {
3772+ print "ERROR: can't create gcc syntax tree for header\nyou can see compilation errors in the file '$ERR_PATH{$Version}'\n";
3773+ exit(1);
3774+ }
3775+ getInfo($DumpPath);
3776+ parse_constants();
3777+ system("rm", "-fr", "temp");
3778+}
3779+
3780+sub is_in_library($$)
3781+{
3782+ my ($MnglName, $LibVersion) = @_;
3783+ return ($Interface_Library{$LibVersion}{$MnglName} or ($SymVer{$LibVersion}{$MnglName} and $Interface_Library{$LibVersion}{$SymVer{$LibVersion}{$MnglName}}));
3784+}
3785+
3786+sub prepareInterfaces($)
3787+{
3788+ my $LibVersion = $_[0];
3789+ my (@MnglNames, @UnMnglNames) = ();
3790+ if($CheckHeadersOnly)
3791+ {
3792+ foreach my $FuncInfoId (sort keys(%{$FuncDescr{$LibVersion}}))
3793+ {
3794+ if($FuncDescr{$LibVersion}{$FuncInfoId}{"MnglName"} =~ /\A_Z/)
3795+ {
3796+ push(@MnglNames, $FuncDescr{$LibVersion}{$FuncInfoId}{"MnglName"});
3797+ }
3798+ }
3799+ if($#MnglNames > -1)
3800+ {
3801+ @UnMnglNames = reverse(unmangleArray(@MnglNames));
3802+ foreach my $FuncInfoId (sort keys(%{$FuncDescr{$LibVersion}}))
3803+ {
3804+ if($FuncDescr{$LibVersion}{$FuncInfoId}{"MnglName"} =~ /\A_Z/)
3805+ {
3806+ my $UnmangledName = pop(@UnMnglNames);
3807+ $tr_name{$FuncDescr{$LibVersion}{$FuncInfoId}{"MnglName"}} = $UnmangledName;
3808+ }
3809+ }
3810+ }
3811+ }
3812+ my (%NotMangled_Int, %Mangled_Int) = ();
3813+ foreach my $FuncInfoId (keys(%{$FuncDescr{$LibVersion}}))
3814+ {
3815+ my $MnglName = $FuncDescr{$LibVersion}{$FuncInfoId}{"MnglName"};
3816+ if($MnglName=~/\A_Z/)
3817+ {
3818+ $Mangled_Int{$FuncInfoId} = $MnglName;
3819+ }
3820+ else
3821+ {
3822+ $NotMangled_Int{$FuncInfoId} = $MnglName;
3823+ }
3824+ next if(not $MnglName or not is_in_library($MnglName, $LibVersion) and not $CheckHeadersOnly);
3825+ next if($MnglName =~ /\A_Z/ and $tr_name{$MnglName} =~ /\.\_[0-9]/);
3826+ next if(not $FuncDescr{$LibVersion}{$FuncInfoId}{"Header"});
3827+ %{$CompleteSignature{$LibVersion}{$MnglName}} = %{$FuncDescr{$LibVersion}{$FuncInfoId}};
3828+ #interface and its symlink have same signatures
3829+ if($SymVer{$LibVersion}{$MnglName})
3830+ {
3831+ %{$CompleteSignature{$LibVersion}{$SymVer{$LibVersion}{$MnglName}}} = %{$FuncDescr{$LibVersion}{$FuncInfoId}};
3832+ }
3833+ delete($FuncDescr{$LibVersion}{$FuncInfoId});
3834+ }
3835+ if(keys(%Mangled_Int))
3836+ {
3837+ foreach my $Interface_Id (keys(%NotMangled_Int))
3838+ {
3839+ delete($CompleteSignature{$LibVersion}{$NotMangled_Int{$Interface_Id}});
3840+ }
3841+ }
3842+}
3843+
3844+my %UsedType;
3845+sub cleanData($)
3846+{
3847+ my $LibVersion = $_[0];
3848+ foreach my $FuncInfoId (keys(%{$FuncDescr{$LibVersion}}))
3849+ {
3850+ my $MnglName = $FuncDescr{$LibVersion}{$FuncInfoId}{"MnglName"};
3851+ if(not $MnglName or not is_in_library($MnglName, $LibVersion) and not $CheckHeadersOnly)
3852+ {
3853+ delete($FuncDescr{$LibVersion}{$FuncInfoId});
3854+ next;
3855+ }
3856+ if(defined $InterfacesListPath and not $InterfacesList{$MnglName})
3857+ {
3858+ delete($FuncDescr{$LibVersion}{$FuncInfoId});
3859+ next;
3860+ }
3861+ if(defined $AppPath and not $InterfacesList_App{$MnglName})
3862+ {
3863+ delete($FuncDescr{$LibVersion}{$FuncInfoId});
3864+ next;
3865+ }
3866+ my %FuncInfo = %{$FuncDescr{$LibVersion}{$FuncInfoId}};
3867+ detect_TypeUsing($Tid_TDid{$LibVersion}{$FuncInfo{"Return"}}, $FuncInfo{"Return"}, $LibVersion);
3868+ detect_TypeUsing($Tid_TDid{$LibVersion}{$FuncInfo{"Class"}}, $FuncInfo{"Class"}, $LibVersion);
3869+ foreach my $Param_Pos (keys(%{$FuncInfo{"Param"}}))
3870+ {
3871+ my $Param_TypeId = $FuncInfo{"Param"}{$Param_Pos}{"type"};
3872+ detect_TypeUsing($Tid_TDid{$LibVersion}{$Param_TypeId}, $Param_TypeId, $LibVersion);
3873+ }
3874+ }
3875+ foreach my $TDid (keys(%{$TypeDescr{$LibVersion}}))
3876+ {
3877+ foreach my $Tid (keys(%{$TypeDescr{$LibVersion}{$TDid}}))
3878+ {
3879+ if(not $UsedType{$LibVersion}{$TDid}{$Tid})
3880+ {
3881+ delete($TypeDescr{$LibVersion}{$TDid}{$Tid});
3882+ if(not keys(%{$TypeDescr{$LibVersion}{$TDid}}))
3883+ {
3884+ delete($TypeDescr{$LibVersion}{$TDid});
3885+ }
3886+ delete($Tid_TDid{$LibVersion}{$Tid}) if($Tid_TDid{$LibVersion}{$Tid} eq $TDid);
3887+ }
3888+ }
3889+ }
3890+}
3891+
3892+sub detect_TypeUsing($$$)
3893+{
3894+ my ($TypeDeclId, $TypeId, $LibVersion) = @_;
3895+ return if($UsedType{$LibVersion}{$TypeDeclId}{$TypeId});
3896+ my %Type = get_Type($TypeDeclId, $TypeId, $LibVersion);
3897+ if($Type{"Type"} =~ /Struct|Union|Class|FuncPtr|Enum/)
3898+ {
3899+ $UsedType{$LibVersion}{$TypeDeclId}{$TypeId} = 1;
3900+ foreach my $Memb_Pos (keys(%{$Type{"Memb"}}))
3901+ {
3902+ my $Member_TypeId = $Type{"Memb"}{$Memb_Pos}{"type"};
3903+ detect_TypeUsing($Tid_TDid{$LibVersion}{$Member_TypeId}, $Member_TypeId, $LibVersion);
3904+ }
3905+ if($Type{"Type"} eq "FuncPtr")
3906+ {
3907+ my $ReturnType = $Type{"Return"};
3908+ detect_TypeUsing($Tid_TDid{$LibVersion}{$ReturnType}, $ReturnType, $LibVersion);
3909+ }
3910+ }
3911+ elsif($Type{"Type"} =~ /Const|Pointer|Ref|Volatile|Restrict|Array|/)
3912+ {
3913+ $UsedType{$LibVersion}{$TypeDeclId}{$TypeId} = 1;
3914+ detect_TypeUsing($Type{"BaseType"}{"TDid"}, $Type{"BaseType"}{"Tid"}, $LibVersion);
3915+ }
3916+ elsif($Type{"Type"} eq "Intrinsic")
3917+ {
3918+ $UsedType{$LibVersion}{$TypeDeclId}{$TypeId} = 1;
3919+ }
3920+ else
3921+ {
3922+ delete($TypeDescr{$LibVersion}{$TypeDeclId}{$TypeId});
3923+ if(not keys(%{$TypeDescr{$LibVersion}{$TypeDeclId}}))
3924+ {
3925+ delete($TypeDescr{$LibVersion}{$TypeDeclId});
3926+ }
3927+ delete($Tid_TDid{$LibVersion}{$TypeId}) if($Tid_TDid{$LibVersion}{$TypeId} eq $TypeDeclId);
3928+ }
3929+}
3930+
3931+sub initializeClassVirtFunc($)
3932+{
3933+ my $LibVersion = $_[0];
3934+ foreach my $Interface (keys(%{$CompleteSignature{$LibVersion}}))
3935+ {
3936+ if($CompleteSignature{$LibVersion}{$Interface}{"Virt"})
3937+ {
3938+ my $ClassName = $TypeDescr{$LibVersion}{$Tid_TDid{$LibVersion}{$CompleteSignature{$LibVersion}{$Interface}{"Class"}}}{$CompleteSignature{$LibVersion}{$Interface}{"Class"}}{"Name"};
3939+ $ClassVirtFunc{$LibVersion}{$ClassName}{$Interface} = 1;
3940+ $ClassIdVirtFunc{$LibVersion}{$CompleteSignature{$LibVersion}{$Interface}{"Class"}}{$Interface} = 1;
3941+ $ClassId{$LibVersion}{$ClassName} = $CompleteSignature{$LibVersion}{$Interface}{"Class"};
3942+ }
3943+ }
3944+}
3945+
3946+sub checkVirtFuncRedefinitions($)
3947+{
3948+ my $LibVersion = $_[0];
3949+ foreach my $Class_Name (keys(%{$ClassVirtFunc{$LibVersion}}))
3950+ {
3951+ $CheckedTypes{$Class_Name} = 1;
3952+ foreach my $VirtFuncName (keys(%{$ClassVirtFunc{$LibVersion}{$Class_Name}}))
3953+ {
3954+ $CompleteSignature{$LibVersion}{$VirtFuncName}{"VirtualRedefine"} = find_virtual_method_in_base_classes($VirtFuncName, $ClassId{$LibVersion}{$Class_Name}, $LibVersion);
3955+ }
3956+ }
3957+}
3958+
3959+sub setVirtFuncPositions($)
3960+{
3961+ my $LibVersion = $_[0];
3962+ foreach my $Class_Name (keys(%{$ClassVirtFunc{$LibVersion}}))
3963+ {
3964+ $CheckedTypes{$Class_Name} = 1;
3965+ my $Position = 0;
3966+ foreach my $VirtFuncName (sort {int($CompleteSignature{$LibVersion}{$a}{"Line"}) <=> int($CompleteSignature{$LibVersion}{$b}{"Line"})} keys(%{$ClassVirtFunc{$LibVersion}{$Class_Name}}))
3967+ {
3968+ if($ClassVirtFunc{1}{$Class_Name}{$VirtFuncName} and $ClassVirtFunc{2}{$Class_Name}{$VirtFuncName} and not $CompleteSignature{1}{$VirtFuncName}{"VirtualRedefine"} and not $CompleteSignature{2}{$VirtFuncName}{"VirtualRedefine"})
3969+ {
3970+ $CompleteSignature{$LibVersion}{$VirtFuncName}{"Position"} = $Position;
3971+ $Position += 1;
3972+ }
3973+ }
3974+ }
3975+}
3976+
3977+sub check_VirtualTable($$)
3978+{
3979+ my ($TargetFunction, $LibVersion) = @_;
3980+ my $Class_Id = $CompleteSignature{$LibVersion}{$TargetFunction}{"Class"};
3981+ my $Class_DId = $Tid_TDid{$LibVersion}{$Class_Id};
3982+ my %Class_Type = get_Type($Class_DId, $Class_Id, $LibVersion);
3983+ $CheckedTypes{$Class_Type{"Name"}} = 1;
3984+ foreach my $VirtFuncName (keys(%{$ClassVirtFunc{2}{$Class_Type{"Name"}}}))
3985+ {#Added
3986+ if($ClassId{1}{$Class_Type{"Name"}} and not $ClassVirtFunc{1}{$Class_Type{"Name"}}{$VirtFuncName} and $AddedInt{$VirtFuncName})
3987+ {
3988+ if($CompleteSignature{2}{$VirtFuncName}{"VirtualRedefine"})
3989+ {
3990+ if($TargetFunction eq $VirtFuncName)
3991+ {
3992+ my $BaseClass_Id = $CompleteSignature{2}{$CompleteSignature{2}{$VirtFuncName}{"VirtualRedefine"}}{"Class"};
3993+ my %BaseClass_Type = get_Type($Tid_TDid{2}{$BaseClass_Id}, $BaseClass_Id, 2);
3994+ my $BaseClass_Name = $BaseClass_Type{"Name"};
3995+ %{$CompatProblems{$TargetFunction}{"Virtual_Function_Redefinition"}{$tr_name{$CompleteSignature{2}{$VirtFuncName}{"VirtualRedefine"}}}}=(
3996+ "Type_Name"=>$Class_Type{"Name"},
3997+ "Type_Type"=>$Class_Type{"Type"},
3998+ "Header"=>$CompleteSignature{2}{$TargetFunction}{"Header"},
3999+ "Line"=>$CompleteSignature{2}{$TargetFunction}{"Line"},
4000+ "Target"=>$tr_name{$CompleteSignature{2}{$VirtFuncName}{"VirtualRedefine"}},
4001+ "Signature"=>$tr_name{$TargetFunction},
4002+ "Old_Value"=>$tr_name{$CompleteSignature{2}{$VirtFuncName}{"VirtualRedefine"}},
4003+ "New_Value"=>$tr_name{$TargetFunction},
4004+ "Old_SoName"=>$Interface_Library{1}{$TargetFunction},
4005+ "New_SoName"=>$Interface_Library{2}{$TargetFunction} );
4006+ }
4007+ }
4008+ elsif($TargetFunction ne $VirtFuncName)
4009+ {
4010+ %{$CompatProblems{$TargetFunction}{"Added_Virtual_Function"}{$tr_name{$VirtFuncName}}}=(
4011+ "Type_Name"=>$Class_Type{"Name"},
4012+ "Type_Type"=>$Class_Type{"Type"},
4013+ "Header"=>$Class_Type{"Header"},
4014+ "Line"=>$Class_Type{"Line"},
4015+ "Target"=>$tr_name{$VirtFuncName},
4016+ "Signature"=>$tr_name{$TargetFunction},
4017+ "Old_SoName"=>$Interface_Library{1}{$TargetFunction},
4018+ "New_SoName"=>$Interface_Library{2}{$TargetFunction} );
4019+ }
4020+ }
4021+ }
4022+ foreach my $VirtFuncName (keys(%{$ClassVirtFunc{1}{$Class_Type{"Name"}}}))
4023+ {#Withdrawn
4024+ if($ClassId{2}{$Class_Type{"Name"}} and not $ClassVirtFunc{2}{$Class_Type{"Name"}}{$VirtFuncName} and $WithdrawnInt{$VirtFuncName})
4025+ {
4026+ if($CompleteSignature{1}{$VirtFuncName}{"VirtualRedefine"})
4027+ {
4028+ if($TargetFunction eq $VirtFuncName)
4029+ {
4030+ my $BaseClass_Id = $CompleteSignature{1}{$CompleteSignature{1}{$VirtFuncName}{"VirtualRedefine"}}{"Class"};
4031+ my $BaseClass_Name = $TypeDescr{1}{$Tid_TDid{1}{$BaseClass_Id}}{$BaseClass_Id}{"Name"};
4032+ %{$CompatProblems{$TargetFunction}{"Virtual_Function_Redefinition_B"}{$tr_name{$CompleteSignature{1}{$VirtFuncName}{"VirtualRedefine"}}}}=(
4033+ "Type_Name"=>$Class_Type{"Name"},
4034+ "Type_Type"=>$Class_Type{"Type"},
4035+ "Header"=>$CompleteSignature{2}{$TargetFunction}{"Header"},
4036+ "Line"=>$CompleteSignature{2}{$TargetFunction}{"Line"},
4037+ "Target"=>$tr_name{$CompleteSignature{1}{$VirtFuncName}{"VirtualRedefine"}},
4038+ "Signature"=>$tr_name{$TargetFunction},
4039+ "Old_Value"=>$tr_name{$TargetFunction},
4040+ "New_Value"=>$tr_name{$CompleteSignature{1}{$VirtFuncName}{"VirtualRedefine"}},
4041+ "Old_SoName"=>$Interface_Library{1}{$TargetFunction},
4042+ "New_SoName"=>$Interface_Library{2}{$TargetFunction} );
4043+ }
4044+ }
4045+ else
4046+ {
4047+ %{$CompatProblems{$TargetFunction}{"Withdrawn_Virtual_Function"}{$tr_name{$VirtFuncName}}}=(
4048+ "Type_Name"=>$Class_Type{"Name"},
4049+ "Type_Type"=>$Class_Type{"Type"},
4050+ "Header"=>$Class_Type{"Header"},
4051+ "Line"=>$Class_Type{"Line"},
4052+ "Target"=>$tr_name{$VirtFuncName},
4053+ "Signature"=>$tr_name{$TargetFunction},
4054+ "Old_SoName"=>$Interface_Library{1}{$TargetFunction},
4055+ "New_SoName"=>$Interface_Library{2}{$TargetFunction} );
4056+ }
4057+ }
4058+ }
4059+}
4060+
4061+sub find_virtual_method_in_base_classes($$$)
4062+{
4063+ my ($VirtFuncName, $Checked_ClassId, $LibVersion) = @_;
4064+ foreach my $BaseClass_Id (keys(%{$TypeDescr{$LibVersion}{$Tid_TDid{$LibVersion}{$Checked_ClassId}}{$Checked_ClassId}{"BaseClass"}}))
4065+ {
4066+ my $VirtMethodInClass = find_virtual_method_in_class($VirtFuncName, $BaseClass_Id, $LibVersion);
4067+ if($VirtMethodInClass)
4068+ {
4069+ return $VirtMethodInClass;
4070+ }
4071+ my $VirtMethodInBaseClasses = find_virtual_method_in_base_classes($VirtFuncName, $BaseClass_Id, $LibVersion);
4072+ if($VirtMethodInBaseClasses)
4073+ {
4074+ return $VirtMethodInBaseClasses;
4075+ }
4076+ }
4077+ return "";
4078+}
4079+
4080+sub find_virtual_method_in_class($$$)
4081+{
4082+ my ($VirtFuncName, $Checked_ClassId, $LibVersion) = @_;
4083+ my $Suffix = getFuncSuffix($VirtFuncName, $LibVersion);
4084+ foreach my $Checked_VirtFuncName (keys(%{$ClassIdVirtFunc{$LibVersion}{$Checked_ClassId}}))
4085+ {
4086+ if($Suffix eq getFuncSuffix($Checked_VirtFuncName, $LibVersion)
4087+ and ((not $CompleteSignature{$LibVersion}{$VirtFuncName}{"Constructor"} and not $CompleteSignature{$LibVersion}{$VirtFuncName}{"Destructor"} and $CompleteSignature{$LibVersion}{$VirtFuncName}{"ShortName"} eq $CompleteSignature{$LibVersion}{$Checked_VirtFuncName}{"ShortName"}) or ($CompleteSignature{$LibVersion}{$VirtFuncName}{"Constructor"} or $CompleteSignature{$LibVersion}{$VirtFuncName}{"Destructor"})))
4088+ {
4089+ return $Checked_VirtFuncName;
4090+ }
4091+ }
4092+ return "";
4093+}
4094+
4095+sub getFuncSuffix($$)
4096+{
4097+ my ($FuncName, $LibVersion) = @_;
4098+ my $ClassId = $CompleteSignature{$LibVersion}{$FuncName}{"Class"};
4099+ my $ClassName = $TypeDescr{$LibVersion}{$Tid_TDid{$LibVersion}{$ClassId}}{$ClassId}{"Name"};
4100+ my $ShortName = $CompleteSignature{$LibVersion}{$FuncName}{"ShortName"};
4101+ my $Suffix = $tr_name{$FuncName};
4102+ $Suffix =~ s/\A$ClassName\:\:[~]*$ShortName[ ]*//g;
4103+ return $Suffix;
4104+}
4105+
4106+sub isRecurType($$$$)
4107+{
4108+ foreach (@RecurTypes)
4109+ {
4110+ if($_->{"Tid1"} eq $_[0]
4111+ and $_->{"TDid1"} eq $_[1]
4112+ and $_->{"Tid2"} eq $_[2]
4113+ and $_->{"TDid2"} eq $_[3])
4114+ {
4115+ return 1;
4116+ }
4117+ }
4118+ return 0;
4119+}
4120+
4121+sub find_MemberPair_Pos_byName($$)
4122+{
4123+ my ($Member_Name, $Pair_Type) = @_;
4124+ foreach my $MemberPair_Pos (sort keys(%{$Pair_Type->{"Memb"}}))
4125+ {
4126+ if($Pair_Type->{"Memb"}{$MemberPair_Pos}{"name"} eq $Member_Name)
4127+ {
4128+ return $MemberPair_Pos;
4129+ }
4130+ }
4131+ return "lost";
4132+}
4133+
4134+sub getBitfieldSum($$)
4135+{
4136+ my ($Member_Pos, $Pair_Type) = @_;
4137+ my $BitfieldSum = 0;
4138+ while($Member_Pos>-1)
4139+ {
4140+ return $BitfieldSum if(not $Pair_Type->{"Memb"}{$Member_Pos}{"bitfield"});
4141+ $BitfieldSum += $Pair_Type->{"Memb"}{$Member_Pos}{"bitfield"};
4142+ $Member_Pos -= 1;
4143+ }
4144+ return $BitfieldSum;
4145+}
4146+
4147+sub find_MemberPair_Pos_byVal($$)
4148+{
4149+ my ($Member_Value, $Pair_Type) = @_;
4150+ foreach my $MemberPair_Pos (sort keys(%{$Pair_Type->{"Memb"}}))
4151+ {
4152+ if($Pair_Type->{"Memb"}{$MemberPair_Pos}{"value"} eq $Member_Value)
4153+ {
4154+ return $MemberPair_Pos;
4155+ }
4156+ }
4157+ return "lost";
4158+}
4159+
4160+my %Priority_Value=(
4161+"High"=>3,
4162+"Medium"=>2,
4163+"Low"=>1
4164+);
4165+
4166+sub max_priority($$)
4167+{
4168+ my ($Priority1, $Priority2) = @_;
4169+ if(cmp_priority($Priority1, $Priority2))
4170+ {
4171+ return $Priority1;
4172+ }
4173+ else
4174+ {
4175+ return $Priority2;
4176+ }
4177+}
4178+
4179+sub cmp_priority($$)
4180+{
4181+ my ($Priority1, $Priority2) = @_;
4182+ return ($Priority_Value{$Priority1}>$Priority_Value{$Priority2});
4183+}
4184+
4185+sub set_Problems_Priority()
4186+{
4187+ foreach my $InterfaceName (sort keys(%CompatProblems))
4188+ {
4189+ foreach my $Kind (sort keys(%{$CompatProblems{$InterfaceName}}))
4190+ {
4191+ foreach my $Location (sort keys(%{$CompatProblems{$InterfaceName}{$Kind}}))
4192+ {
4193+ my $IsInTypeInternals = $CompatProblems{$InterfaceName}{$Kind}{$Location}{"IsInTypeInternals"};
4194+ my $InitialType_Type = $CompatProblems{$InterfaceName}{$Kind}{$Location}{"InitialType_Type"};
4195+ if($Kind eq "Function_Become_Static")
4196+ {
4197+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "High";
4198+ }
4199+ elsif($Kind eq "Function_Become_NonStatic")
4200+ {
4201+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "High";
4202+ }
4203+ elsif($Kind eq "Parameter_Type_And_Size")
4204+ {
4205+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "High";
4206+ }
4207+ elsif($Kind eq "Parameter_Type")
4208+ {
4209+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Low";
4210+ }
4211+ elsif($Kind eq "Withdrawn_Parameter")
4212+ {
4213+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Medium";
4214+ }
4215+ elsif($Kind eq "Added_Parameter")
4216+ {
4217+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Medium";
4218+ }
4219+ elsif($Kind eq "Parameter_BaseType_And_Size")
4220+ {
4221+ if($InitialType_Type eq "Pointer")
4222+ {
4223+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Low";
4224+ }
4225+ else
4226+ {
4227+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "High";
4228+ }
4229+ }
4230+ elsif($Kind eq "Parameter_BaseType")
4231+ {
4232+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Low";
4233+ }
4234+ elsif($Kind eq "Parameter_PointerLevel")
4235+ {
4236+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "High";
4237+ }
4238+ elsif($Kind eq "Return_Type_And_Size")
4239+ {
4240+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Medium";
4241+ }
4242+ elsif($Kind eq "Return_Type")
4243+ {
4244+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Low";
4245+ }
4246+ elsif($Kind eq "Return_BaseType_And_Size")
4247+ {
4248+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Medium";
4249+ }
4250+ elsif($Kind eq "Return_BaseType")
4251+ {
4252+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Low";
4253+ }
4254+ elsif($Kind eq "Return_PointerLevel")
4255+ {
4256+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Low";
4257+ }
4258+ if($Kind eq "Added_Virtual_Function")
4259+ {
4260+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "High";
4261+ }
4262+ elsif($Kind eq "Withdrawn_Virtual_Function")
4263+ {
4264+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "High";
4265+ }
4266+ elsif($Kind eq "Virtual_Function_Position")
4267+ {
4268+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "High";
4269+ }
4270+ elsif($Kind eq "Virtual_Function_Redefinition")
4271+ {
4272+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Low";
4273+ }
4274+ elsif($Kind eq "Virtual_Function_Redefinition_B")
4275+ {
4276+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Low";
4277+ }
4278+ elsif($Kind eq "Size")
4279+ {
4280+ if(($InitialType_Type eq "Pointer") or ($InitialType_Type eq "Array"))
4281+ {
4282+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Low";
4283+ }
4284+ else
4285+ {
4286+ if($IsInTypeInternals)
4287+ {
4288+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Medium";
4289+ }
4290+ else
4291+ {
4292+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "High";
4293+ }
4294+ }
4295+ }
4296+ elsif($Kind eq "BaseType")
4297+ {
4298+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Low";
4299+ }
4300+ elsif($Kind eq "Added_Member_And_Size")
4301+ {
4302+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Low";
4303+ }
4304+ elsif($Kind eq "Added_Middle_Member_And_Size")
4305+ {
4306+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Medium";
4307+ }
4308+ elsif($Kind eq "Withdrawn_Member_And_Size")
4309+ {
4310+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Medium";
4311+ }
4312+ elsif($Kind eq "Withdrawn_Member")
4313+ {
4314+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Low";
4315+ }
4316+ elsif($Kind eq "Withdrawn_Middle_Member_And_Size")
4317+ {
4318+ if($IsInTypeInternals)
4319+ {
4320+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Medium";
4321+ }
4322+ else
4323+ {
4324+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "High";
4325+ }
4326+ }
4327+ elsif($Kind eq "Withdrawn_Middle_Member")
4328+ {
4329+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Medium";
4330+ }
4331+ elsif($Kind eq "Member_Rename")
4332+ {
4333+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Low";
4334+ }
4335+ elsif($Kind eq "Enum_Member_Value")
4336+ {
4337+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Medium";
4338+ }
4339+ elsif($Kind eq "Enum_Member_Name")
4340+ {
4341+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Low";
4342+ }
4343+ elsif($Kind eq "Member_Type_And_Size")
4344+ {
4345+ if(($InitialType_Type eq "Pointer") or ($InitialType_Type eq "Array"))
4346+ {
4347+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Low";
4348+ }
4349+ else
4350+ {
4351+ if($IsInTypeInternals)
4352+ {
4353+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Low";
4354+ }
4355+ else
4356+ {
4357+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "High";
4358+ }
4359+ }
4360+ }
4361+ elsif($Kind eq "Member_Type")
4362+ {
4363+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Low";
4364+ }
4365+ elsif($Kind eq "Member_BaseType_And_Size")
4366+ {
4367+ if(($InitialType_Type eq "Pointer") or ($InitialType_Type eq "Array"))
4368+ {
4369+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Low";
4370+ }
4371+ else
4372+ {
4373+ if($IsInTypeInternals)
4374+ {
4375+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Low";
4376+ }
4377+ else
4378+ {
4379+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "High";
4380+ }
4381+ }
4382+ }
4383+ elsif($Kind eq "Member_BaseType")
4384+ {
4385+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Low";
4386+ }
4387+ elsif($Kind eq "Member_PointerLevel")
4388+ {
4389+ if(($InitialType_Type eq "Pointer") or ($InitialType_Type eq "Array"))
4390+ {
4391+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Low";
4392+ }
4393+ else
4394+ {
4395+ if($IsInTypeInternals)
4396+ {
4397+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Low";
4398+ }
4399+ else
4400+ {
4401+ $CompatProblems{$InterfaceName}{$Kind}{$Location}{"Priority"} = "Medium";
4402+ }
4403+ }
4404+ }
4405+ }
4406+ }
4407+ }
4408+}
4409+
4410+sub pushType($$$$)
4411+{
4412+ my %TypeDescriptor=(
4413+ "Tid1" => $_[0],
4414+ "TDid1" => $_[1],
4415+ "Tid2" => $_[2],
4416+ "TDid2" => $_[3] );
4417+ push(@RecurTypes, \%TypeDescriptor);
4418+}
4419+
4420+sub mergeTypes($$$$)
4421+{
4422+ my ($Type1_Id, $Type1_DId, $Type2_Id, $Type2_DId) = @_;
4423+ my (%Sub_SubProblems, %SubProblems) = ();
4424+ if((not $Type1_Id and not $Type1_DId) or (not $Type2_Id and not $Type2_DId))
4425+ {#Not Empty Inputs Only
4426+ return ();
4427+ }
4428+ if($Cache{"mergeTypes"}{$Type1_Id}{$Type1_DId}{$Type2_Id}{$Type2_DId})
4429+ {#Already Merged
4430+ return %{$Cache{"mergeTypes"}{$Type1_Id}{$Type1_DId}{$Type2_Id}{$Type2_DId}};
4431+ }
4432+ my %Type1 = get_Type($Type1_DId, $Type1_Id, 1);
4433+ my %Type2 = get_Type($Type2_DId, $Type2_Id, 2);
4434+ my %Type1_Pure = get_PureType($Type1_DId, $Type1_Id, 1);
4435+ my %Type2_Pure = get_PureType($Type2_DId, $Type2_Id, 2);
4436+ return () if(not $Type1_Pure{"Size"} or not $Type2_Pure{"Size"});
4437+ if(isRecurType($Type1_Pure{"Tid"}, $Type1_Pure{"TDid"}, $Type2_Pure{"Tid"}, $Type2_Pure{"TDid"}))
4438+ {#Recursive Declarations
4439+ return ();
4440+ }
4441+ return if(not $Type1_Pure{"Name"} or not $Type2_Pure{"Name"});
4442+ return if($OpaqueTypes{1}{$Type1_Pure{"Name"}} or $OpaqueTypes{2}{$Type1_Pure{"Name"}} or $OpaqueTypes{1}{$Type1{"Name"}} or $OpaqueTypes{2}{$Type1{"Name"}});
4443+
4444+ my %Typedef_1 = goToFirst($Type1{"TDid"}, $Type1{"Tid"}, 1, "Typedef");
4445+ my %Typedef_2 = goToFirst($Type2{"TDid"}, $Type2{"Tid"}, 2, "Typedef");
4446+ if($Typedef_1{"Type"} eq "Typedef" and $Typedef_2{"Type"} eq "Typedef" and $Typedef_1{"Name"} eq $Typedef_2{"Name"})
4447+ {
4448+ my %Base_1 = get_OneStep_BaseType($Typedef_1{"TDid"}, $Typedef_1{"Tid"}, 1);
4449+ my %Base_2 = get_OneStep_BaseType($Typedef_2{"TDid"}, $Typedef_2{"Tid"}, 2);
4450+ if($Base_1{"Name"}!~/anon\-/ and $Base_2{"Name"}!~/anon\-/
4451+ and ($Base_1{"Name"} ne $Base_2{"Name"}))
4452+ {
4453+ %{$SubProblems{"BaseType"}{$Typedef_1{"Name"}}}=(
4454+ "Type_Name"=>$Typedef_1{"Name"},
4455+ "Type_Type"=>"Typedef",
4456+ "Header"=>$Typedef_2{"Header"},
4457+ "Line"=>$Typedef_2{"Line"},
4458+ "Old_Value"=>$Base_1{"Name"},
4459+ "New_Value"=>$Base_2{"Name"} );
4460+ }
4461+ }
4462+
4463+ if(($Type1_Pure{"Name"} ne $Type2_Pure{"Name"}) and ($Type1_Pure{"Type"} ne "Pointer") and $Type1_Pure{"Name"}!~/anon\-/)
4464+ {#Different types
4465+ return ();
4466+ }
4467+
4468+ pushType($Type1_Pure{"Tid"}, $Type1_Pure{"TDid"}, $Type2_Pure{"Tid"}, $Type2_Pure{"TDid"});
4469+ if(($Type1_Pure{"Name"} eq $Type2_Pure{"Name"}) and ($Type1_Pure{"Type"} =~ /Struct|Class|Union/))
4470+ {#Check Size
4471+ if($Type1_Pure{"Size"} ne $Type2_Pure{"Size"})
4472+ {
4473+ %{$SubProblems{"Size"}{$Type1_Pure{"Name"}}}=(
4474+ "Type_Name"=>$Type1_Pure{"Name"},
4475+ "Type_Type"=>$Type1_Pure{"Type"},
4476+ "Header"=>$Type2_Pure{"Header"},
4477+ "Line"=>$Type2_Pure{"Line"},
4478+ "Old_Value"=>$Type1_Pure{"Size"},
4479+ "New_Value"=>$Type2_Pure{"Size"} );
4480+ }
4481+ }
4482+ if($Type1_Pure{"Name"} and $Type2_Pure{"Name"} and ($Type1_Pure{"Name"} ne $Type2_Pure{"Name"}) and ($Type1_Pure{"Name"} !~ /\Avoid[ ]*\*/) and ($Type2_Pure{"Name"} =~ /\Avoid[ ]*\*/))
4483+ {#Check "void *"
4484+ pop(@RecurTypes);
4485+ return ();
4486+ }
4487+ if($Type1_Pure{"BaseType"}{"Tid"} and $Type2_Pure{"BaseType"}{"Tid"})
4488+ {#Check Base Types
4489+ %Sub_SubProblems = &mergeTypes($Type1_Pure{"BaseType"}{"Tid"}, $Type1_Pure{"BaseType"}{"TDid"}, $Type2_Pure{"BaseType"}{"Tid"}, $Type2_Pure{"BaseType"}{"TDid"});
4490+ foreach my $Sub_SubProblemType (keys(%Sub_SubProblems))
4491+ {
4492+ foreach my $Sub_SubLocation (keys(%{$Sub_SubProblems{$Sub_SubProblemType}}))
4493+ {
4494+ %{$SubProblems{$Sub_SubProblemType}{$Sub_SubLocation}} = %{$Sub_SubProblems{$Sub_SubProblemType}{$Sub_SubLocation}};
4495+ $SubProblems{$Sub_SubProblemType}{$Sub_SubLocation}{"InitialType_Type"} = $Type1_Pure{"Type"};
4496+ }
4497+ }
4498+ }
4499+ foreach my $Member_Pos (sort keys(%{$Type1_Pure{"Memb"}}))
4500+ {#Check Members
4501+ next if($Type1_Pure{"Memb"}{$Member_Pos}{"access"} eq "private");
4502+ my $Member_Name = $Type1_Pure{"Memb"}{$Member_Pos}{"name"};
4503+ next if(not $Member_Name);
4504+ my $Member_Location = $Member_Name;
4505+ my $MemberPair_Pos = find_MemberPair_Pos_byName($Member_Name, \%Type2_Pure);
4506+ if(($MemberPair_Pos eq "lost") and (($Type2_Pure{"Type"} eq "Struct") or ($Type2_Pure{"Type"} eq "Class")))
4507+ {#Withdrawn_Member
4508+ if($Member_Pos > keys(%{$Type2_Pure{"Memb"}}) - 1)
4509+ {
4510+ if($Type1_Pure{"Size"} ne $Type2_Pure{"Size"})
4511+ {
4512+ %{$SubProblems{"Withdrawn_Member_And_Size"}{$Member_Name}}=(
4513+ "Target"=>$Member_Name,
4514+ "Type_Name"=>$Type1_Pure{"Name"},
4515+ "Type_Type"=>$Type1_Pure{"Type"},
4516+ "Header"=>$Type2_Pure{"Header"},
4517+ "Line"=>$Type2_Pure{"Line"},
4518+ "Old_Size"=>$Type1_Pure{"Size"},
4519+ "New_Size"=>$Type2_Pure{"Size"} );
4520+ }
4521+ else
4522+ {
4523+ %{$SubProblems{"Withdrawn_Member"}{$Member_Name}}=(
4524+ "Target"=>$Member_Name,
4525+ "Type_Name"=>$Type1_Pure{"Name"},
4526+ "Type_Type"=>$Type1_Pure{"Type"},
4527+ "Header"=>$Type2_Pure{"Header"},
4528+ "Line"=>$Type2_Pure{"Line"} );
4529+ }
4530+ next;
4531+ }
4532+ elsif($Member_Pos < keys(%{$Type1_Pure{"Memb"}}) - 1)
4533+ {
4534+ my $MemberType_Id = $Type1_Pure{"Memb"}{$Member_Pos}{"type"};
4535+ my %MemberType_Pure = get_PureType($Tid_TDid{1}{$MemberType_Id}, $MemberType_Id, 1);
4536+ my $MemberStraightPairType_Id = $Type2_Pure{"Memb"}{$Member_Pos}{"type"};
4537+ my %MemberStraightPairType_Pure = get_PureType($Tid_TDid{2}{$MemberStraightPairType_Id}, $MemberStraightPairType_Id, 2);
4538+
4539+ if(($MemberType_Pure{"Size"} eq $MemberStraightPairType_Pure{"Size"}) and find_MemberPair_Pos_byName($Type2_Pure{"Memb"}{$Member_Pos}{"name"}, \%Type1_Pure) eq "lost")
4540+ {
4541+ %{$SubProblems{"Member_Rename"}{$Member_Name}}=(
4542+ "Target"=>$Member_Name,
4543+ "Type_Name"=>$Type1_Pure{"Name"},
4544+ "Type_Type"=>$Type1_Pure{"Type"},
4545+ "Header"=>$Type2_Pure{"Header"},
4546+ "Line"=>$Type2_Pure{"Line"},
4547+ "Old_Value"=>$Type1_Pure{"Memb"}{$Member_Pos}{"name"},
4548+ "New_Value"=>$Type2_Pure{"Memb"}{$Member_Pos}{"name"} );
4549+ $MemberPair_Pos = $Member_Pos;
4550+ }
4551+ else
4552+ {
4553+ if($Type1_Pure{"Memb"}{$Member_Pos}{"bitfield"})
4554+ {
4555+ my $BitfieldSum = getBitfieldSum($Member_Pos-1, \%Type1_Pure)%($POINTER_SIZE*8);
4556+ if($BitfieldSum and $BitfieldSum-$Type2_Pure{"Memb"}{$Member_Pos}{"bitfield"}>=0)
4557+ {
4558+ %{$SubProblems{"Withdrawn_Middle_Member"}{$Member_Name}}=(
4559+ "Target"=>$Member_Name,
4560+ "Type_Name"=>$Type1_Pure{"Name"},
4561+ "Type_Type"=>$Type1_Pure{"Type"},
4562+ "Header"=>$Type2_Pure{"Header"},
4563+ "Line"=>$Type2_Pure{"Line"} );
4564+ next;
4565+ }
4566+ }
4567+ %{$SubProblems{"Withdrawn_Middle_Member_And_Size"}{$Member_Name}}=(
4568+ "Target"=>$Member_Name,
4569+ "Type_Name"=>$Type1_Pure{"Name"},
4570+ "Type_Type"=>$Type1_Pure{"Type"},
4571+ "Header"=>$Type2_Pure{"Header"},
4572+ "Line"=>$Type2_Pure{"Line"} );
4573+ next;
4574+ }
4575+ }
4576+ }
4577+ if($Type1_Pure{"Type"} eq "Enum")
4578+ {
4579+ my $Member_Value1 = $Type1_Pure{"Memb"}{$Member_Pos}{"value"};
4580+ next if(not $Member_Value1);
4581+ my $Member_Value2 = $Type2_Pure{"Memb"}{$MemberPair_Pos}{"value"};
4582+ if($MemberPair_Pos eq "lost")
4583+ {
4584+ $MemberPair_Pos = find_MemberPair_Pos_byVal($Member_Value1, \%Type2_Pure);
4585+ if($MemberPair_Pos ne "lost")
4586+ {
4587+ %{$SubProblems{"Enum_Member_Name"}{$Type1_Pure{"Memb"}{$Member_Pos}{"value"}}}=(
4588+ "Target"=>$Type1_Pure{"Memb"}{$Member_Pos}{"value"},
4589+ "Type_Name"=>$Type1_Pure{"Name"},
4590+ "Type_Type"=>"Enum",
4591+ "Header"=>$Type2_Pure{"Header"},
4592+ "Line"=>$Type2_Pure{"Line"},
4593+ "Old_Value"=>$Type1_Pure{"Memb"}{$Member_Pos}{"name"},
4594+ "New_Value"=>$Type2_Pure{"Memb"}{$MemberPair_Pos}{"name"} );
4595+ }
4596+ }
4597+ else
4598+ {
4599+ if($Member_Value1 ne "" and $Member_Value2 ne "")
4600+ {
4601+ if($Member_Value1 ne $Member_Value2)
4602+ {
4603+ %{$SubProblems{"Enum_Member_Value"}{$Member_Name}}=(
4604+ "Target"=>$Member_Name,
4605+ "Type_Name"=>$Type1_Pure{"Name"},
4606+ "Type_Type"=>"Enum",
4607+ "Header"=>$Type2_Pure{"Header"},
4608+ "Line"=>$Type2_Pure{"Line"},
4609+ "Old_Value"=>$Type1_Pure{"Memb"}{$Member_Pos}{"value"},
4610+ "New_Value"=>$Type2_Pure{"Memb"}{$MemberPair_Pos}{"value"} );
4611+ }
4612+ }
4613+ }
4614+ next;
4615+ }
4616+ my $MemberType1_Id = $Type1_Pure{"Memb"}{$Member_Pos}{"type"};
4617+ my $MemberType2_Id = $Type2_Pure{"Memb"}{$MemberPair_Pos}{"type"};
4618+ %Sub_SubProblems = detectTypeChange($MemberType1_Id, $MemberType2_Id, "Member");
4619+ foreach my $Sub_SubProblemType (keys(%Sub_SubProblems))
4620+ {
4621+ %{$SubProblems{$Sub_SubProblemType}{$Member_Name}}=(
4622+ "Target"=>$Member_Name,
4623+ "Member_Position"=>$Member_Pos,
4624+ "Type_Name"=>$Type1_Pure{"Name"},
4625+ "Type_Type"=>$Type1_Pure{"Type"},
4626+ "Header"=>$Type2_Pure{"Header"},
4627+ "Line"=>$Type2_Pure{"Line"});
4628+ @{$SubProblems{$Sub_SubProblemType}{$Member_Name}}{keys(%{$Sub_SubProblems{$Sub_SubProblemType}})} = values %{$Sub_SubProblems{$Sub_SubProblemType}};
4629+ }
4630+ if($MemberType1_Id and $MemberType2_Id)
4631+ {#checking member type change (replace)
4632+ %Sub_SubProblems = &mergeTypes($MemberType1_Id, $Tid_TDid{1}{$MemberType1_Id}, $MemberType2_Id, $Tid_TDid{2}{$MemberType2_Id});
4633+ foreach my $Sub_SubProblemType (keys(%Sub_SubProblems))
4634+ {
4635+ foreach my $Sub_SubLocation (keys(%{$Sub_SubProblems{$Sub_SubProblemType}}))
4636+ {
4637+ my $NewLocation = ($Sub_SubLocation)?$Member_Location."->".$Sub_SubLocation:$Member_Location;
4638+ %{$SubProblems{$Sub_SubProblemType}{$NewLocation}}=(
4639+ "IsInTypeInternals"=>"Yes");
4640+ @{$SubProblems{$Sub_SubProblemType}{$NewLocation}}{keys(%{$Sub_SubProblems{$Sub_SubProblemType}{$Sub_SubLocation}})} = values %{$Sub_SubProblems{$Sub_SubProblemType}{$Sub_SubLocation}};
4641+ if($Sub_SubLocation !~ /\-\>/)
4642+ {
4643+ $SubProblems{$Sub_SubProblemType}{$NewLocation}{"Member_Type_Name"} = get_TypeName($MemberType1_Id, 1);
4644+ $SubProblems{$Sub_SubProblemType}{$NewLocation}{"Start_Type_Name"} = get_TypeName($MemberType1_Id, 1);
4645+ }
4646+ }
4647+ }
4648+ }
4649+ }
4650+ if(($Type2_Pure{"Type"} eq "Struct") or ($Type2_Pure{"Type"} eq "Class"))
4651+ {
4652+ foreach my $Member_Pos (sort keys(%{$Type2_Pure{"Memb"}}))
4653+ {#checking added members
4654+ next if(not $Type2_Pure{"Memb"}{$Member_Pos}{"name"});
4655+ my $MemberPair_Pos = find_MemberPair_Pos_byName($Type2_Pure{"Memb"}{$Member_Pos}{"name"}, \%Type1_Pure);
4656+ if($MemberPair_Pos eq "lost")
4657+ {#Added_Member
4658+ if($Member_Pos > keys(%{$Type1_Pure{"Memb"}}) - 1)
4659+ {
4660+ if($Type1_Pure{"Size"} ne $Type2_Pure{"Size"})
4661+ {
4662+ if($Type2_Pure{"Memb"}{$Member_Pos}{"bitfield"})
4663+ {
4664+ my $BitfieldSum = getBitfieldSum($Member_Pos-1, \%Type2_Pure)%($POINTER_SIZE*8);
4665+ next if($BitfieldSum and $BitfieldSum<=$POINTER_SIZE*8-$Type2_Pure{"Memb"}{$Member_Pos}{"bitfield"});
4666+ }
4667+ %{$SubProblems{"Added_Member_And_Size"}{$Type2_Pure{"Memb"}{$Member_Pos}{"name"}}}=(
4668+ "Target"=>$Type2_Pure{"Memb"}{$Member_Pos}{"name"},
4669+ "Type_Name"=>$Type1_Pure{"Name"},
4670+ "Type_Type"=>$Type1_Pure{"Type"},
4671+ "Header"=>$Type2_Pure{"Header"},
4672+ "Line"=>$Type2_Pure{"Line"} );
4673+ }
4674+ }
4675+ else
4676+ {
4677+ my $MemberType_Id = $Type2_Pure{"Memb"}{$Member_Pos}{"type"};
4678+ my $MemberType_DId = $Tid_TDid{2}{$MemberType_Id};
4679+ my %MemberType_Pure = get_PureType($MemberType_DId, $MemberType_Id, 2);
4680+
4681+ my $MemberStraightPairType_Id = $Type1_Pure{"Memb"}{$Member_Pos}{"type"};
4682+ my %MemberStraightPairType_Pure = get_PureType($Tid_TDid{1}{$MemberStraightPairType_Id}, $MemberStraightPairType_Id, 1);
4683+
4684+ if(($MemberType_Pure{"Size"} eq $MemberStraightPairType_Pure{"Size"}) and find_MemberPair_Pos_byName($Type1_Pure{"Memb"}{$Member_Pos}{"name"}, \%Type2_Pure) eq "lost")
4685+ {
4686+ next if($Type1_Pure{"Memb"}{$Member_Pos}{"access"} eq "private");
4687+ %{$SubProblems{"Member_Rename"}{$Type2_Pure{"Memb"}{$Member_Pos}{"name"}}}=(
4688+ "Target"=>$Type1_Pure{"Memb"}{$Member_Pos}{"name"},
4689+ "Type_Name"=>$Type1_Pure{"Name"},
4690+ "Type_Type"=>$Type1_Pure{"Type"},
4691+ "Header"=>$Type2_Pure{"Header"},
4692+ "Line"=>$Type2_Pure{"Line"},
4693+ "Old_Value"=>$Type1_Pure{"Memb"}{$Member_Pos}{"name"},
4694+ "New_Value"=>$Type2_Pure{"Memb"}{$Member_Pos}{"name"} );
4695+ }
4696+ else
4697+ {
4698+ if($Type1_Pure{"Size"} ne $Type2_Pure{"Size"})
4699+ {
4700+ if($Type2_Pure{"Memb"}{$Member_Pos}{"bitfield"})
4701+ {
4702+ my $BitfieldSum = getBitfieldSum($Member_Pos-1, \%Type2_Pure)%($POINTER_SIZE*8);
4703+ next if($BitfieldSum and $BitfieldSum<=$POINTER_SIZE*8-$Type2_Pure{"Memb"}{$Member_Pos}{"bitfield"});
4704+ }
4705+ %{$SubProblems{"Added_Middle_Member_And_Size"}{$Type2_Pure{"Memb"}{$Member_Pos}{"name"}}}=(
4706+ "Target"=>$Type2_Pure{"Memb"}{$Member_Pos}{"name"},
4707+ "Type_Name"=>$Type1_Pure{"Name"},
4708+ "Type_Type"=>$Type1_Pure{"Type"},
4709+ "Header"=>$Type2_Pure{"Header"},
4710+ "Line"=>$Type2_Pure{"Line"} );
4711+ }
4712+ }
4713+ }
4714+ }
4715+ }
4716+ }
4717+ %{$Cache{"mergeTypes"}{$Type1_Id}{$Type1_DId}{$Type2_Id}{$Type2_DId}} = %SubProblems;
4718+ pop(@RecurTypes);
4719+ return %SubProblems;
4720+}
4721+
4722+sub get_TypeName($$)
4723+{
4724+ my ($TypeId, $LibVersion) = @_;
4725+ return $TypeDescr{$LibVersion}{$Tid_TDid{$LibVersion}{$TypeId}}{$TypeId}{"Name"};
4726+}
4727+
4728+sub goToFirst($$$$)
4729+{
4730+ my ($TypeDId, $TypeId, $LibVersion, $Type_Type) = @_;
4731+ if(defined $Cache{"goToFirst"}{$TypeDId}{$TypeId}{$LibVersion}{$Type_Type})
4732+ {
4733+ return %{$Cache{"goToFirst"}{$TypeDId}{$TypeId}{$LibVersion}{$Type_Type}};
4734+ }
4735+ return () if(not $TypeDescr{$LibVersion}{$TypeDId}{$TypeId});
4736+ my %Type = %{$TypeDescr{$LibVersion}{$TypeDId}{$TypeId}};
4737+ return () if(not $Type{"Type"});
4738+ if($Type{"Type"} ne $Type_Type)
4739+ {
4740+ return () if(not $Type{"BaseType"}{"TDid"} and not $Type{"BaseType"}{"Tid"});
4741+ %Type = goToFirst($Type{"BaseType"}{"TDid"}, $Type{"BaseType"}{"Tid"}, $LibVersion, $Type_Type);
4742+ }
4743+ $Cache{"goToFirst"}{$TypeDId}{$TypeId}{$LibVersion}{$Type_Type} = \%Type;
4744+ return %Type;
4745+}
4746+
4747+my %TypeSpecAttributes = (
4748+ "Ref" => 1,
4749+ "Const" => 1,
4750+ "Volatile" => 1,
4751+ "Restrict" => 1,
4752+ "Typedef" => 1
4753+);
4754+
4755+sub get_PureType($$$)
4756+{
4757+ my ($TypeDId, $TypeId, $LibVersion) = @_;
4758+ return "" if(not $TypeId);
4759+ if(defined $Cache{"get_PureType"}{$TypeDId}{$TypeId}{$LibVersion})
4760+ {
4761+ return %{$Cache{"get_PureType"}{$TypeDId}{$TypeId}{$LibVersion}};
4762+ }
4763+ return "" if(not $TypeDescr{$LibVersion}{$TypeDId}{$TypeId});
4764+ my %Type = %{$TypeDescr{$LibVersion}{$TypeDId}{$TypeId}};
4765+ if($Type{"Type"} =~ /Struct|Union|Typedef|Class|Enum/)
4766+ {
4767+ $CheckedTypes{$Type{"Name"}} = 1;
4768+ }
4769+ return %Type if(not $Type{"BaseType"}{"TDid"} and not $Type{"BaseType"}{"Tid"});
4770+ if($TypeSpecAttributes{$Type{"Type"}})
4771+ {
4772+ %Type = get_PureType($Type{"BaseType"}{"TDid"}, $Type{"BaseType"}{"Tid"}, $LibVersion);
4773+ }
4774+ $Cache{"get_PureType"}{$TypeDId}{$TypeId}{$LibVersion} = \%Type;
4775+ return %Type;
4776+}
4777+
4778+sub get_PointerLevel($$$)
4779+{
4780+ my ($TypeDId, $TypeId, $LibVersion) = @_;
4781+ return "" if(not $TypeId);
4782+ if(defined $Cache{"get_PointerLevel"}{$TypeDId}{$TypeId}{$LibVersion})
4783+ {
4784+ return $Cache{"get_PointerLevel"}{$TypeDId}{$TypeId}{$LibVersion};
4785+ }
4786+ return "" if(not $TypeDescr{$LibVersion}{$TypeDId}{$TypeId});
4787+ my %Type = %{$TypeDescr{$LibVersion}{$TypeDId}{$TypeId}};
4788+ return 0 if(not $Type{"BaseType"}{"TDid"} and not $Type{"BaseType"}{"Tid"});
4789+ my $PointerLevel = 0;
4790+ if($Type{"Type"} eq "Pointer")
4791+ {
4792+ $PointerLevel += 1;
4793+ }
4794+ $PointerLevel += get_PointerLevel($Type{"BaseType"}{"TDid"}, $Type{"BaseType"}{"Tid"}, $LibVersion);
4795+ $Cache{"get_PointerLevel"}{$TypeDId}{$TypeId}{$LibVersion} = $PointerLevel;
4796+ return $PointerLevel;
4797+}
4798+
4799+sub get_BaseType($$$)
4800+{
4801+ my ($TypeDId, $TypeId, $LibVersion) = @_;
4802+ return "" if(not $TypeId);
4803+ if(defined $Cache{"get_BaseType"}{$TypeDId}{$TypeId}{$LibVersion})
4804+ {
4805+ return %{$Cache{"get_BaseType"}{$TypeDId}{$TypeId}{$LibVersion}};
4806+ }
4807+ return "" if(not $TypeDescr{$LibVersion}{$TypeDId}{$TypeId});
4808+ my %Type = %{$TypeDescr{$LibVersion}{$TypeDId}{$TypeId}};
4809+ if($Type{"Type"} =~ /Struct|Union|Typedef|Class|Enum/)
4810+ {
4811+ $CheckedTypes{$Type{"Name"}} = 1;
4812+ }
4813+ return %Type if(not $Type{"BaseType"}{"TDid"} and not $Type{"BaseType"}{"Tid"});
4814+ %Type = get_BaseType($Type{"BaseType"}{"TDid"}, $Type{"BaseType"}{"Tid"}, $LibVersion);
4815+ $Cache{"get_BaseType"}{$TypeDId}{$TypeId}{$LibVersion} = \%Type;
4816+ return %Type;
4817+}
4818+
4819+sub get_OneStep_BaseType($$$)
4820+{
4821+ my ($TypeDId, $TypeId, $LibVersion) = @_;
4822+ return "" if(not $TypeId);
4823+ return "" if(not $TypeDescr{$LibVersion}{$TypeDId}{$TypeId});
4824+ my %Type = %{$TypeDescr{$LibVersion}{$TypeDId}{$TypeId}};
4825+ return %Type if(not $Type{"BaseType"}{"TDid"} and not $Type{"BaseType"}{"Tid"});
4826+ return get_Type($Type{"BaseType"}{"TDid"}, $Type{"BaseType"}{"Tid"}, $LibVersion);
4827+}
4828+
4829+sub get_Type($$$)
4830+{
4831+ my ($TypeDId, $TypeId, $LibVersion) = @_;
4832+ return "" if(not $TypeId);
4833+ return "" if(not $TypeDescr{$LibVersion}{$TypeDId}{$TypeId});
4834+ return %{$TypeDescr{$LibVersion}{$TypeDId}{$TypeId}};
4835+}
4836+
4837+sub mergeLibs()
4838+{
4839+ foreach my $Interface (sort keys(%AddedInt))
4840+ {#checking added interfaces
4841+ next if($InternalInterfaces{1}{$Interface} or $InternalInterfaces{2}{$Interface});
4842+ next if(defined $InterfacesListPath and not $InterfacesList{$Interface});
4843+ next if(defined $AppPath and not $InterfacesList_App{$Interface});
4844+ next if($FuncAttr{2}{$Interface}{"Private"});
4845+ next if(not $FuncAttr{2}{$Interface}{"Header"});
4846+ %{$CompatProblems{$Interface}{"Added_Interface"}{"SharedLibrary"}}=(
4847+ "Header"=>$FuncAttr{2}{$Interface}{"Header"},
4848+ "Line"=>$FuncAttr{2}{$Interface}{"Line"},
4849+ "Signature"=>$FuncAttr{2}{$Interface}{"Signature"},
4850+ "New_SoName"=>$Interface_Library{2}{$Interface} );
4851+ }
4852+ foreach my $Interface (sort keys(%WithdrawnInt))
4853+ {#checking withdrawn interfaces
4854+ next if($InternalInterfaces{1}{$Interface} or $InternalInterfaces{2}{$Interface});
4855+ next if(defined $InterfacesListPath and not $InterfacesList{$Interface});
4856+ next if(defined $AppPath and not $InterfacesList_App{$Interface});
4857+ next if($FuncAttr{1}{$Interface}{"Private"});
4858+ next if(not $FuncAttr{1}{$Interface}{"Header"});
4859+ %{$CompatProblems{$Interface}{"Withdrawn_Interface"}{"SharedLibrary"}}=(
4860+ "Header"=>$FuncAttr{1}{$Interface}{"Header"},
4861+ "Line"=>$FuncAttr{1}{$Interface}{"Line"},
4862+ "Signature"=>$FuncAttr{1}{$Interface}{"Signature"},
4863+ "Old_SoName"=>$Interface_Library{1}{$Interface} );
4864+ }
4865+}
4866+
4867+sub mergeSignatures()
4868+{
4869+ my %SubProblems = ();
4870+
4871+ prepareInterfaces(1);
4872+ prepareInterfaces(2);
4873+ %FuncDescr=();
4874+
4875+ initializeClassVirtFunc(1);
4876+ initializeClassVirtFunc(2);
4877+
4878+ checkVirtFuncRedefinitions(1);
4879+ checkVirtFuncRedefinitions(2);
4880+
4881+ setVirtFuncPositions(1);
4882+ setVirtFuncPositions(2);
4883+
4884+ foreach my $Interface (sort keys(%AddedInt))
4885+ {#collecting the attributes of added interfaces
4886+ next if($CheckedInterfaces{$Interface});
4887+ if($CompleteSignature{2}{$Interface})
4888+ {
4889+ if($CompleteSignature{2}{$Interface}{"Private"})
4890+ {
4891+ $FuncAttr{2}{$Interface}{"Private"} = 1;
4892+ }
4893+ if($CompleteSignature{2}{$Interface}{"Protected"})
4894+ {
4895+ $FuncAttr{2}{$Interface}{"Protected"} = 1;
4896+ }
4897+ if($CompleteSignature{2}{$Interface}{"Header"})
4898+ {
4899+ $FuncAttr{2}{$Interface}{"Header"} = $CompleteSignature{2}{$Interface}{"Header"};
4900+ }
4901+ if($CompleteSignature{2}{$Interface}{"Line"})
4902+ {
4903+ $FuncAttr{2}{$Interface}{"Line"} = $CompleteSignature{2}{$Interface}{"Line"};
4904+ }
4905+ $FuncAttr{2}{$Interface}{"Signature"} = get_Signature($Interface, 2);
4906+ foreach my $ParamPos (keys(%{$CompleteSignature{2}{$Interface}{"Param"}}))
4907+ {
4908+ my $ParamType_Id = $CompleteSignature{2}{$Interface}{"Param"}{$ParamPos}{"type"};
4909+ my $ParamType_DId = $Tid_TDid{2}{$ParamType_Id};
4910+ my %ParamType = get_Type($ParamType_DId, $ParamType_Id, 2);
4911+ }
4912+ #checking virtual table
4913+ check_VirtualTable($Interface, 2);
4914+ $CheckedInterfaces{$Interface} = 1;
4915+ }
4916+ }
4917+ foreach my $Interface (sort keys(%WithdrawnInt))
4918+ {#collecting the attributes of withdrawn interfaces
4919+ next if($CheckedInterfaces{$Interface});
4920+ if($CompleteSignature{1}{$Interface})
4921+ {
4922+ if($CompleteSignature{1}{$Interface}{"Private"})
4923+ {
4924+ $FuncAttr{1}{$Interface}{"Private"} = 1;
4925+ }
4926+ if($CompleteSignature{1}{$Interface}{"Protected"})
4927+ {
4928+ $FuncAttr{1}{$Interface}{"Protected"} = 1;
4929+ }
4930+ if($CompleteSignature{1}{$Interface}{"Header"})
4931+ {
4932+ $FuncAttr{1}{$Interface}{"Header"} = $CompleteSignature{1}{$Interface}{"Header"};
4933+ }
4934+ if($CompleteSignature{1}{$Interface}{"Line"})
4935+ {
4936+ $FuncAttr{1}{$Interface}{"Line"} = $CompleteSignature{1}{$Interface}{"Line"};
4937+ }
4938+ $FuncAttr{1}{$Interface}{"Signature"} = get_Signature($Interface, 1);
4939+ foreach my $ParamPos (keys(%{$CompleteSignature{1}{$Interface}{"Param"}}))
4940+ {
4941+ my $ParamType_Id = $CompleteSignature{1}{$Interface}{"Param"}{$ParamPos}{"type"};
4942+ my $ParamType_DId = $Tid_TDid{1}{$ParamType_Id};
4943+ my %ParamType = get_Type($ParamType_DId, $ParamType_Id, 1);
4944+ }
4945+ #checking virtual table
4946+ check_VirtualTable($Interface, 1);
4947+ $CheckedInterfaces{$Interface} = 1;
4948+ }
4949+ }
4950+
4951+ foreach my $Interface (sort keys(%{$CompleteSignature{1}}))
4952+ {#checking interfaces
4953+ if(($Interface !~ /\@/) and ($SymVer{1}{$Interface} =~ /\A(.*)[\@]+/))
4954+ {
4955+ next if($1 eq $Interface);
4956+ }
4957+ my ($MnglName, $SymbolVersion) = ($Interface, "");
4958+ if($Interface =~ /\A([^@]+)[\@]+([^@]+)\Z/)
4959+ {
4960+ ($MnglName, $SymbolVersion) = ($1, $2);
4961+ }
4962+ next if($InternalInterfaces{1}{$Interface} or $InternalInterfaces{2}{$Interface});
4963+ next if(defined $InterfacesListPath and not $InterfacesList{$Interface});
4964+ next if(defined $AppPath and not $InterfacesList_App{$Interface});
4965+ next if($CheckedInterfaces{$Interface});
4966+ next if($CompleteSignature{1}{$Interface}{"Private"});
4967+ next if(not $CompleteSignature{1}{$Interface}{"Header"} or not $CompleteSignature{2}{$Interface}{"Header"});
4968+ next if(not $CompleteSignature{1}{$Interface}{"MnglName"} or not $CompleteSignature{2}{$Interface}{"MnglName"});
4969+ next if((not $CompleteSignature{1}{$Interface}{"PureVirt"} and $CompleteSignature{2}{$Interface}{"PureVirt"}) or ($CompleteSignature{1}{$Interface}{"PureVirt"} and not $CompleteSignature{2}{$Interface}{"PureVirt"}));
4970+ $CheckedInterfaces{$Interface} = 1;
4971+ #checking virtual table
4972+ check_VirtualTable($Interface, 1);
4973+ #checking attributes
4974+ if($CompleteSignature{2}{$Interface}{"Static"} and not $CompleteSignature{1}{$Interface}{"Static"})
4975+ {
4976+ %{$CompatProblems{$Interface}{"Function_Become_Static"}{"Attributes"}}=(
4977+ "Header"=>$CompleteSignature{1}{$Interface}{"Header"},
4978+ "Line"=>$CompleteSignature{1}{$Interface}{"Line"},
4979+ "Signature"=>get_Signature($Interface, 1),
4980+ "Old_SoName"=>$Interface_Library{1}{$Interface},
4981+ "New_SoName"=>$Interface_Library{2}{$Interface} );
4982+ }
4983+ elsif(not $CompleteSignature{2}{$Interface}{"Static"} and $CompleteSignature{1}{$Interface}{"Static"})
4984+ {
4985+ %{$CompatProblems{$Interface}{"Function_Become_NonStatic"}{"Attributes"}}=(
4986+ "Header"=>$CompleteSignature{1}{$Interface}{"Header"},
4987+ "Line"=>$CompleteSignature{1}{$Interface}{"Line"},
4988+ "Signature"=>get_Signature($Interface, 1),
4989+ "Old_SoName"=>$Interface_Library{1}{$Interface},
4990+ "New_SoName"=>$Interface_Library{2}{$Interface} );
4991+ }
4992+ if($CompleteSignature{1}{$Interface}{"Virt"} and $CompleteSignature{2}{$Interface}{"Virt"})
4993+ {
4994+ if($CompleteSignature{1}{$Interface}{"Position"}!=$CompleteSignature{2}{$Interface}{"Position"})
4995+ {
4996+ my $Class_Id = $CompleteSignature{1}{$Interface}{"Class"};
4997+ my $Class_DId = $Tid_TDid{1}{$Class_Id};
4998+ my %Class_Type = get_Type($Class_DId, $Class_Id, 1);
4999+ %{$CompatProblems{$Interface}{"Virtual_Function_Position"}{$tr_name{$MnglName}}}=(
5000+ "Type_Name"=>$Class_Type{"Name"},
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: