From 948c2c9ee40a69a19accdfb389b5b5d15e09541d Mon Sep 17 00:00:00 2001
From: Jan Jezabek
Date: Sun, 21 Jun 2009 22:39:32 +0000
Subject: Merged revisions
10794,10801-10809,10827-10831,10834,10846-10856,10860,10862-10881,10883-10887,10893,10896-10913,10915-11052,11054-11063,11069-11070,11072,11075-11076,11079-11080,11083,11092-11104,11107,11110-11111,11116-11117,11123-11137,11139-11143,11148,11150-11154,11156-11161,11163-11166,11169-11170,11174-11179,11182-11183,11185,11191-11201,11205-11206,11209-11210,11212-11216,11230-11241,11244,11246-11247,11259,11279-11283,11285,11287
via svnmerge from https://swig.svn.sourceforge.net/svnroot/swig/trunk
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
................
r10794 | talby | 2008-08-19 09:09:29 +0200 (Tue, 19 Aug 2008) | 3 lines
rollback 10737:10749, this work is better left on a branch until it is
in support a significant feature enhancement.
................
r10801 | drjoe | 2008-08-31 18:07:43 +0200 (Sun, 31 Aug 2008) | 2 lines
change Rf_warning to warning. Looks like a typo
................
r10802 | wsfulton | 2008-09-01 21:59:23 +0200 (Mon, 01 Sep 2008) | 1 line
Fix ruby detection problem breaking configure
................
r10803 | wsfulton | 2008-09-01 22:00:28 +0200 (Mon, 01 Sep 2008) | 1 line
Fix another perl global namespace pollution
................
r10804 | wsfulton | 2008-09-01 22:32:53 +0200 (Mon, 01 Sep 2008) | 1 line
Fix array bounds checking in C# std::vector wrappers
................
r10805 | wsfulton | 2008-09-01 22:34:49 +0200 (Mon, 01 Sep 2008) | 1 line
fix runtime problem in Ruby std_vector example
................
r10806 | wsfulton | 2008-09-01 22:42:40 +0200 (Mon, 01 Sep 2008) | 1 line
Fix portability problem using /dev/null
................
r10807 | wsfulton | 2008-09-01 23:46:41 +0200 (Mon, 01 Sep 2008) | 1 line
patch #2079381 submitted by Boris Smilga - constant exprs put into no-eval context in DEFCENUM
................
r10808 | wsfulton | 2008-09-02 22:56:52 +0200 (Tue, 02 Sep 2008) | 1 line
Add new terminator attribute for the csin typemap for C#
................
r10809 | wsfulton | 2008-09-03 01:01:37 +0200 (Wed, 03 Sep 2008) | 1 line
Fix #1988296 - Multiple module director linking issue
................
r10827 | richardb | 2008-09-10 12:08:21 +0200 (Wed, 10 Sep 2008) | 6 lines
[Python] Commit patch #2089149: Director exception handling mangles
returned exception. Exceptions raised by Python code in directors
are now passed through to the caller without change. Also, remove
the ": " prefix which used to be added to other director exceptions
(eg, those due to incorrect return types).
................
r10828 | bhy | 2008-09-10 12:45:33 +0200 (Wed, 10 Sep 2008) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-10827" from
https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-bhy
................
r10829 | bhy | 2008-09-10 13:04:09 +0200 (Wed, 10 Sep 2008) | 4 lines
Removed merge tracking for "svnmerge" for
https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-bhy
(Undo the init due to user error)
................
r10830 | bhy | 2008-09-10 13:08:16 +0200 (Wed, 10 Sep 2008) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-10403" from
https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-bhy
................
r10831 | bhy | 2008-09-10 13:51:12 +0200 (Wed, 10 Sep 2008) | 11 lines
(Still trying to set right properity to get svnmerge work...)
Recorded merge of revisions 10404 via svnmerge from
https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-bhy
........
r10404 | bhy | 2008-05-01 08:35:49 +0800 (Thu, 01 May 2008) | 5 lines
Start of gsoc2008-bhy branch. This is a branch for Haoyu Bai's Python 3.0 backend project.
Some file already modified since a little of work already done when starting the branch.
........
................
r10834 | bhy | 2008-09-11 19:18:07 +0200 (Thu, 11 Sep 2008) | 8 lines
Merged the Python 3.0 support branch. The merging progress is not so smooth, so hope this commit won't make anything broken.
This is the (incomplemete) log produced by svnmerge.py:
Merged revisions 10405-10409,10420-10422,10426,10438,10445,10451,10454-10465,10467,10473-10475,10485,10488-10489,10493-10495,10497,10509-10510,10513-10514,10517,10520,10525,10528-10529,10533-10535,10554-10557,10570,10573,10593,10614,10666-10669,10673,10678,10687,10690,10704-10706,10731,10744,10750-10752,10755,10759,10770,10775-10776,10813,10819 via svnmerge from
https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-bhy
................
r10846 | richardb | 2008-09-12 13:33:18 +0200 (Fri, 12 Sep 2008) | 2 lines
Don't blame wsfulton for my recent change (this was a cut-and-paste error).
................
r10847 | bhy | 2008-09-12 13:52:11 +0200 (Fri, 12 Sep 2008) | 1 line
A breif descirbe of Python 3 merge in CHANGES.current
................
r10848 | bhy | 2008-09-12 16:43:17 +0200 (Fri, 12 Sep 2008) | 1 line
some more lines in CHANGES.current for Python 3 merge
................
r10849 | wsfulton | 2008-09-12 22:40:57 +0200 (Fri, 12 Sep 2008) | 1 line
fix for when python3 not installed
................
r10850 | bhy | 2008-09-13 13:38:10 +0200 (Sat, 13 Sep 2008) | 1 line
fix merge problem: remove USE_VALGRIND because it is already moved to common.mk
................
r10851 | bhy | 2008-09-13 14:16:44 +0200 (Sat, 13 Sep 2008) | 1 line
add removing of 2to3 generated runme3.py in make clean target
................
r10852 | bhy | 2008-09-13 14:55:32 +0200 (Sat, 13 Sep 2008) | 1 line
fix a typo in python/Makefile.in
................
r10853 | bhy | 2008-09-13 15:20:39 +0200 (Sat, 13 Sep 2008) | 1 line
remove _runme3 file that was checked in by mistake
................
r10854 | bhy | 2008-09-13 15:39:34 +0200 (Sat, 13 Sep 2008) | 1 line
more docs for Python 3 merge added in CHANGES.current
................
r10855 | bhy | 2008-09-13 15:42:24 +0200 (Sat, 13 Sep 2008) | 1 line
fix some typo in CHANGES.current
................
r10856 | bhy | 2008-09-13 16:11:49 +0200 (Sat, 13 Sep 2008) | 1 line
more document for limitation of parameter list, and doc of removal of -apply in CHANGES.current
................
r10860 | mutandiz | 2008-09-17 21:13:12 +0200 (Wed, 17 Sep 2008) | 1 line
[allegrocl] Fix handling of forward references. Remove code breaking typical code generation. See ChangeLog for more details on the latter.
................
r10862 | olly | 2008-09-18 11:54:18 +0200 (Thu, 18 Sep 2008) | 3 lines
[PHP5] Fix wrapping of a renamed enumerated value of an enum class member
(SF#2095273).
................
r10863 | olly | 2008-09-18 15:01:52 +0200 (Thu, 18 Sep 2008) | 3 lines
[PHP5] Fix extra code added to proxy class constructors in the case
where the only constructor takes no arguments.
................
r10864 | olly | 2008-09-18 16:02:15 +0200 (Thu, 18 Sep 2008) | 5 lines
[PHP5] Change the default input typemap for char * to turn PHP
Null into C NULL (previously it was converted to an empty string).
The new behaviour is consistent with how the corresponding output
typemap works.
................
r10865 | olly | 2008-09-18 16:03:46 +0200 (Thu, 18 Sep 2008) | 2 lines
Note the SF bug number for the previous fix.
................
r10866 | wsfulton | 2008-09-18 16:52:52 +0200 (Thu, 18 Sep 2008) | 1 line
Document the module attribute in %import and add warning to Python for when it should be used
................
r10867 | wsfulton | 2008-09-18 22:16:03 +0200 (Thu, 18 Sep 2008) | 1 line
pointer display correction
................
r10868 | wsfulton | 2008-09-18 22:16:50 +0200 (Thu, 18 Sep 2008) | 1 line
minor typo and formatting improvements
................
r10869 | wsfulton | 2008-09-18 22:21:17 +0200 (Thu, 18 Sep 2008) | 1 line
remove confusion over tab widths
................
r10870 | wsfulton | 2008-09-18 22:27:57 +0200 (Thu, 18 Sep 2008) | 1 line
warning fix
................
r10871 | wsfulton | 2008-09-18 22:28:40 +0200 (Thu, 18 Sep 2008) | 1 line
formatting fix
................
r10872 | wsfulton | 2008-09-18 22:32:28 +0200 (Thu, 18 Sep 2008) | 1 line
Add C# array typemaps provided by Antti Karanta.
................
r10873 | wsfulton | 2008-09-18 22:33:37 +0200 (Thu, 18 Sep 2008) | 1 line
revert debug break in last commit
................
r10874 | wsfulton | 2008-09-18 22:39:15 +0200 (Thu, 18 Sep 2008) | 1 line
fix unused variable warning
................
r10875 | wsfulton | 2008-09-19 01:17:52 +0200 (Fri, 19 Sep 2008) | 1 line
revert entry 2008-09-01 - C# Insert and InsertRange bounds checking
................
r10876 | olly | 2008-09-19 05:20:59 +0200 (Fri, 19 Sep 2008) | 2 lines
[PHP5] Add typemaps for long long and unsigned long long.
................
r10877 | olly | 2008-09-19 08:40:39 +0200 (Fri, 19 Sep 2008) | 2 lines
Clean out more PHP4 stuff.
................
r10878 | mutandiz | 2008-09-22 20:41:10 +0200 (Mon, 22 Sep 2008) | 1 line
[allegrocl] Make type and namespace wrapping more compatible with other modules. cpp test-suite work.
................
r10879 | olly | 2008-09-23 08:52:41 +0200 (Tue, 23 Sep 2008) | 2 lines
Remove stray lines
................
r10880 | wsfulton | 2008-09-24 21:28:15 +0200 (Wed, 24 Sep 2008) | 1 line
fix clash between php and python when running scripts
................
r10881 | olly | 2008-09-25 09:11:36 +0200 (Thu, 25 Sep 2008) | 2 lines
[PHP5] Fill in typemaps for SWIGTYPE and void * (SF#2095186).
................
r10883 | wsfulton | 2008-09-26 07:05:23 +0200 (Fri, 26 Sep 2008) | 1 line
typo fix
................
r10884 | bhy | 2008-09-28 11:36:06 +0200 (Sun, 28 Sep 2008) | 1 line
merge test case pybuf and benchmark pybuf_benchmark into a single test case
................
r10885 | mutandiz | 2008-09-30 21:45:13 +0200 (Tue, 30 Sep 2008) | 1 line
[allegrocl] Various fixes to the generated C wrapper code (enums, constants, function declarations), as I progress through the test-suite.
................
r10886 | olly | 2008-10-01 07:28:45 +0200 (Wed, 01 Oct 2008) | 2 lines
Fix non-standard indentation.
................
r10887 | olly | 2008-10-01 13:54:31 +0200 (Wed, 01 Oct 2008) | 4 lines
Fix indentation. Use %{ %} in a couple of typemaps to avoid adding needless
{ } to the generated code. Use memcpy() instead of memmove() where the
destination is freshly allocated so there's no possibility of overlap.
................
r10893 | wsfulton | 2008-10-10 00:42:45 +0200 (Fri, 10 Oct 2008) | 1 line
suggest starting points for documentation
................
r10896 | wsfulton | 2008-11-01 23:52:26 +0100 (Sat, 01 Nov 2008) | 1 line
Add the strip encoder patch from Anatoly Techtonik #2130016
................
r10897 | wsfulton | 2008-11-02 00:09:26 +0100 (Sun, 02 Nov 2008) | 1 line
Add patch #2128249 from Anatoly Techtonik which corrects the C/C++ proxy class being reported for Python docstrings when %rename is used
................
r10898 | wsfulton | 2008-11-03 13:51:45 +0100 (Mon, 03 Nov 2008) | 1 line
customised ccache support: read the CCACHE_OUTFILES env variable and if exists, the names of all generated files are written to the filename specified in the env variable
................
r10899 | wsfulton | 2008-11-03 14:32:33 +0100 (Mon, 03 Nov 2008) | 1 line
update this README
................
r10900 | wsfulton | 2008-11-03 14:37:28 +0100 (Mon, 03 Nov 2008) | 1 line
Import ccache-2.4 source
................
r10901 | wsfulton | 2008-11-03 14:40:57 +0100 (Mon, 03 Nov 2008) | 1 line
cvs -> svn ignores
................
r10902 | wsfulton | 2008-11-03 14:49:49 +0100 (Mon, 03 Nov 2008) | 1 line
Import patches to ccache-2.4 from debian (ccache-2.4-15)
................
r10903 | wsfulton | 2008-11-03 14:59:23 +0100 (Mon, 03 Nov 2008) | 1 line
apply debian/patches/01_no_home.diff
................
r10904 | wsfulton | 2008-11-03 15:02:32 +0100 (Mon, 03 Nov 2008) | 1 line
apply debian/patches/02_ccache-compressed.diff
................
r10905 | wsfulton | 2008-11-03 15:02:57 +0100 (Mon, 03 Nov 2008) | 1 line
apply debian/patches/04_ignore_profile.diff
................
r10906 | wsfulton | 2008-11-03 15:03:21 +0100 (Mon, 03 Nov 2008) | 1 line
apply debian/patches/05_nfs_fix.diff
................
r10907 | wsfulton | 2008-11-03 15:03:52 +0100 (Mon, 03 Nov 2008) | 1 line
apply debian/patches/06_md.diff
................
r10908 | wsfulton | 2008-11-03 15:04:15 +0100 (Mon, 03 Nov 2008) | 1 line
apply debian/patches/07_cachedirtag.diff
................
r10909 | wsfulton | 2008-11-03 15:04:47 +0100 (Mon, 03 Nov 2008) | 1 line
apply debian/patches/08_manpage_hyphens.diff
................
r10910 | wsfulton | 2008-11-03 15:05:12 +0100 (Mon, 03 Nov 2008) | 1 line
apply debian/patches/09_respect_ldflags.diff
................
r10911 | wsfulton | 2008-11-03 15:06:06 +0100 (Mon, 03 Nov 2008) | 1 line
apply debian/patches/10_lru_cleanup.diff
................
r10912 | wsfulton | 2008-11-03 15:07:51 +0100 (Mon, 03 Nov 2008) | 1 line
apply debian/patches/11_utimes.diff
................
r10913 | wsfulton | 2008-11-03 15:08:28 +0100 (Mon, 03 Nov 2008) | 1 line
apply debian/patches/12_cachesize_permissions.diff
................
r10915 | wsfulton | 2008-11-05 13:34:15 +0100 (Wed, 05 Nov 2008) | 1 line
initial modifications for ccache to support SWIG
................
r10916 | wsfulton | 2008-11-05 17:53:55 +0100 (Wed, 05 Nov 2008) | 1 line
fix Makefile for autoconf>2.60
................
r10917 | wsfulton | 2008-11-05 17:55:07 +0100 (Wed, 05 Nov 2008) | 1 line
fix configure.in when running autoreconf
................
r10918 | wsfulton | 2008-11-05 17:57:21 +0100 (Wed, 05 Nov 2008) | 1 line
create executable name as ccache-swig instead of ccache to avoid conflict with the official ccache
................
r10919 | wsfulton | 2008-11-05 17:59:27 +0100 (Wed, 05 Nov 2008) | 1 line
remove autotool generated files
................
r10920 | wsfulton | 2008-11-07 18:03:57 +0100 (Fri, 07 Nov 2008) | 1 line
integrate ccache build
................
r10921 | wsfulton | 2008-11-07 22:25:31 +0100 (Fri, 07 Nov 2008) | 1 line
update some comments
................
r10922 | wsfulton | 2008-11-10 11:34:25 +0100 (Mon, 10 Nov 2008) | 1 line
ccache clean
................
r10923 | wsfulton | 2008-11-10 13:07:52 +0100 (Mon, 10 Nov 2008) | 1 line
rename documentation from ccache to ccache-swig
................
r10924 | wsfulton | 2008-11-10 15:37:45 +0100 (Mon, 10 Nov 2008) | 1 line
add in docs about new CCACHE_VERBOSE and CCACHE_SWIG env variables
................
r10925 | wsfulton | 2008-11-10 22:53:15 +0100 (Mon, 10 Nov 2008) | 1 line
Add Antti Karanta's documentation about the new c# array marshalling library plus some docs on the carrays library
................
r10926 | wsfulton | 2008-11-11 23:17:40 +0100 (Tue, 11 Nov 2008) | 1 line
add parameter list (or void) to all C functions
................
r10927 | wsfulton | 2008-11-11 23:28:18 +0100 (Tue, 11 Nov 2008) | 1 line
fix Swig_search_path declaration
................
r10928 | wsfulton | 2008-11-11 23:56:36 +0100 (Tue, 11 Nov 2008) | 1 line
Add patch #2152691 from MATSUURA Takanori which fixes compiles using the Intel compiler
................
r10929 | wsfulton | 2008-11-16 22:13:04 +0100 (Sun, 16 Nov 2008) | 1 line
Add documentation on typemaps for 'self' based on patch from Art Clarke
................
r10930 | wsfulton | 2008-11-16 22:40:28 +0100 (Sun, 16 Nov 2008) | 1 line
Fix -nopreprocess option to correctly generate output filenames and display filenames in warnings and errors
................
r10931 | wsfulton | 2008-11-17 23:43:15 +0100 (Mon, 17 Nov 2008) | 1 line
add input and output files to hash for correct operation when swig is the compiler. Automatically detect when swig is the compiler.
................
r10932 | wsfulton | 2008-11-17 23:47:55 +0100 (Mon, 17 Nov 2008) | 1 line
rename java run tests from main to runme for consistency across the languages
................
r10933 | wsfulton | 2008-11-19 01:57:09 +0100 (Wed, 19 Nov 2008) | 1 line
dont replicate the -nopreprocess command if it is given when using swig as compiler
................
r10934 | wsfulton | 2008-11-20 00:47:53 +0100 (Thu, 20 Nov 2008) | 1 line
added swig regression tests for ccache
................
r10935 | wsfulton | 2008-11-22 13:17:48 +0100 (Sat, 22 Nov 2008) | 1 line
fix env variable settings and add swig tests
................
r10936 | wsfulton | 2008-11-22 13:29:41 +0100 (Sat, 22 Nov 2008) | 1 line
deprecate use of include path to find the input file for behaviour that is compatible with other compilers and interopability for ccache
................
r10937 | wsfulton | 2008-11-22 13:32:51 +0100 (Sat, 22 Nov 2008) | 1 line
add ccache install and rename php4 to php
................
r10938 | wsfulton | 2008-11-22 13:35:27 +0100 (Sat, 22 Nov 2008) | 1 line
rename php4 to php
................
r10939 | wsfulton | 2008-11-23 20:44:29 +0100 (Sun, 23 Nov 2008) | 1 line
gcc-4.3 warning fixes
................
r10940 | wsfulton | 2008-11-23 20:45:31 +0100 (Sun, 23 Nov 2008) | 1 line
php4 rename to php fix
................
r10941 | wsfulton | 2008-11-23 22:47:39 +0100 (Sun, 23 Nov 2008) | 1 line
error: ‘pthread_once’ was not declared in this scope
................
r10942 | wsfulton | 2008-11-23 22:59:00 +0100 (Sun, 23 Nov 2008) | 1 line
Apply patch #2319790 from Johan Hake to fix shared_ptr usage in std::tr1 namespace.
................
r10943 | wsfulton | 2008-11-23 23:07:15 +0100 (Sun, 23 Nov 2008) | 1 line
give operator bool() a name
................
r10944 | wsfulton | 2008-11-23 23:29:07 +0100 (Sun, 23 Nov 2008) | 1 line
Apply patch #2263850 to fix ruby/file.i ... rubyio.h filename change in ruby 1.9.
................
r10945 | wsfulton | 2008-11-24 00:28:37 +0100 (Mon, 24 Nov 2008) | 1 line
add sanity check on preprocessed output
................
r10946 | wsfulton | 2008-11-24 00:29:33 +0100 (Mon, 24 Nov 2008) | 1 line
remove docs on old php4 switch
................
r10947 | wsfulton | 2008-11-26 00:36:23 +0100 (Wed, 26 Nov 2008) | 1 line
Add -outcurrentdir option
................
r10948 | wsfulton | 2008-11-26 19:37:48 +0100 (Wed, 26 Nov 2008) | 1 line
gcc-4.3 warning fixes
................
r10949 | wsfulton | 2008-11-26 22:35:15 +0100 (Wed, 26 Nov 2008) | 1 line
modify test-suite (barring python atm) to not rely on the -I path to find the input .i file - removes the new warning 125 and sets up the test-suite for testing with ccache. This change required the use of -outcurrentdir and moving the .i files from the language subdirectories to the directory above along with some .i file name changes.
................
r10950 | wsfulton | 2008-11-26 22:44:53 +0100 (Wed, 26 Nov 2008) | 1 line
warning fix for when zlib not available
................
r10951 | wsfulton | 2008-11-26 22:54:49 +0100 (Wed, 26 Nov 2008) | 1 line
remove svn:executable property where applied incorrectly
................
r10952 | wsfulton | 2008-11-26 22:56:48 +0100 (Wed, 26 Nov 2008) | 1 line
remove svn:executable property where applied incorrectly
................
r10953 | wsfulton | 2008-11-26 23:50:35 +0100 (Wed, 26 Nov 2008) | 1 line
modifying build system not to rely on the -I path to find the input files avoiding warning 125: move python .i files up one directory, some files have been renamed - prepended with python
................
r10954 | wsfulton | 2008-11-27 00:04:18 +0100 (Thu, 27 Nov 2008) | 1 line
modifying build system not to rely on the -I path to find the input files avoiding warning 125: merge .i files that are common between python and the main version
................
r10955 | wsfulton | 2008-11-27 00:25:47 +0100 (Thu, 27 Nov 2008) | 1 line
fix test names since they were renamed recently
................
r10956 | wsfulton | 2008-11-29 00:30:45 +0100 (Sat, 29 Nov 2008) | 1 line
minor fix to formatting in generated types table
................
r10957 | wsfulton | 2008-11-29 00:33:37 +0100 (Sat, 29 Nov 2008) | 1 line
move iadd.h contents into iadd.i
................
r10958 | wsfulton | 2008-11-29 00:35:46 +0100 (Sat, 29 Nov 2008) | 1 line
UTL - Fix some incorrect acceptance of types in the STL, eg a double * element passed into a vector constructor would be accepted, but the ensuing behaviour was undefined. Now the type conversion correctly raises an exception
................
r10959 | wsfulton | 2008-11-29 00:37:13 +0100 (Sat, 29 Nov 2008) | 1 line
revert mistaken checkin
................
r10960 | wsfulton | 2008-12-02 21:21:16 +0100 (Tue, 02 Dec 2008) | 1 line
Apply patch #2143727 for Python from Serge Monkewitz to fix importing base classes when the package option is specified in %module and that module is %import'ed
................
r10961 | bhy | 2008-12-03 19:43:44 +0100 (Wed, 03 Dec 2008) | 2 lines
Commited SF#2158938: change all SWIG symbols start with Py to a new name.
................
r10962 | bhy | 2008-12-03 20:24:06 +0100 (Wed, 03 Dec 2008) | 1 line
2to3 has its way to exclude fixer now, so we nolonger need our hack
................
r10963 | bhy | 2008-12-03 22:36:53 +0100 (Wed, 03 Dec 2008) | 1 line
add shebang for pyname_patch.py
................
r10964 | wsfulton | 2008-12-06 18:10:53 +0100 (Sat, 06 Dec 2008) | 1 line
add test for inheritance of 3 classes deep which exposes a problem in the python shared_ptr wrappers. Manually added the %types for now.
................
r10965 | wsfulton | 2008-12-06 18:12:05 +0100 (Sat, 06 Dec 2008) | 1 line
minor formatting fix
................
r10966 | wsfulton | 2008-12-06 18:18:38 +0100 (Sat, 06 Dec 2008) | 1 line
remove SWIG_TypeCheck_Template so that the code within it is debuggable
................
r10967 | wsfulton | 2008-12-06 22:40:54 +0100 (Sat, 06 Dec 2008) | 1 line
modify build system to use php instead of php4
................
r10968 | wsfulton | 2008-12-06 22:55:15 +0100 (Sat, 06 Dec 2008) | 1 line
modify build system to use php instead of php4
................
r10969 | wsfulton | 2008-12-07 00:15:20 +0100 (Sun, 07 Dec 2008) | 1 line
remove last vestiges of php4 and encourage use of -php rather than -php5
................
r10970 | olly | 2008-12-07 01:38:14 +0100 (Sun, 07 Dec 2008) | 2 lines
[PHP] Fix warnings when compiling generated wrapper with GCC 4.3.
................
r10971 | wsfulton | 2008-12-07 11:57:43 +0100 (Sun, 07 Dec 2008) | 1 line
Clean up gcc-4.3 warnings
................
r10972 | wsfulton | 2008-12-07 14:40:36 +0100 (Sun, 07 Dec 2008) | 1 line
Apply autoreconf_fixes.patch sent to debian -- restores documentation changes that the debian patches had if autoreconf is run
................
r10973 | wsfulton | 2008-12-08 21:40:20 +0100 (Mon, 08 Dec 2008) | 1 line
Add ccache uninstall target. Fix ccache install/uninstall to take account of --program-prefix --program-suffix
................
r10974 | wsfulton | 2008-12-08 21:41:56 +0100 (Mon, 08 Dec 2008) | 1 line
remove long options (which we don't use) from documentation
................
r10975 | wsfulton | 2008-12-09 22:31:31 +0100 (Tue, 09 Dec 2008) | 1 line
section name update
................
r10976 | wsfulton | 2008-12-09 22:33:19 +0100 (Tue, 09 Dec 2008) | 1 line
refine Makefile targets for documentation generation and remove generated ccache documentation from svn
................
r10977 | wsfulton | 2008-12-09 22:42:51 +0100 (Tue, 09 Dec 2008) | 1 line
Add debian patch 13_html_links.diff
................
r10978 | wsfulton | 2008-12-09 22:44:58 +0100 (Tue, 09 Dec 2008) | 1 line
add debian patch 14_hardllink_doc.diff
................
r10979 | wsfulton | 2008-12-09 23:27:32 +0100 (Tue, 09 Dec 2008) | 1 line
update patches applied
................
r10980 | wsfulton | 2008-12-12 22:10:48 +0100 (Fri, 12 Dec 2008) | 1 line
fix display of garbage where it should display an error message in error situations of unterminated string, comment etc within %inline, nested struct etc
................
r10981 | wsfulton | 2008-12-12 22:31:21 +0100 (Fri, 12 Dec 2008) | 1 line
Apply patch from Kalyanov Dmitry which fixes parsing of nested structs containing comments
................
r10982 | wsfulton | 2008-12-17 01:21:13 +0100 (Wed, 17 Dec 2008) | 1 line
initial win32 support mostly using ccache-win32-2.4 patches to ccache-2.4
................
r10983 | wsfulton | 2008-12-17 01:25:30 +0100 (Wed, 17 Dec 2008) | 1 line
add info about ccache-win32 patches applied
................
r10984 | wsfulton | 2008-12-17 01:28:51 +0100 (Wed, 17 Dec 2008) | 1 line
remove cast needed for windows - doesn't work on linux
................
r10985 | wsfulton | 2008-12-17 02:33:00 +0100 (Wed, 17 Dec 2008) | 1 line
some html fixes
................
r10986 | wsfulton | 2008-12-17 02:46:52 +0100 (Wed, 17 Dec 2008) | 1 line
add ccache to windows build, better fail if executables don't run. Fix documentation build. Remove .cvsignore files removal as we are no longer using cvs.
................
r10987 | wsfulton | 2008-12-19 22:41:05 +0100 (Fri, 19 Dec 2008) | 1 line
win32 fixes to pass the ccache test-suite
................
r10988 | wsfulton | 2008-12-20 00:25:40 +0100 (Sat, 20 Dec 2008) | 1 line
update ccache man page for ccache-swig
................
r10989 | wsfulton | 2008-12-20 00:29:00 +0100 (Sat, 20 Dec 2008) | 1 line
remove some warnings
................
r10990 | wsfulton | 2008-12-20 02:45:11 +0100 (Sat, 20 Dec 2008) | 1 line
Add ccache documentation to main docs
................
r10991 | wsfulton | 2008-12-20 02:49:58 +0100 (Sat, 20 Dec 2008) | 1 line
new section numbering since adding in ccache chapter
................
r10992 | wsfulton | 2008-12-20 18:20:25 +0100 (Sat, 20 Dec 2008) | 1 line
Add Win32 ccache locking from Christophe Gisquet patch http://lists.samba.org/archive/ccache/2006q3/000242.html
................
r10993 | wsfulton | 2008-12-21 00:59:03 +0100 (Sun, 21 Dec 2008) | 1 line
possibly slightly faster win32 process spawn from http://lists.samba.org/archive/ccache/2006q3/000242.html
................
r10994 | wsfulton | 2008-12-21 01:29:48 +0100 (Sun, 21 Dec 2008) | 1 line
Apply patch #2440046 which fixes possible seg faults for member and global variable char arrays when the strings are larger than the string array size.
................
r10995 | wsfulton | 2008-12-21 01:55:27 +0100 (Sun, 21 Dec 2008) | 1 line
Fix some make targets not running on cygwin
................
r10996 | wsfulton | 2008-12-22 00:16:56 +0100 (Mon, 22 Dec 2008) | 1 line
Add CCACHE_STRIPC option to remove an unwarranted warning when using ccache with the Solaris Workshop C++ compiler
................
r10997 | wsfulton | 2008-12-22 22:43:48 +0100 (Mon, 22 Dec 2008) | 1 line
Fix #2432801 - Make SwigValueWrapper exception safe for when copy constructors throw exceptions
................
r10998 | wsfulton | 2008-12-23 08:44:59 +0100 (Tue, 23 Dec 2008) | 1 line
Fix #2153773 - %nojavaexception - disabling and clearing Java checked exceptions
................
r10999 | wsfulton | 2008-12-23 23:47:58 +0100 (Tue, 23 Dec 2008) | 1 line
typo fix
................
r11000 | wsfulton | 2008-12-24 14:19:55 +0100 (Wed, 24 Dec 2008) | 1 line
fix input filename containing a path on windows
................
r11001 | wsfulton | 2008-12-24 15:50:26 +0100 (Wed, 24 Dec 2008) | 1 line
accept unix directory separators on windows for input file
................
r11002 | wsfulton | 2008-12-24 15:54:52 +0100 (Wed, 24 Dec 2008) | 1 line
minor fixes from last checkin
................
r11003 | wsfulton | 2008-12-24 20:17:16 +0100 (Wed, 24 Dec 2008) | 1 line
warning fixes
................
r11004 | wsfulton | 2008-12-24 20:20:54 +0100 (Wed, 24 Dec 2008) | 1 line
warning fixes
................
r11005 | wsfulton | 2008-12-25 00:42:39 +0100 (Thu, 25 Dec 2008) | 1 line
overlooked build system mods now implemented to remove warning 125
................
r11006 | wsfulton | 2008-12-28 19:41:16 +0100 (Sun, 28 Dec 2008) | 1 line
add strong exception guarantee to SwigValueWrapper
................
r11007 | wsfulton | 2008-12-28 21:16:31 +0100 (Sun, 28 Dec 2008) | 1 line
SwigValueWrapper - remove two constructors which are not required by the code SWIG generates
................
r11008 | wsfulton | 2008-12-28 21:32:44 +0100 (Sun, 28 Dec 2008) | 1 line
Add boost::intrusive_ptr wrappers from Mike Rowbotham
................
r11009 | wsfulton | 2008-12-28 21:35:22 +0100 (Sun, 28 Dec 2008) | 1 line
li_intrusive_ptr test - commented out as not fully working
................
r11010 | wsfulton | 2008-12-28 21:36:21 +0100 (Sun, 28 Dec 2008) | 1 line
comment correction
................
r11011 | wsfulton | 2008-12-29 01:11:51 +0100 (Mon, 29 Dec 2008) | 1 line
Compiler warning fix in Perl out typemap for std::vector
................
r11012 | wsfulton | 2008-12-29 01:13:19 +0100 (Mon, 29 Dec 2008) | 1 line
couple of minor Perl fixes from Ling Li
................
r11013 | drjoe | 2008-12-29 08:05:21 +0100 (Mon, 29 Dec 2008) | 2 lines
check for yodl package
................
r11014 | drjoe | 2008-12-29 23:06:50 +0100 (Mon, 29 Dec 2008) | 3 lines
allow for compilation with bison 2.4 which is more restrictive about $$
symbols than 2.3
................
r11015 | drjoe | 2008-12-29 23:25:55 +0100 (Mon, 29 Dec 2008) | 2 lines
change as(...,"integer") to as.integer to force conversion into integers
................
r11016 | wsfulton | 2008-12-29 23:56:25 +0100 (Mon, 29 Dec 2008) | 1 line
create a common banner header for all target language specific files
................
r11017 | wsfulton | 2008-12-30 00:56:03 +0100 (Tue, 30 Dec 2008) | 1 line
add missing language specific preprocessor define where missing for some languages
................
r11018 | wsfulton | 2008-12-30 01:38:34 +0100 (Tue, 30 Dec 2008) | 1 line
All languages now define a macro in the generated C/C++ wrapper file indicating which language is being wrapped, eg #define SWIGJAVA
................
r11019 | wsfulton | 2008-12-30 02:14:14 +0100 (Tue, 30 Dec 2008) | 1 line
getting ready for 1.3.37 release candidate
................
r11020 | wsfulton | 2008-12-30 11:46:41 +0100 (Tue, 30 Dec 2008) | 1 line
remove duplicate SWIGR macro
................
r11021 | wsfulton | 2008-12-30 12:02:59 +0100 (Tue, 30 Dec 2008) | 1 line
fix for new SWIGCSHARP defn in wrappers
................
r11022 | wsfulton | 2008-12-30 12:42:52 +0100 (Tue, 30 Dec 2008) | 1 line
explicit type warning fix
................
r11023 | wsfulton | 2008-12-31 00:33:35 +0100 (Wed, 31 Dec 2008) | 1 line
missing yodl2man should not break the configure stage for users as it is not required as the man pages are shipped with the release tarball
................
r11024 | wsfulton | 2008-12-31 00:50:32 +0100 (Wed, 31 Dec 2008) | 1 line
fix ccache-swig man page generation
................
r11025 | wsfulton | 2008-12-31 02:02:16 +0100 (Wed, 31 Dec 2008) | 1 line
re-order configure.in into sections for users and developers and requirements for the examples
................
r11026 | wsfulton | 2008-12-31 02:10:49 +0100 (Wed, 31 Dec 2008) | 1 line
better #! for finding python
................
r11027 | wsfulton | 2008-12-31 02:11:37 +0100 (Wed, 31 Dec 2008) | 1 line
put tagging back in
................
r11028 | wsfulton | 2009-01-03 02:59:42 +0100 (Sat, 03 Jan 2009) | 1 line
compile fix on Cygwin
................
r11029 | wsfulton | 2009-01-05 18:19:32 +0100 (Mon, 05 Jan 2009) | 1 line
fix up namespaces so that boost, std or std::tr1 can be used for shared_ptr/intrusive_ptr
................
r11030 | olly | 2009-01-05 23:40:07 +0100 (Mon, 05 Jan 2009) | 3 lines
Mark SWIGPERL5, SWIGPHP5, and SWIGTCL8 as deprecated in the source
code and remove documentation of them.
................
r11031 | wsfulton | 2009-01-06 19:13:57 +0100 (Tue, 06 Jan 2009) | 1 line
Fix CCACHE_STRIPC being set when using swig as the compiler.
................
r11032 | wsfulton | 2009-01-07 01:45:04 +0100 (Wed, 07 Jan 2009) | 1 line
log internal error wrt CCACHE_OUTFILES env variable
................
r11033 | wsfulton | 2009-01-07 01:50:06 +0100 (Wed, 07 Jan 2009) | 1 line
Fix error display when there is a problem with CCACHE_OUTFILES
................
r11034 | wsfulton | 2009-01-07 03:26:34 +0100 (Wed, 07 Jan 2009) | 1 line
Fix lack of error logging in some situations and fix failure to work on windows when swig is a pure Win32 (non-cygwin) compile
................
r11035 | wsfulton | 2009-01-07 11:36:00 +0100 (Wed, 07 Jan 2009) | 1 line
remove unnecessary logging on Win32 builds
................
r11036 | wsfulton | 2009-01-07 12:24:07 +0100 (Wed, 07 Jan 2009) | 1 line
reorder new test
................
r11037 | wsfulton | 2009-01-07 17:54:54 +0100 (Wed, 07 Jan 2009) | 1 line
Fix spaces in CCACHE_DIR and probably other places
................
r11038 | wsfulton | 2009-01-07 22:10:46 +0100 (Wed, 07 Jan 2009) | 1 line
Rename embedded smart pointer in SwigValueWrapper in order to avoid conflicts with the template type
................
r11039 | wsfulton | 2009-01-08 18:52:15 +0100 (Thu, 08 Jan 2009) | 1 line
add some missing stats and logging
................
r11040 | wsfulton | 2009-01-08 20:12:24 +0100 (Thu, 08 Jan 2009) | 1 line
missing function declaration fix
................
r11041 | wsfulton | 2009-01-08 20:20:51 +0100 (Thu, 08 Jan 2009) | 1 line
correct return type for PyUnicode_GetSize
................
r11042 | wsfulton | 2009-01-08 20:35:13 +0100 (Thu, 08 Jan 2009) | 1 line
fix cast of pointer to long
................
r11043 | wsfulton | 2009-01-08 20:46:38 +0100 (Thu, 08 Jan 2009) | 1 line
fix cast of pointer to long
................
r11044 | wsfulton | 2009-01-09 00:29:33 +0100 (Fri, 09 Jan 2009) | 1 line
minor formatting
................
r11045 | wsfulton | 2009-01-09 23:19:06 +0100 (Fri, 09 Jan 2009) | 1 line
warning fix
................
r11046 | xavier98 | 2009-01-10 00:38:14 +0100 (Sat, 10 Jan 2009) | 3 lines
Fix octave tests li_std_pair_extra, arrays_global, grouping, struct_value, unions.
................
r11047 | xavier98 | 2009-01-10 01:20:46 +0100 (Sat, 10 Jan 2009) | 6 lines
Octave: add {save,load}_{ascii,binary,hdf} functions that silently do nothing;
give default operator mappings a more conventional suffix;
fix test li_std_string_extra.
................
r11048 | xavier98 | 2009-01-10 01:29:37 +0100 (Sat, 10 Jan 2009) | 3 lines
Fix octave test allprotected.
................
r11049 | wsfulton | 2009-01-10 02:15:03 +0100 (Sat, 10 Jan 2009) | 1 line
Patch #1992756 from Colin McDonald - %contract not working for classes in namespace
................
r11050 | xavier98 | 2009-01-10 03:17:58 +0100 (Sat, 10 Jan 2009) | 3 lines
Octave: fix carrays regression caused by operator suffix change.
................
r11051 | drjoe | 2009-01-11 00:30:10 +0100 (Sun, 11 Jan 2009) | 2 lines
add regression test for integers
................
r11052 | drjoe | 2009-01-11 01:08:37 +0100 (Sun, 11 Jan 2009) | 3 lines
Fix integer handling in r. unsigned values where getting handled
incorrected as reals leading to crashes
................
r11054 | wsfulton | 2009-01-11 18:57:21 +0100 (Sun, 11 Jan 2009) | 1 line
more portable pointer in a string comparison
................
r11055 | wsfulton | 2009-01-11 22:32:42 +0100 (Sun, 11 Jan 2009) | 1 line
another portability fix
................
r11056 | wsfulton | 2009-01-11 22:37:54 +0100 (Sun, 11 Jan 2009) | 1 line
yet better pointer string comparison
................
r11057 | drjoe | 2009-01-12 08:41:38 +0100 (Mon, 12 Jan 2009) | 2 lines
Add regression tests for R
................
r11058 | drjoe | 2009-01-12 09:54:36 +0100 (Mon, 12 Jan 2009) | 2 lines
fix change to make compatible with integer framework
................
r11059 | drjoe | 2009-01-12 09:57:16 +0100 (Mon, 12 Jan 2009) | 2 lines
put in integer fixes
................
r11060 | wsfulton | 2009-01-12 12:42:27 +0100 (Mon, 12 Jan 2009) | 1 line
Fix union.i module name and rename to union_parameter.i
................
r11061 | mgossage | 2009-01-13 02:42:25 +0100 (Tue, 13 Jan 2009) | 3 lines
[Lua] Added contract support for requiring that unsigned numbers are >=0
Rewrote much of Examples/Lua/embed3.
Added a lot of to the Lua documentation.
................
r11062 | wsfulton | 2009-01-13 08:09:27 +0100 (Tue, 13 Jan 2009) | 1 line
Fix compilation error when using directors on protected virtual overloaded methods reported by Sam Hendley.
................
r11063 | wsfulton | 2009-01-13 08:11:00 +0100 (Tue, 13 Jan 2009) | 1 line
1.3.37 final touches
................
r11069 | wsfulton | 2009-01-13 19:21:18 +0100 (Tue, 13 Jan 2009) | 1 line
bump version to 1.3.38
................
r11070 | wsfulton | 2009-01-15 08:29:28 +0100 (Thu, 15 Jan 2009) | 1 line
Fix segfault when using -perl -v
................
r11072 | bhy | 2009-01-16 02:15:46 +0100 (Fri, 16 Jan 2009) | 1 line
fix a wrong indent
................
r11075 | wsfulton | 2009-01-21 19:55:32 +0100 (Wed, 21 Jan 2009) | 1 line
correct ccache-swig title in docs
................
r11076 | wsfulton | 2009-01-21 20:06:13 +0100 (Wed, 21 Jan 2009) | 2 lines
auto formatting mods
................
r11079 | bhy | 2009-01-24 08:59:46 +0100 (Sat, 24 Jan 2009) | 1 line
when doing partialcheck, don't skip any test-suite
................
r11080 | bhy | 2009-01-24 14:15:51 +0100 (Sat, 24 Jan 2009) | 6 lines
Replaced all [const] String_or_char * to const_String_or_char_ptr, by the following command:
sed -i "s/\(const \)\?String_or_char \*/const_String_or_char_ptr /g" CParse/* Include/* Modules/* Preprocessor/* Swig/*
This is a preparation for moving to new DOH, since for strong typed objects we need the const_String_or_char_ptr class to implicit convert to and from String * or const char *.
................
r11083 | bhy | 2009-01-24 15:03:37 +0100 (Sat, 24 Jan 2009) | 3 lines
Initialized merge tracking via "svnmerge" with revisions "1-11081" from
https://swig.svn.sourceforge.net/svnroot/swig/branches/swig-2.0
................
r11092 | wsfulton | 2009-01-28 19:45:13 +0100 (Wed, 28 Jan 2009) | 1 line
Fix classLookup and enumLookup when the global scope operator is used on objects passed by value
................
r11093 | wsfulton | 2009-01-29 20:25:37 +0100 (Thu, 29 Jan 2009) | 1 line
Fix regression introduced in 1.3.37 where the default output directory for target language specific files (in the absence of -outdir) was no longer the same as the generated c/c++ file
................
r11094 | wsfulton | 2009-01-29 22:20:31 +0100 (Thu, 29 Jan 2009) | 1 line
remove debugging output
................
r11095 | bhy | 2009-01-30 09:00:38 +0100 (Fri, 30 Jan 2009) | 8 lines
Blocked revisions 11084 via svnmerge
........
r11084 | bhy | 2009-01-24 22:24:49 +0800 (Sat, 24 Jan 2009) | 1 line
Enforce all SWIG .c source code to compile under C++ compiler
........
................
r11096 | bhy | 2009-01-30 10:15:35 +0100 (Fri, 30 Jan 2009) | 8 lines
Blocked revisions 11087 via svnmerge
........
r11087 | bhy | 2009-01-25 02:16:31 +0800 (Sun, 25 Jan 2009) | 2 lines
Removed all extern "C" since all code is compiled under C++ compiler.
........
................
r11097 | bhy | 2009-01-30 11:27:37 +0100 (Fri, 30 Jan 2009) | 21 lines
Merged revisions 11085-11086,11088-11089 via svnmerge from
https://swig.svn.sourceforge.net/svnroot/swig/branches/swig-2.0
........
r11085 | bhy | 2009-01-25 00:21:55 +0800 (Sun, 25 Jan 2009) | 2 lines
Fix const-correctness.
........
r11086 | bhy | 2009-01-25 02:08:50 +0800 (Sun, 25 Jan 2009) | 2 lines
Correct some function definition in header files, which implementation changed in previous commit caused mismatch.
........
r11088 | bhy | 2009-01-25 02:38:32 +0800 (Sun, 25 Jan 2009) | 1 line
minor fix and now SWIG is alive again
........
r11089 | bhy | 2009-01-25 06:07:07 +0800 (Sun, 25 Jan 2009) | 1 line
Correct some bug introduced in previous commits. Now SWIG is pretty good with C++ compiler.
........
................
r11098 | bhy | 2009-01-30 11:32:59 +0100 (Fri, 30 Jan 2009) | 1 line
Fix broken caused by merge
................
r11099 | bhy | 2009-01-31 14:38:39 +0100 (Sat, 31 Jan 2009) | 1 line
Fix SF#2552048. Remove the 'self' parameter in Python proxy code for static member function.
................
r11100 | bhy | 2009-01-31 15:37:54 +0100 (Sat, 31 Jan 2009) | 1 line
Fix SF#2552488: indentation adjust of %pythonappend and %pythonprepend
................
r11101 | wsfulton | 2009-01-31 20:02:10 +0100 (Sat, 31 Jan 2009) | 1 line
const / non-const warning fix
................
r11102 | wsfulton | 2009-01-31 20:10:55 +0100 (Sat, 31 Jan 2009) | 1 line
fix tab alignment - all tabs in SWIG are 8 chars
................
r11103 | wsfulton | 2009-01-31 20:37:58 +0100 (Sat, 31 Jan 2009) | 1 line
finishing touches for 1.3.38
................
r11104 | wsfulton | 2009-02-01 00:14:02 +0100 (Sun, 01 Feb 2009) | 1 line
html fix
................
r11107 | wsfulton | 2009-02-01 01:31:19 +0100 (Sun, 01 Feb 2009) | 1 line
bump version to 1.3.39
................
r11110 | talby | 2009-02-05 16:47:42 +0100 (Thu, 05 Feb 2009) | 1 line
Fix SF#2564192
................
r11111 | wsfulton | 2009-02-07 02:58:39 +0100 (Sat, 07 Feb 2009) | 1 line
Apply #2081967 configure changes for mzscheme configure errors and breaking of swig exe build
................
r11116 | wsfulton | 2009-02-07 21:25:54 +0100 (Sat, 07 Feb 2009) | 1 line
fix older versions of mzscheme detection
................
r11117 | wsfulton | 2009-02-08 00:44:12 +0100 (Sun, 08 Feb 2009) | 1 line
remove gcc warning when using -Wunreachable-code
................
r11123 | wsfulton | 2009-02-08 23:30:10 +0100 (Sun, 08 Feb 2009) | 1 line
Fix %feature not working for conversion operators
................
r11124 | wsfulton | 2009-02-08 23:54:58 +0100 (Sun, 08 Feb 2009) | 1 line
update old syntax to new _dim0
................
r11125 | bhy | 2009-02-10 15:21:43 +0100 (Tue, 10 Feb 2009) | 1 line
changed the mapped 'SIZE' of buffer interface from the length of raw buffer to number of items in the buffer. So it would be easier to use with type other than 'char'
................
r11126 | wsfulton | 2009-02-12 22:16:03 +0100 (Thu, 12 Feb 2009) | 1 line
remove unnecessary temporary variable when wrapping return by reference
................
r11127 | wsfulton | 2009-02-13 08:26:06 +0100 (Fri, 13 Feb 2009) | 1 line
Add support for %extend and memberin typemaps
................
r11128 | wsfulton | 2009-02-13 23:42:45 +0100 (Fri, 13 Feb 2009) | 1 line
Add %attributeval and %attributestring to attribute.swg library
................
r11129 | wsfulton | 2009-02-17 09:03:22 +0100 (Tue, 17 Feb 2009) | 1 line
make clean-test-suite now cleans all languages, not just languages detected at configure time
................
r11130 | wsfulton | 2009-02-17 19:54:56 +0100 (Tue, 17 Feb 2009) | 1 line
typemap_namespace.i fix for mzscheme
................
r11131 | wsfulton | 2009-02-17 20:02:04 +0100 (Tue, 17 Feb 2009) | 1 line
Fix make partialcheck-mzscheme-test-suite
................
r11132 | wsfulton | 2009-02-17 21:08:57 +0100 (Tue, 17 Feb 2009) | 1 line
Fix make partialcheck-ocaml-test-suite
................
r11133 | wsfulton | 2009-02-20 08:52:24 +0100 (Fri, 20 Feb 2009) | 1 line
add new %begin directive for inserting code at top of wrapper file
................
r11134 | wsfulton | 2009-02-20 09:03:49 +0100 (Fri, 20 Feb 2009) | 1 line
minor correction about %begin
................
r11135 | wsfulton | 2009-02-20 21:55:16 +0100 (Fri, 20 Feb 2009) | 1 line
Fix -co option which broke in 1.3.37 SF #2605955
................
r11136 | wsfulton | 2009-02-21 00:55:37 +0100 (Sat, 21 Feb 2009) | 1 line
CFFI - Fix seg faults when for %extend and using statements
................
r11137 | wsfulton | 2009-02-21 01:56:41 +0100 (Sat, 21 Feb 2009) | 1 line
Fix seg fault wrapping some constant variable (%constant) types
................
r11139 | olly | 2009-02-26 06:53:37 +0100 (Thu, 26 Feb 2009) | 3 lines
Fix several heading underlines to be the same length as the headings. Add a
newline after a few headings which were missing it.
................
r11140 | bhy | 2009-02-28 15:02:02 +0100 (Sat, 28 Feb 2009) | 3 lines
Fix SF#2637352, move declaration of SWIG_module before the call of SWIG_Python_FixMethods, since some C compiler don't allow declaration in middle of function body.
................
r11141 | bhy | 2009-03-01 10:37:21 +0100 (Sun, 01 Mar 2009) | 1 line
Fix SF#2583160. Make swig_import_helper() in shadow wrapper able to deal with the case that module already imported at other place.
................
r11142 | bhy | 2009-03-02 17:35:12 +0100 (Mon, 02 Mar 2009) | 1 line
Add searching for Python 3.1 in configure.in
................
r11143 | bhy | 2009-03-02 18:56:29 +0100 (Mon, 02 Mar 2009) | 1 line
Fixes to support Python 3.0.1 and higher.
................
r11148 | wsfulton | 2009-03-11 22:01:55 +0100 (Wed, 11 Mar 2009) | 1 line
undef bind for win32, problem reported by vondruch
................
r11150 | wsfulton | 2009-03-12 21:41:56 +0100 (Thu, 12 Mar 2009) | 1 line
Fix #2676738 SWIG generated symbol name clashes.
................
r11151 | bhy | 2009-03-16 12:10:29 +0100 (Mon, 16 Mar 2009) | 1 line
Remove an nonsense Py_INCREF.
................
r11152 | wsfulton | 2009-03-16 18:42:30 +0100 (Mon, 16 Mar 2009) | 1 line
vc++ warning fixes
................
r11153 | wsfulton | 2009-03-16 20:33:38 +0100 (Mon, 16 Mar 2009) | 1 line
add in correct specialization for std::vector to follow C++ standard - to create compileable wrappers with vc++ and recent return by reference changes
................
r11154 | wsfulton | 2009-03-16 22:39:36 +0100 (Mon, 16 Mar 2009) | 1 line
minor rewrite
................
r11156 | wsfulton | 2009-03-19 00:30:57 +0100 (Thu, 19 Mar 2009) | 1 line
std::vector wrapper improvements for .NET 2 implementing IEnumerable
................
r11157 | wsfulton | 2009-03-19 00:54:09 +0100 (Thu, 19 Mar 2009) | 1 line
Add possibility of using when using shared_ptr and wrapping pointers
................
r11158 | wsfulton | 2009-03-19 01:04:28 +0100 (Thu, 19 Mar 2009) | 1 line
remove debug comment
................
r11159 | bhy | 2009-03-19 15:20:38 +0100 (Thu, 19 Mar 2009) | 1 line
Fix wrong year in changelog date
................
r11160 | bhy | 2009-03-19 16:26:57 +0100 (Thu, 19 Mar 2009) | 1 line
Fix the memory leak related to Python 3 unicode and char * conversion.
................
r11161 | bhy | 2009-03-19 17:56:01 +0100 (Thu, 19 Mar 2009) | 1 line
Fix problem caused by thread not properly terminated in director_thread test. This was cause crash in Python 3
................
r11163 | wsfulton | 2009-03-21 00:29:36 +0100 (Sat, 21 Mar 2009) | 1 line
final touches for 1.3.39 release
................
r11164 | wsfulton | 2009-03-21 00:35:52 +0100 (Sat, 21 Mar 2009) | 1 line
add summary for 1.3.39 release
................
r11165 | wsfulton | 2009-03-21 00:40:39 +0100 (Sat, 21 Mar 2009) | 1 line
Apply small documentation fix - patch #2579863
................
r11166 | wsfulton | 2009-03-21 00:54:43 +0100 (Sat, 21 Mar 2009) | 1 line
invoke using swig.exe instead of just swig in Visual Studio project files
................
r11169 | wsfulton | 2009-03-21 02:42:37 +0100 (Sat, 21 Mar 2009) | 1 line
remove out of date info
................
r11170 | wsfulton | 2009-03-21 02:45:41 +0100 (Sat, 21 Mar 2009) | 1 line
bump version to 1.3.40
................
r11174 | olly | 2009-03-30 01:38:19 +0200 (Mon, 30 Mar 2009) | 7 lines
Some distros (e.g. frugalware) build PHP with --enable-safe-mode, so as we need
to explicitly disable it to avoid the testsuite failing with:
Warning: dl(): Dynamically loaded extensions aren't allowed when running in Safe Mode
Patch from Miklos Vajna.
................
r11175 | olly | 2009-03-30 04:01:12 +0200 (Mon, 30 Mar 2009) | 2 lines
check::equal() now reports the values if they aren't equal.
................
r11176 | olly | 2009-03-30 04:22:14 +0200 (Mon, 30 Mar 2009) | 5 lines
The default out typemap for char[ANY] now returns up to a zero byte, or the end
of the array if there is no zero byte. This is the same as Python does, and seems
more generally useful than the previous behaviour of returning the whole
contents of the array including any zero bytes.
................
r11177 | olly | 2009-03-30 04:49:13 +0200 (Mon, 30 Mar 2009) | 2 lines
Document the previous change.
................
r11178 | olly | 2009-03-31 12:25:54 +0200 (Tue, 31 Mar 2009) | 2 lines
printf(string) -> printf("%s", string)
................
r11179 | wsfulton | 2009-03-31 14:23:47 +0200 (Tue, 31 Mar 2009) | 1 line
don't unnecessarily set swigCPtr to zero again if Dispose/delete called multiple times
................
r11182 | wsfulton | 2009-04-01 10:41:41 +0200 (Wed, 01 Apr 2009) | 1 line
update .dll -> .pyd for python
................
r11183 | wsfulton | 2009-04-01 14:46:26 +0200 (Wed, 01 Apr 2009) | 1 line
fix ordering of chapters
................
r11185 | wsfulton | 2009-04-09 19:51:59 +0200 (Thu, 09 Apr 2009) | 1 line
Fix #2746858 - C macro expression using floating point numbers
................
r11191 | wsfulton | 2009-04-21 22:09:15 +0200 (Tue, 21 Apr 2009) | 1 line
Fix #2753469 - bool &OUTPUT and bool *OUTPUT typemaps initialisation.
................
r11192 | olly | 2009-04-29 11:35:58 +0200 (Wed, 29 Apr 2009) | 7 lines
[Python] Don't attempt to acquire the GIL in situations where we
know that it will already be locked. This avoids some dead-locks
with mod_python (due to mod_python bugs which are apparently
unlikely to ever be fixed), and results in smaller wrappers which
run a little faster (in tests with Xapian on x86-64 Ubuntu 9.04,
the stripped wrapper library was 11% smaller and ran 2.7% faster).
................
r11193 | olly | 2009-04-29 14:00:38 +0200 (Wed, 29 Apr 2009) | 2 lines
Fix comment typos
................
r11194 | bhy | 2009-04-29 14:05:33 +0200 (Wed, 29 Apr 2009) | 1 line
fix of unclear comment regarding Python 3 tp_compare removal
................
r11195 | olly | 2009-04-29 15:43:23 +0200 (Wed, 29 Apr 2009) | 2 lines
int -> Py_ssize_t to fix 64 bit Python 3 failure to compile generated code
................
r11196 | wsfulton | 2009-04-29 19:58:32 +0200 (Wed, 29 Apr 2009) | 1 line
Add the 'notderived' attribute to the javabase and csbase typemaps
................
r11197 | olly | 2009-04-30 01:59:06 +0200 (Thu, 30 Apr 2009) | 2 lines
Remove two accidentally committed debug fprintf() calls.
................
r11198 | olly | 2009-04-30 02:13:14 +0200 (Thu, 30 Apr 2009) | 2 lines
Remove accidentally committed conflict marker.
................
r11199 | wsfulton | 2009-04-30 08:12:32 +0200 (Thu, 30 Apr 2009) | 1 line
add test for optimal attribute in out typemap
................
r11200 | wsfulton | 2009-05-01 08:21:56 +0200 (Fri, 01 May 2009) | 1 line
remove executable bits
................
r11201 | wsfulton | 2009-05-01 08:26:42 +0200 (Fri, 01 May 2009) | 1 line
Add test for notderived attribute in csbase/javabase typemap
................
r11205 | wsfulton | 2009-05-05 23:03:25 +0200 (Tue, 05 May 2009) | 1 line
minor formatting mod
................
r11206 | wsfulton | 2009-05-05 23:11:11 +0200 (Tue, 05 May 2009) | 1 line
minor formatting mod 2
................
r11209 | wsfulton | 2009-05-11 19:46:51 +0200 (Mon, 11 May 2009) | 1 line
Improved std::vector wrappers on the C# proxy side from Yuval Baror to implement IList<> instead of IEnumerable<> where possible.
................
r11210 | wsfulton | 2009-05-12 19:24:01 +0200 (Tue, 12 May 2009) | 1 line
move std::multimap tests from li_std_map.i into new li_std_multimap.i
................
r11212 | mutandiz | 2009-05-14 02:35:17 +0200 (Thu, 14 May 2009) | 1 line
[allegrocl] Minor tweak to improve wrapping in -nocwrap mode.
................
r11213 | bhy | 2009-05-14 17:58:09 +0200 (Thu, 14 May 2009) | 1 line
fixed the wrong pointer value returned by SwigPyObject_repr()
................
r11214 | wsfulton | 2009-05-17 22:28:43 +0200 (Sun, 17 May 2009) | 1 line
fix link
................
r11215 | olly | 2009-05-19 13:54:40 +0200 (Tue, 19 May 2009) | 2 lines
Snip nonsensical comment left over from cut and paste from other examples.
................
r11216 | olly | 2009-05-19 14:00:48 +0200 (Tue, 19 May 2009) | 2 lines
Remove note which is no longer relevant.
................
r11230 | wsfulton | 2009-05-22 08:10:52 +0200 (Fri, 22 May 2009) | 1 line
std::map improvements based on patch from Yuval Baror
................
r11231 | wsfulton | 2009-05-22 08:11:45 +0200 (Fri, 22 May 2009) | 1 line
use instead of self
................
r11232 | wsfulton | 2009-05-22 08:53:20 +0200 (Fri, 22 May 2009) | 1 line
Improve C# std::map tests to do the bulk of the testing on a map where the key and value types are different
................
r11233 | wsfulton | 2009-05-26 08:23:39 +0200 (Tue, 26 May 2009) | 1 line
Add std::vector copy constructor to proxy
................
r11234 | wsfulton | 2009-05-26 08:28:20 +0200 (Tue, 26 May 2009) | 1 line
Add copy constructor to std::map and make more efficient by passing keys and mapped type by reference instead of value
................
r11235 | wsfulton | 2009-05-26 08:31:04 +0200 (Tue, 26 May 2009) | 1 line
remove authors - these are in the CHANGES files and README files
................
r11236 | wsfulton | 2009-05-26 19:08:53 +0200 (Tue, 26 May 2009) | 1 line
std::map C# improvements
................
r11237 | wsfulton | 2009-05-28 00:04:19 +0200 (Thu, 28 May 2009) | 1 line
add test for $descriptor() macro
................
r11238 | wsfulton | 2009-05-28 00:55:14 +0200 (Thu, 28 May 2009) | 1 line
add missing file omitted in earlier commit
................
r11239 | wsfulton | 2009-05-28 01:39:46 +0200 (Thu, 28 May 2009) | 1 line
minor formatting
................
r11240 | wsfulton | 2009-05-29 19:42:49 +0200 (Fri, 29 May 2009) | 1 line
trailing comma fix for ISOC89 compliance - patch from Ben Schmeckpeper
................
r11241 | wsfulton | 2009-05-29 19:44:20 +0200 (Fri, 29 May 2009) | 1 line
minor format improvment
................
r11244 | talby | 2009-06-02 23:13:03 +0200 (Tue, 02 Jun 2009) | 2 lines
bugfix for Lib/perl5/reference.i (test-suite enhancements coming soon).
................
r11246 | wsfulton | 2009-06-05 19:19:29 +0200 (Fri, 05 Jun 2009) | 1 line
remove extra lookup of directorout typemap
................
r11247 | talby | 2009-06-05 20:47:30 +0200 (Fri, 05 Jun 2009) | 2 lines
reference.i improvements, testcase coverage. language specific interface support for test-suite.
................
r11259 | olly | 2009-06-15 14:27:21 +0200 (Mon, 15 Jun 2009) | 6 lines
Remove non-standard targets makecpptests, makectests, maketests, runcpptests,
runctests, runtests - the C ones at least don't work properly, and haven't for
a long time.
Remove explicit use of bash from missingcpptests and missingctests as it isn't
required and bash may not be available.
................
r11279 | wsfulton | 2009-06-16 21:29:08 +0200 (Tue, 16 Jun 2009) | 1 line
fix Java and C# enums when one of the enum items is ignored
................
r11280 | wsfulton | 2009-06-16 22:26:28 +0200 (Tue, 16 Jun 2009) | 1 line
remove perl specific modifications to the enum_thorough test
................
r11281 | wsfulton | 2009-06-16 22:39:53 +0200 (Tue, 16 Jun 2009) | 1 line
fix error in bug reporter for enums and %ignore
................
r11282 | wsfulton | 2009-06-17 08:50:39 +0200 (Wed, 17 Jun 2009) | 1 line
better clarification for %include and #include and %module
................
r11283 | wsfulton | 2009-06-17 08:56:55 +0200 (Wed, 17 Jun 2009) | 1 line
quote %include statements
................
r11285 | wsfulton | 2009-06-19 00:36:39 +0200 (Fri, 19 Jun 2009) | 1 line
add further clarification about modules
................
r11287 | wsfulton | 2009-06-20 02:32:49 +0200 (Sat, 20 Jun 2009) | 1 line
a bit more on what is in a module
................
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-jezabek@11293 626c5289-ae23-0410-ae9c-e8d60b6d4f22
---
ANNOUNCE | 22 +-
CCache/COPYING | 339 +++++
CCache/Makefile.in | 73 +
CCache/README | 31 +
CCache/README.swig | 8 +
CCache/args.c | 91 ++
CCache/ccache.c | 1388 ++++++++++++++++++++
CCache/ccache.h | 205 +++
CCache/ccache.yo | 422 ++++++
CCache/ccache_swig_config.h.in | 1 +
CCache/cleanup.c | 193 +++
CCache/configure.in | 87 ++
CCache/debian/NEWS | 22 +
CCache/debian/README.Debian | 59 +
CCache/debian/changelog | 221 ++++
CCache/debian/compat | 1 +
CCache/debian/control | 20 +
CCache/debian/copyright | 29 +
CCache/debian/dirs | 3 +
CCache/debian/docs | 1 +
CCache/debian/examples | 2 +
CCache/debian/patches/01_no_home.diff | 100 ++
CCache/debian/patches/02_ccache-compressed.diff | 1026 +++++++++++++++
CCache/debian/patches/03_long_options.diff | 133 ++
CCache/debian/patches/04_ignore_profile.diff | 13 +
CCache/debian/patches/05_nfs_fix.diff | 45 +
CCache/debian/patches/06_md.diff | 77 ++
CCache/debian/patches/07_cachedirtag.diff | 75 ++
CCache/debian/patches/08_manpage_hyphens.diff | 89 ++
CCache/debian/patches/09_respect_ldflags.diff | 11 +
CCache/debian/patches/10_lru_cleanup.diff | 23 +
CCache/debian/patches/11_utimes.diff | 85 ++
.../debian/patches/12_cachesize_permissions.diff | 83 ++
CCache/debian/patches/13_html_links.diff | 33 +
CCache/debian/patches/14_hardlink_doc.diff | 48 +
CCache/debian/patches/CREDITS | 47 +
CCache/debian/rules | 141 ++
CCache/debian/update-ccache | 43 +
CCache/debian/watch | 2 +
CCache/execute.c | 286 ++++
CCache/hash.c | 80 ++
CCache/install-sh | 238 ++++
CCache/mdfour.c | 284 ++++
CCache/mdfour.h | 36 +
CCache/packaging/README | 5 +
CCache/packaging/ccache.spec | 37 +
CCache/snprintf.c | 962 ++++++++++++++
CCache/stats.c | 361 +++++
CCache/test.sh | 452 +++++++
CCache/unify.c | 307 +++++
CCache/util.c | 884 +++++++++++++
CCache/web/index.html | 158 +++
CHANGES | 508 ++++++-
CHANGES.current | 122 +-
Doc/Manual/Allegrocl.html | 112 +-
Doc/Manual/Arguments.html | 2 +-
Doc/Manual/CSharp.html | 374 +++++-
Doc/Manual/Contents.html | 73 +-
Doc/Manual/Customization.html | 14 +
Doc/Manual/Extending.html | 9 +-
Doc/Manual/Introduction.html | 3 +-
Doc/Manual/Java.html | 45 +-
Doc/Manual/Library.html | 6 +-
Doc/Manual/Lisp.html | 4 +-
Doc/Manual/Lua.html | 312 ++++-
Doc/Manual/Makefile | 13 +-
Doc/Manual/Modula3.html | 8 +-
Doc/Manual/Modules.html | 133 +-
Doc/Manual/Ocaml.html | 4 +-
Doc/Manual/Perl5.html | 4 +-
Doc/Manual/Php.html | 22 +-
Doc/Manual/Preprocessor.html | 11 +-
Doc/Manual/Python.html | 270 +++-
Doc/Manual/Ruby.html | 4 +-
Doc/Manual/SWIG.html | 58 +-
Doc/Manual/Sections.html | 3 +-
Doc/Manual/Tcl.html | 4 +-
Doc/Manual/Typemaps.html | 62 +-
Doc/Manual/Warnings.html | 2 +-
Doc/Manual/Windows.html | 2 +-
Doc/Manual/chapters | 1 +
Doc/Manual/swig16.png | Bin
Doc/README | 3 +-
Examples/GIFPlot/Java/full/README | 6 +-
Examples/GIFPlot/Java/full/main.java | 75 --
Examples/GIFPlot/Java/full/runme.java | 75 ++
Examples/GIFPlot/Java/shadow/Makefile | 5 +-
Examples/GIFPlot/Java/shadow/README | 4 +-
Examples/GIFPlot/Java/shadow/main.java | 76 --
Examples/GIFPlot/Java/shadow/runme.java | 76 ++
Examples/GIFPlot/Java/simple/README | 2 +-
Examples/GIFPlot/Java/simple/main.java | 41 -
Examples/GIFPlot/Java/simple/runme.java | 41 +
Examples/GIFPlot/Lib/color.c | 5 +-
Examples/GIFPlot/Lib/gif.c | 8 +-
Examples/GIFPlot/Perl5/shadow/Makefile | 7 +-
Examples/GIFPlot/Php/check.list | 3 +
Examples/GIFPlot/Php/full/Makefile | 20 +
Examples/GIFPlot/Php/full/README | 4 +
Examples/GIFPlot/Php/full/cmap | Bin 0 -> 768 bytes
Examples/GIFPlot/Php/full/gifplot.i | 15 +
Examples/GIFPlot/Php/full/runme.php | 78 ++
Examples/GIFPlot/Php/shadow/Makefile | 19 +
Examples/GIFPlot/Php/shadow/README | 2 +
Examples/GIFPlot/Php/shadow/cmap | Bin 0 -> 768 bytes
Examples/GIFPlot/Php/shadow/runme.php | 79 ++
Examples/GIFPlot/Php/simple/Makefile | 20 +
Examples/GIFPlot/Php/simple/README | 5 +
Examples/GIFPlot/Php/simple/runme.php | 32 +
Examples/GIFPlot/Php/simple/simple.i | 38 +
Examples/GIFPlot/Php4/check.list | 3 -
Examples/GIFPlot/Php4/full/Makefile | 20 -
Examples/GIFPlot/Php4/full/README | 4 -
Examples/GIFPlot/Php4/full/cmap | Bin 768 -> 0 bytes
Examples/GIFPlot/Php4/full/gifplot.i | 15 -
Examples/GIFPlot/Php4/full/runme.php4 | 78 --
Examples/GIFPlot/Php4/shadow/Makefile | 19 -
Examples/GIFPlot/Php4/shadow/README | 2 -
Examples/GIFPlot/Php4/shadow/cmap | Bin 768 -> 0 bytes
Examples/GIFPlot/Php4/shadow/runme.php4 | 79 --
Examples/GIFPlot/Php4/simple/Makefile | 20 -
Examples/GIFPlot/Php4/simple/README | 5 -
Examples/GIFPlot/Php4/simple/runme.php4 | 32 -
Examples/GIFPlot/Php4/simple/simple.i | 38 -
Examples/GIFPlot/Python/full/Makefile | 3 +-
Examples/GIFPlot/Python/shadow/Makefile | 10 +-
Examples/GIFPlot/Python/simple/Makefile | 3 +-
Examples/GIFPlot/Ruby/shadow/Makefile | 7 +-
Examples/Makefile.in | 252 ++--
Examples/csharp/arrays/Makefile | 20 +
Examples/csharp/arrays/example.c | 22 +
Examples/csharp/arrays/example.h | 4 +
Examples/csharp/arrays/example.i | 45 +
Examples/csharp/arrays/runme.cs | 43 +
Examples/csharp/check.list | 1 +
Examples/guile/matrix/matrix.scm | 0
Examples/java/callback/main.java | 56 -
Examples/java/callback/runme.java | 56 +
Examples/java/class/index.html | 2 +-
Examples/java/class/main.java | 70 -
Examples/java/class/runme.java | 70 +
Examples/java/constants/index.html | 2 +-
Examples/java/constants/main.java | 44 -
Examples/java/constants/runme.java | 44 +
Examples/java/enum/index.html | 2 +-
Examples/java/enum/main.java | 38 -
Examples/java/enum/runme.java | 38 +
Examples/java/extend/main.java | 88 --
Examples/java/extend/runme.java | 88 ++
Examples/java/funcptr/index.html | 2 +-
Examples/java/funcptr/main.java | 33 -
Examples/java/funcptr/runme.java | 33 +
Examples/java/index.html | 4 +-
Examples/java/multimap/main.java | 40 -
Examples/java/multimap/runme.java | 40 +
Examples/java/native/index.html | 2 +-
Examples/java/native/main.java | 19 -
Examples/java/native/runme.java | 19 +
Examples/java/pointer/index.html | 2 +-
Examples/java/pointer/main.java | 55 -
Examples/java/pointer/runme.java | 55 +
Examples/java/reference/index.html | 2 +-
Examples/java/reference/main.java | 79 --
Examples/java/reference/runme.java | 79 ++
Examples/java/simple/index.html | 8 +-
Examples/java/simple/main.java | 32 -
Examples/java/simple/runme.java | 32 +
Examples/java/template/index.html | 2 +-
Examples/java/template/main.java | 45 -
Examples/java/template/runme.java | 45 +
Examples/java/typemap/index.html | 2 +-
Examples/java/typemap/main.java | 26 -
Examples/java/typemap/runme.java | 26 +
Examples/java/variables/index.html | 2 +-
Examples/java/variables/main.java | 97 --
Examples/java/variables/runme.java | 97 ++
Examples/lua/embed3/embed3.cpp | 7 +-
Examples/perl5/class/example.dsp | 4 +-
Examples/perl5/import/bar.dsp | 4 +-
Examples/perl5/import/base.dsp | 4 +-
Examples/perl5/import/foo.dsp | 4 +-
Examples/perl5/import/spam.dsp | 4 +-
Examples/perl5/multimap/example.dsp | 4 +-
Examples/perl5/simple/example.dsp | 4 +-
Examples/php/check.list | 17 +
Examples/php/class/Makefile | 24 +
Examples/php/class/example.cxx | 39 +
Examples/php/class/example.h | 38 +
Examples/php/class/example.i | 10 +
Examples/php/class/runme.php | 64 +
Examples/php/constants/Makefile | 24 +
Examples/php/constants/example.i | 26 +
Examples/php/constants/runme.php | 28 +
Examples/php/cpointer/Makefile | 24 +
Examples/php/cpointer/example.c | 16 +
Examples/php/cpointer/example.i | 26 +
Examples/php/cpointer/runme.php | 45 +
Examples/php/disown/Makefile | 24 +
Examples/php/disown/example.cxx | 51 +
Examples/php/disown/example.h | 50 +
Examples/php/disown/example.i | 12 +
Examples/php/disown/runme.php | 49 +
Examples/php/enum/Makefile | 24 +
Examples/php/enum/example.cxx | 37 +
Examples/php/enum/example.h | 13 +
Examples/php/enum/example.i | 12 +
Examples/php/enum/runme.php | 32 +
Examples/php/funcptr/Makefile | 24 +
Examples/php/funcptr/example.c | 17 +
Examples/php/funcptr/example.h | 7 +
Examples/php/funcptr/example.i | 15 +
Examples/php/funcptr/runme.php | 24 +
Examples/php/overloading/Makefile | 24 +
Examples/php/overloading/example.cxx | 55 +
Examples/php/overloading/example.h | 46 +
Examples/php/overloading/example.i | 8 +
Examples/php/overloading/runme.php | 59 +
Examples/php/pointer/Makefile | 24 +
Examples/php/pointer/example.c | 16 +
Examples/php/pointer/example.i | 24 +
Examples/php/pointer/runme.php | 35 +
Examples/php/pragmas/Makefile | 24 +
Examples/php/pragmas/example.i | 31 +
Examples/php/pragmas/include.php | 7 +
Examples/php/pragmas/runme.php | 5 +
Examples/php/proxy/Makefile | 24 +
Examples/php/proxy/example.cxx | 43 +
Examples/php/proxy/example.h | 43 +
Examples/php/proxy/example.i | 12 +
Examples/php/proxy/runme.php | 68 +
Examples/php/reference/Makefile | 24 +
Examples/php/reference/example.cxx | 50 +
Examples/php/reference/example.h | 26 +
Examples/php/reference/example.i | 44 +
Examples/php/reference/runme-proxy.php4 | 79 ++
Examples/php/reference/runme.php | 78 ++
Examples/php/simple/Makefile | 24 +
Examples/php/simple/example.c | 23 +
Examples/php/simple/example.i | 10 +
Examples/php/simple/runme.php | 25 +
Examples/php/sync/Makefile | 24 +
Examples/php/sync/example.cxx | 13 +
Examples/php/sync/example.h | 9 +
Examples/php/sync/example.i | 7 +
Examples/php/sync/runme.php | 15 +
Examples/php/value/Makefile | 24 +
Examples/php/value/example.c | 13 +
Examples/php/value/example.h | 8 +
Examples/php/value/example.i | 17 +
Examples/php/value/runme.php | 43 +
Examples/php/variables/Makefile | 24 +
Examples/php/variables/example.c | 95 ++
Examples/php/variables/example.h | 34 +
Examples/php/variables/example.i | 44 +
Examples/php/variables/runme.php | 96 ++
Examples/php/variables/runme.php4.old | 80 ++
Examples/php4/check.list | 17 -
Examples/php4/class/Makefile | 24 -
Examples/php4/class/example.cxx | 39 -
Examples/php4/class/example.h | 38 -
Examples/php4/class/example.i | 10 -
Examples/php4/class/runme.php4 | 64 -
Examples/php4/constants/Makefile | 24 -
Examples/php4/constants/example.i | 26 -
Examples/php4/constants/runme.php4 | 28 -
Examples/php4/cpointer/Makefile | 24 -
Examples/php4/cpointer/example.c | 16 -
Examples/php4/cpointer/example.i | 26 -
Examples/php4/cpointer/runme.php4 | 45 -
Examples/php4/disown/Makefile | 24 -
Examples/php4/disown/example.cxx | 51 -
Examples/php4/disown/example.h | 50 -
Examples/php4/disown/example.i | 12 -
Examples/php4/disown/runme.php4 | 49 -
Examples/php4/enum/Makefile | 24 -
Examples/php4/enum/example.cxx | 37 -
Examples/php4/enum/example.h | 13 -
Examples/php4/enum/example.i | 12 -
Examples/php4/enum/runme.php4 | 32 -
Examples/php4/funcptr/Makefile | 24 -
Examples/php4/funcptr/example.c | 17 -
Examples/php4/funcptr/example.h | 7 -
Examples/php4/funcptr/example.i | 15 -
Examples/php4/funcptr/runme.php4 | 24 -
Examples/php4/overloading/Makefile | 24 -
Examples/php4/overloading/example.cxx | 55 -
Examples/php4/overloading/example.h | 46 -
Examples/php4/overloading/example.i | 8 -
Examples/php4/overloading/runme.php4 | 59 -
Examples/php4/pointer/Makefile | 24 -
Examples/php4/pointer/example.c | 16 -
Examples/php4/pointer/example.i | 24 -
Examples/php4/pointer/runme.php4 | 35 -
Examples/php4/pragmas/Makefile | 24 -
Examples/php4/pragmas/example.i | 31 -
Examples/php4/pragmas/include.php | 7 -
Examples/php4/pragmas/runme.php4 | 5 -
Examples/php4/proxy/Makefile | 24 -
Examples/php4/proxy/example.cxx | 43 -
Examples/php4/proxy/example.h | 43 -
Examples/php4/proxy/example.i | 12 -
Examples/php4/proxy/runme.php4 | 68 -
Examples/php4/reference/Makefile | 24 -
Examples/php4/reference/example.cxx | 50 -
Examples/php4/reference/example.h | 26 -
Examples/php4/reference/example.i | 44 -
Examples/php4/reference/runme-proxy.php4 | 79 --
Examples/php4/reference/runme.php4 | 78 --
Examples/php4/simple/Makefile | 24 -
Examples/php4/simple/example.c | 23 -
Examples/php4/simple/example.i | 10 -
Examples/php4/simple/runme.php4 | 25 -
Examples/php4/sync/Makefile | 24 -
Examples/php4/sync/example.cxx | 13 -
Examples/php4/sync/example.h | 9 -
Examples/php4/sync/example.i | 7 -
Examples/php4/sync/runme.php4 | 15 -
Examples/php4/value/Makefile | 24 -
Examples/php4/value/example.c | 13 -
Examples/php4/value/example.h | 8 -
Examples/php4/value/example.i | 17 -
Examples/php4/value/runme.php4 | 43 -
Examples/php4/variables/Makefile | 24 -
Examples/php4/variables/example.c | 95 --
Examples/php4/variables/example.h | 34 -
Examples/php4/variables/example.i | 44 -
Examples/php4/variables/runme.php4 | 96 --
Examples/php4/variables/runme.php4.old | 80 --
Examples/pike/class/Makefile | 0
Examples/pike/class/example.cxx | 0
Examples/pike/class/example.h | 0
Examples/pike/class/example.i | 0
Examples/pike/constants/Makefile | 0
Examples/pike/constants/example.i | 0
Examples/pike/overload/example.cxx | 0
Examples/pike/overload/example.h | 0
Examples/pike/template/Makefile | 0
Examples/pike/template/example.h | 0
Examples/pike/template/example.i | 0
Examples/python/callback/Makefile | 1 +
Examples/python/callback/runme.py | 2 -
Examples/python/class/Makefile | 1 +
Examples/python/class/example.dsp | 4 +-
Examples/python/constants/Makefile | 1 +
Examples/python/contract/Makefile | 1 +
Examples/python/contract/example.dsp | 4 +-
Examples/python/docstrings/Makefile | 1 +
Examples/python/enum/Makefile | 1 +
Examples/python/exception/Makefile | 1 +
Examples/python/exceptproxy/Makefile | 1 +
Examples/python/extend/Makefile | 1 +
Examples/python/funcptr/Makefile | 1 +
Examples/python/funcptr2/Makefile | 1 +
Examples/python/functor/Makefile | 1 +
Examples/python/import/Makefile | 1 +
Examples/python/import/bar.dsp | 4 +-
Examples/python/import/base.dsp | 4 +-
Examples/python/import/foo.dsp | 4 +-
Examples/python/import/spam.dsp | 4 +-
Examples/python/import_template/Makefile | 1 +
Examples/python/libffi/Makefile | 1 +
Examples/python/multimap/Makefile | 1 +
Examples/python/multimap/example.dsp | 4 +-
Examples/python/multimap/example.i | 34 +-
Examples/python/operator/Makefile | 1 +
Examples/python/pointer/Makefile | 1 +
Examples/python/reference/Makefile | 1 +
Examples/python/simple/Makefile | 1 +
Examples/python/simple/example.dsp | 4 +-
Examples/python/smartptr/Makefile | 1 +
Examples/python/std_map/Makefile | 1 +
Examples/python/std_map/example.i | 4 +-
Examples/python/std_vector/Makefile | 1 +
Examples/python/swigrun/Makefile | 1 +
Examples/python/template/Makefile | 1 +
Examples/python/varargs/Makefile | 1 +
Examples/python/variables/Makefile | 1 +
Examples/python/weave/Makefile | 1 +
Examples/r/class/example.dsp | 4 +-
Examples/r/simple/example.dsp | 4 +-
Examples/ruby/class/example.dsp | 4 +-
Examples/ruby/free_function/example.dsp | 4 +-
Examples/ruby/free_function/example.i | 4 +-
Examples/ruby/hashargs/Makefile | 0
Examples/ruby/hashargs/example.i | 0
Examples/ruby/import/bar.dsp | 4 +-
Examples/ruby/import/base.dsp | 4 +-
Examples/ruby/import/foo.dsp | 4 +-
Examples/ruby/import/spam.dsp | 4 +-
Examples/ruby/mark_function/example.dsp | 4 +-
Examples/ruby/multimap/example.dsp | 4 +-
Examples/ruby/simple/example.dsp | 4 +-
Examples/ruby/std_vector/runme.rb | 8 +-
Examples/tcl/class/example.dsp | 4 +-
Examples/tcl/contract/example.dsp | 4 +-
Examples/tcl/import/bar.dsp | 4 +-
Examples/tcl/import/base.dsp | 4 +-
Examples/tcl/import/foo.dsp | 4 +-
Examples/tcl/import/spam.dsp | 4 +-
Examples/tcl/multimap/example.dsp | 4 +-
Examples/tcl/simple/example.dsp | 4 +-
Examples/test-suite/allegrocl/Makefile.in | 114 +-
Examples/test-suite/argcargvtest.i | 23 +
Examples/test-suite/callback.i | 72 +
Examples/test-suite/char_strings.i | 5 +
Examples/test-suite/chicken/Makefile.in | 2 +-
.../test-suite/chicken/chicken_ext_test_runme.ss | 5 +
Examples/test-suite/chicken/ext_test.i | 21 -
Examples/test-suite/chicken/ext_test_runme.ss | 5 -
Examples/test-suite/chicken_ext_test.i | 21 +
Examples/test-suite/common.mk | 26 +-
Examples/test-suite/complextest.i | 61 +
Examples/test-suite/contract.i | 30 +
Examples/test-suite/csharp/Makefile.in | 13 +-
Examples/test-suite/csharp/bools_runme.cs | 0
.../test-suite/csharp/csharp_lib_arrays_runme.cs | 70 +
.../test-suite/csharp/director_classic_runme.cs | 0
Examples/test-suite/csharp/enum_thorough_runme.cs | 41 +-
.../csharp/enum_thorough_simple_runme.cs | 41 +-
.../csharp/enum_thorough_typesafe_runme.cs | 41 +-
.../csharp/inherit_target_language_runme.cs | 24 +
Examples/test-suite/csharp/li_attribute_runme.cs | 78 ++
.../test-suite/csharp/li_boost_shared_ptr_runme.cs | 10 +
Examples/test-suite/csharp/li_std_map_runme.cs | 243 ++++
Examples/test-suite/csharp/li_std_vector_runme.cs | 43 +-
Examples/test-suite/csharp/li_std_wstring_runme.cs | 0
.../csharp/overload_complicated_runme.cs | 0
.../test-suite/csharp/typemap_out_optimal_runme.cs | 13 +
Examples/test-suite/csharp_lib_arrays.i | 61 +
Examples/test-suite/csharp_prepost.i | 101 +-
Examples/test-suite/director_classic.i | 0
Examples/test-suite/director_ignore.i | 0
Examples/test-suite/director_profile.i | 64 +
.../test-suite/director_protected_overloaded.i | 21 +
Examples/test-suite/director_stl.i | 76 ++
Examples/test-suite/director_thread.i | 19 +-
Examples/test-suite/enum_thorough.i | 61 +-
Examples/test-suite/enum_thorough_typesafe.i | 2 +
Examples/test-suite/features.i | 17 +
Examples/test-suite/global_namespace.i | 60 +
Examples/test-suite/guile/Makefile.in | 2 +-
Examples/test-suite/guilescm/Makefile.in | 4 +-
Examples/test-suite/guilescm/ext_test.i | 19 -
Examples/test-suite/guilescm/ext_test_runme.scm | 19 -
.../guilescm/guilescm_ext_test_runme.scm | 19 +
Examples/test-suite/guilescm_ext_test.i | 19 +
Examples/test-suite/iadd.i | 58 +
Examples/test-suite/ignore_template_constructor.i | 6 +
Examples/test-suite/implicittest.i | 68 +
Examples/test-suite/import_nomodule.i | 3 +
Examples/test-suite/imports_b.i | 9 +-
Examples/test-suite/inherit_target_language.i | 10 +
Examples/test-suite/inout.i | 48 +
Examples/test-suite/inplaceadd.i | 40 +
Examples/test-suite/input.i | 41 +
Examples/test-suite/insert_directive.i | 38 +
Examples/test-suite/intermediary_classname.i | 1 +
Examples/test-suite/java/Makefile.in | 4 +-
Examples/test-suite/java/allprotected_runme.java | 0
.../test-suite/java/director_classic_runme.java | 0
.../test-suite/java/director_ignore_runme.java | 0
.../java/enum_thorough_proper_runme.java | 41 +-
Examples/test-suite/java/enum_thorough_runme.java | 41 +-
.../java/enum_thorough_simple_runme.java | 41 +-
.../java/enum_thorough_typeunsafe_runme.java | 41 +-
.../test-suite/java/global_namespace_runme.java | 25 +
.../java/inherit_target_language_runme.java | 9 +
Examples/test-suite/java/java_throws_runme.java | 15 +
.../java/li_boost_intrusive_ptr_runme.java | 701 ++++++++++
.../test-suite/java/li_boost_shared_ptr_runme.java | 10 +
.../java/overload_complicated_runme.java | 0
.../test-suite/java/typemap_out_optimal_runme.java | 21 +
Examples/test-suite/java_throws.i | 38 +
Examples/test-suite/li_attribute.i | 31 +
Examples/test-suite/li_boost_intrusive_ptr.i | 494 +++++++
Examples/test-suite/li_boost_shared_ptr.i | 38 +-
Examples/test-suite/li_cstring.i | 8 +-
Examples/test-suite/li_cwstring.i | 8 +-
Examples/test-suite/li_std_carray.i | 8 +
Examples/test-suite/li_std_functors.i | 18 +
Examples/test-suite/li_std_list.i | 46 +
Examples/test-suite/li_std_map.i | 139 +-
Examples/test-suite/li_std_multimap.i | 25 +
Examples/test-suite/li_std_pair_extra.i | 210 +++
Examples/test-suite/li_std_pair_lang_object.i | 8 +
Examples/test-suite/li_std_queue.i | 16 +
Examples/test-suite/li_std_set.i | 8 +-
Examples/test-suite/li_std_stack.i | 16 +
Examples/test-suite/li_std_string_extra.i | 55 +
Examples/test-suite/li_std_vector.i | 2 +
Examples/test-suite/li_std_vector_extra.i | 147 +++
Examples/test-suite/li_std_vector_ptr.i | 29 +
Examples/test-suite/li_std_vectora.i | 65 +
Examples/test-suite/li_std_wstream.i | 59 +
Examples/test-suite/name_warnings.i | 3 +-
Examples/test-suite/namespace_typemap.i | 2 +-
Examples/test-suite/nested_comment.i | 27 +-
Examples/test-suite/nested_structs.i | 22 +
Examples/test-suite/ocaml/Makefile.in | 2 +-
Examples/test-suite/octave/Makefile.in | 4 +-
Examples/test-suite/octave/cell_deref.i | 15 -
Examples/test-suite/octave/cell_deref_runme.m | 8 -
Examples/test-suite/octave/implicittest.i | 68 -
Examples/test-suite/octave/li_attribute_runme.m | 38 +-
Examples/test-suite/octave/li_std_map_runme.m | 2 +-
Examples/test-suite/octave/li_std_pair.i | 210 ---
.../test-suite/octave/li_std_pair_extra_runme.m | 69 +
Examples/test-suite/octave/li_std_pair_runme.m | 69 -
Examples/test-suite/octave/li_std_string.i | 55 -
.../test-suite/octave/li_std_string_extra_runme.m | 162 +++
Examples/test-suite/octave/li_std_string_runme.m | 162 ---
.../test-suite/octave/octave_cell_deref_runme.m | 8 +
Examples/test-suite/octave_cell_deref.i | 15 +
Examples/test-suite/operator_overload.i | 6 +
Examples/test-suite/operbool.i | 12 +
Examples/test-suite/packageoption.h | 9 +-
Examples/test-suite/packageoption.list | 1 +
Examples/test-suite/packageoption_a.i | 8 +-
Examples/test-suite/packageoption_b.i | 2 +-
Examples/test-suite/packageoption_c.i | 13 +
Examples/test-suite/perl5/Makefile.in | 1 +
Examples/test-suite/perl5/byreference.i | 52 +
Examples/test-suite/perl5/byreference_runme.pl | 36 +
Examples/test-suite/perl5/char_strings_runme.pl | 5 +-
Examples/test-suite/perl5/enum_thorough_runme.pl | 54 +-
Examples/test-suite/perl5/imports_runme.pl | 2 +-
Examples/test-suite/perl5/li_std_list.i | 46 -
Examples/test-suite/perl5/packageoption_runme.pl | 8 +-
Examples/test-suite/php/Makefile.in | 56 +
.../test-suite/php/abstract_inherit_ok_runme.php | 12 +
Examples/test-suite/php/abstract_inherit_runme.php | 14 +
Examples/test-suite/php/add_link_runme.php | 23 +
Examples/test-suite/php/argout_runme.php | 37 +
Examples/test-suite/php/arrayptr_runme.php | 15 +
Examples/test-suite/php/arrays_global_runme.php | 20 +
.../test-suite/php/arrays_global_twodim_runme.php | 23 +
Examples/test-suite/php/arrays_runme.php | 19 +
Examples/test-suite/php/arrays_scope_runme.php | 17 +
Examples/test-suite/php/casts_runme.php | 19 +
Examples/test-suite/php/class_ignore_runme.php | 17 +
.../test-suite/php/conversion_namespace_runme.php | 14 +
.../php/conversion_ns_template_runme.php | 10 +
Examples/test-suite/php/conversion_runme.php | 14 +
Examples/test-suite/php/cpp_static_runme.php | 15 +
.../test-suite/php/enum_scope_template_runme.php | 17 +
Examples/test-suite/php/evil_diamond_ns_runme.php | 19 +
.../test-suite/php/evil_diamond_prop_runme.php | 38 +
Examples/test-suite/php/evil_diamond_runme.php | 17 +
.../test-suite/php/extend_template_ns_runme.php | 13 +
Examples/test-suite/php/extend_template_runme.php | 13 +
Examples/test-suite/php/grouping_runme.php | 23 +
Examples/test-suite/php/ignore_parameter_runme.php | 39 +
Examples/test-suite/php/li_carrays_runme.php | 15 +
Examples/test-suite/php/li_std_string_runme.php | 32 +
Examples/test-suite/php/rename_scope_runme.php | 17 +
Examples/test-suite/php/skel.php | 15 +
.../test-suite/php/smart_pointer_rename_runme.php | 28 +
Examples/test-suite/php/sym_runme.php | 23 +
.../test-suite/php/template_arg_typename_runme.php | 19 +
.../test-suite/php/template_construct_runme.php | 11 +
Examples/test-suite/php/tests.php | 227 ++++
.../test-suite/php/typedef_reference_runme.php | 13 +
Examples/test-suite/php/typemap_ns_using_runme.php | 9 +
Examples/test-suite/php/using1_runme.php | 9 +
Examples/test-suite/php/using2_runme.php | 9 +
.../test-suite/php/valuewrapper_base_runme.php | 14 +
Examples/test-suite/php4/Makefile.in | 69 -
.../test-suite/php4/abstract_inherit_ok_runme.php4 | 12 -
.../test-suite/php4/abstract_inherit_runme.php4 | 14 -
Examples/test-suite/php4/add_link_runme.php4 | 23 -
Examples/test-suite/php4/argout_runme.php4 | 37 -
Examples/test-suite/php4/arrayptr_runme.php4 | 15 -
Examples/test-suite/php4/arrays_global_runme.php4 | 14 -
.../php4/arrays_global_twodim_runme.php4 | 23 -
Examples/test-suite/php4/arrays_runme.php4 | 19 -
Examples/test-suite/php4/arrays_scope_runme.php4 | 17 -
Examples/test-suite/php4/casts_runme.php4 | 19 -
Examples/test-suite/php4/class_ignore_runme.php4 | 17 -
.../php4/conversion_namespace_runme.php4 | 14 -
.../php4/conversion_ns_template_runme.php4 | 10 -
Examples/test-suite/php4/conversion_runme.php4 | 14 -
Examples/test-suite/php4/cpp_static_runme.php4 | 15 -
.../test-suite/php4/enum_scope_template_runme.php4 | 17 -
.../test-suite/php4/evil_diamond_ns_runme.php4 | 19 -
.../test-suite/php4/evil_diamond_prop_runme.php4 | 38 -
Examples/test-suite/php4/evil_diamond_runme.php4 | 17 -
.../test-suite/php4/extend_template_ns_runme.php4 | 13 -
.../test-suite/php4/extend_template_runme.php4 | 13 -
Examples/test-suite/php4/grouping_runme.php4 | 23 -
.../test-suite/php4/ignore_parameter_runme.php4 | 39 -
Examples/test-suite/php4/li_carrays_runme.php4 | 15 -
Examples/test-suite/php4/li_std_string_runme.php4 | 32 -
Examples/test-suite/php4/namewarn_rename.i | 20 -
Examples/test-suite/php4/rename_scope_runme.php4 | 17 -
Examples/test-suite/php4/skel.php4 | 15 -
.../php4/smart_pointer_rename_runme.php4 | 28 -
Examples/test-suite/php4/sym_runme.php4 | 23 -
.../php4/template_arg_typename_runme.php4 | 19 -
.../test-suite/php4/template_construct_runme.php4 | 11 -
Examples/test-suite/php4/tests.php4 | 227 ----
.../test-suite/php4/typedef_reference_runme.php4 | 13 -
.../test-suite/php4/typemap_ns_using_runme.php4 | 9 -
Examples/test-suite/php4/using1_runme.php4 | 9 -
Examples/test-suite/php4/using2_runme.php4 | 9 -
.../test-suite/php4/valuewrapper_base_runme.php4 | 14 -
Examples/test-suite/php_namewarn_rename.i | 20 +
Examples/test-suite/preproc.i | 5 +
Examples/test-suite/pure_virtual.i | 4 +-
Examples/test-suite/python/Makefile.in | 84 +-
Examples/test-suite/python/README | 6 +-
Examples/test-suite/python/argcargvtest.i | 23 -
Examples/test-suite/python/autodoc.i | 95 --
Examples/test-suite/python/callback.i | 72 -
Examples/test-suite/python/complextest.i | 61 -
Examples/test-suite/python/contract_runme.py | 8 +
Examples/test-suite/python/cpp_namespace_runme.py | 20 +-
Examples/test-suite/python/cpp_static_runme.py | 7 +
.../test-suite/python/director_classic_runme.py | 68 +-
.../test-suite/python/director_exception_runme.py | 48 +-
Examples/test-suite/python/director_profile.i | 64 -
Examples/test-suite/python/director_stl.i | 76 --
.../test-suite/python/director_thread_runme.py | 2 +
Examples/test-suite/python/file_test_runme.py | 3 +-
Examples/test-suite/python/hugemod.pl | 8 +-
Examples/test-suite/python/iadd.h | 47 -
Examples/test-suite/python/iadd.i | 12 -
Examples/test-suite/python/implicittest.i | 68 -
Examples/test-suite/python/inout.i | 48 -
Examples/test-suite/python/inplaceadd.i | 40 -
Examples/test-suite/python/input.i | 41 -
Examples/test-suite/python/kwargs.i | 112 --
Examples/test-suite/python/kwargs_runme.py | 67 -
Examples/test-suite/python/li_attribute_runme.py | 36 +-
.../test-suite/python/li_boost_shared_ptr_runme.py | 9 +
Examples/test-suite/python/li_std_carray.i | 8 -
Examples/test-suite/python/li_std_map.i | 58 -
Examples/test-suite/python/li_std_map_runme.py | 2 +-
Examples/test-suite/python/li_std_pair.i | 210 ---
.../test-suite/python/li_std_pair_extra_runme.py | 59 +
Examples/test-suite/python/li_std_pair_runme.py | 59 -
Examples/test-suite/python/li_std_set.i | 17 -
Examples/test-suite/python/li_std_stream.i | 59 -
Examples/test-suite/python/li_std_string.i | 55 -
.../test-suite/python/li_std_string_extra_runme.py | 132 ++
Examples/test-suite/python/li_std_string_runme.py | 132 --
Examples/test-suite/python/li_std_vector.i | 141 --
.../test-suite/python/li_std_vector_extra_runme.py | 156 +++
.../test-suite/python/li_std_vector_ptr_runme.py | 8 +
Examples/test-suite/python/li_std_vector_runme.py | 135 --
Examples/test-suite/python/li_std_vectora.i | 65 -
Examples/test-suite/python/li_std_wstream.i | 59 -
Examples/test-suite/python/li_std_wstring.i | 89 --
Examples/test-suite/python/nondynamic.i | 58 -
Examples/test-suite/python/nondynamic_runme.py | 39 -
Examples/test-suite/python/operbool_runme.py | 4 +
Examples/test-suite/python/overload_simple_cast.i | 4 -
.../python/overload_simple_cast_runme.py | 192 ---
.../python/python_abstractbase_runme3.py | 8 +
Examples/test-suite/python/python_append_runme.py | 4 +
Examples/test-suite/python/python_kwargs_runme.py | 67 +
.../test-suite/python/python_nondynamic_runme.py | 39 +
.../python/python_overload_simple_cast_runme.py | 192 +++
Examples/test-suite/python/python_pybuf_runme3.py | 42 +
.../python/rename_strip_encoder_runme.py | 6 +
Examples/test-suite/python/simutry.i | 98 --
Examples/test-suite/python/std_containers.i | 199 ---
Examples/test-suite/python/swigobject.i | 25 -
Examples/test-suite/python/swigobject_runme.py | 10 +-
.../python/tag_no_clash_with_variable_runme.i | 3 -
Examples/test-suite/python/template_matrix.i | 71 -
.../python/template_typedef_cplx2_runme.py | 13 +-
.../python/template_typedef_cplx_runme.py | 13 +-
.../test-suite/python/typemap_out_optimal_runme.py | 5 +
Examples/test-suite/python/vector.i | 51 -
Examples/test-suite/python_abstractbase.i | 18 +
Examples/test-suite/python_append.i | 32 +
Examples/test-suite/python_autodoc.i | 95 ++
Examples/test-suite/python_kwargs.i | 112 ++
Examples/test-suite/python_nondynamic.i | 58 +
Examples/test-suite/python_overload_simple_cast.i | 4 +
Examples/test-suite/python_pybuf.i | 64 +
Examples/test-suite/r/Makefile.in | 4 +-
Examples/test-suite/r/arrays_dimensionless_runme.R | 20 +
Examples/test-suite/r/copy_struct.i | 93 --
Examples/test-suite/r/copy_struct_runme.R | 57 -
Examples/test-suite/r/double_delete.i | 15 -
Examples/test-suite/r/double_delete_runme.R | 12 -
Examples/test-suite/r/integers_runme.R | 20 +
Examples/test-suite/r/legacy.i | 98 --
Examples/test-suite/r/legacy_runme.R | 30 -
Examples/test-suite/r/r_copy_struct_runme.R | 58 +
Examples/test-suite/r/r_double_delete_runme.R | 9 +
Examples/test-suite/r/r_legacy_runme.R | 30 +
Examples/test-suite/r/simple_array.i | 42 -
Examples/test-suite/r_copy_struct.i | 93 ++
Examples/test-suite/r_double_delete.i | 14 +
Examples/test-suite/r_legacy.i | 98 ++
Examples/test-suite/rename_strip_encoder.i | 16 +
Examples/test-suite/ruby/Makefile.in | 15 +-
Examples/test-suite/ruby/keywords.i | 65 -
Examples/test-suite/ruby/keywords_runme.rb | 159 ---
Examples/test-suite/ruby/li_std_functors.i | 18 -
Examples/test-suite/ruby/li_std_map_runme.rb | 13 +-
Examples/test-suite/ruby/li_std_multimap_runme.rb | 27 +
Examples/test-suite/ruby/li_std_pair_lang_object.i | 8 -
Examples/test-suite/ruby/li_std_queue.i | 16 -
Examples/test-suite/ruby/li_std_speed.i | 26 -
Examples/test-suite/ruby/li_std_speed_runme.rb | 85 --
Examples/test-suite/ruby/li_std_stack.i | 16 -
Examples/test-suite/ruby/naming.i | 107 --
Examples/test-suite/ruby/naming_runme.rb | 115 --
Examples/test-suite/ruby/ruby_keywords_runme.rb | 159 +++
.../test-suite/ruby/ruby_li_std_speed_runme.rb | 85 ++
Examples/test-suite/ruby/ruby_naming_runme.rb | 115 ++
.../ruby/ruby_track_objects_directors_runme.rb | 39 +
.../test-suite/ruby/ruby_track_objects_runme.rb | 117 ++
Examples/test-suite/ruby/stl_new.i | 29 -
Examples/test-suite/ruby/track_objects.i | 125 --
Examples/test-suite/ruby/track_objects_directors.i | 44 -
.../ruby/track_objects_directors_runme.rb | 39 -
Examples/test-suite/ruby/track_objects_runme.rb | 117 --
Examples/test-suite/ruby_keywords.i | 65 +
Examples/test-suite/ruby_li_std_speed.i | 26 +
Examples/test-suite/ruby_naming.i | 107 ++
Examples/test-suite/ruby_track_objects.i | 125 ++
Examples/test-suite/ruby_track_objects_directors.i | 44 +
Examples/test-suite/simple_array.i | 42 +
Examples/test-suite/simutry.i | 98 ++
Examples/test-suite/stl_new.i | 29 +
Examples/test-suite/swig_examples_lock.h | 17 +-
Examples/test-suite/swigobject.i | 25 +
Examples/test-suite/tcl/Makefile.in | 5 +-
Examples/test-suite/tcl/union.i | 41 -
Examples/test-suite/tcl/union_parameter_runme.tcl | 36 +
Examples/test-suite/tcl/union_runme.tcl | 36 -
Examples/test-suite/template_inherit_abstract.i | 2 +-
Examples/test-suite/template_matrix.i | 71 +
Examples/test-suite/template_typedef_funcptr.i | 5 +
Examples/test-suite/typemap_namespace.i | 2 +-
Examples/test-suite/typemap_out_optimal.i | 38 +
Examples/test-suite/typemap_subst.i | 8 +
Examples/test-suite/types_directive.i | 8 +
Examples/test-suite/union_parameter.i | 41 +
Lib/allegrocl/allegrocl.swg | 121 +-
Lib/allegrocl/inout_typemaps.i | 0
Lib/allegrocl/longlongs.i | 0
Lib/allegrocl/std_list.i | 0
Lib/allegrocl/std_string.i | 0
Lib/allkw.swg | 2 +-
Lib/csharp/arrays_csharp.i | 140 ++
Lib/csharp/boost_shared_ptr.i | 22 +-
Lib/csharp/csharp.swg | 35 +-
Lib/csharp/csharphead.swg | 2 +-
Lib/csharp/std_map.i | 753 ++++++++---
Lib/csharp/std_vector.i | 148 ++-
Lib/csharp/std_wstring.i | 0
Lib/csharp/typemaps.i | 4 +
Lib/csharp/wchar.i | 0
Lib/intrusive_ptr.i | 95 ++
Lib/java/boost_intrusive_ptr.i | 460 +++++++
Lib/java/boost_shared_ptr.i | 22 +-
Lib/java/java.swg | 31 +-
Lib/java/javahead.swg | 5 +-
Lib/java/std_vector.i | 34 +
Lib/lua/luatypemaps.swg | 25 +-
Lib/ocaml/std_deque.i | 2 +-
Lib/octave/carrays.i | 2 +-
Lib/octave/octcontainer.swg | 10 +-
Lib/octave/octopers.swg | 116 +-
Lib/octave/octrun.swg | 117 +-
Lib/octave/octruntime.swg | 1 +
Lib/octave/octstdcommon.swg | 2 +-
Lib/octave/std_basic_string.i | 38 +-
Lib/octave/std_carray.i | 6 +-
Lib/octave/std_map.i | 14 +-
Lib/perl5/noembed.h | 6 +
Lib/perl5/perlrun.swg | 25 +-
Lib/perl5/perlstrings.swg | 5 +
Lib/perl5/perltypemaps.swg | 1 +
Lib/perl5/reference.i | 31 +-
Lib/perl5/std_vector.i | 4 +-
Lib/php/globalvar.i | 2 +-
Lib/php/php.swg | 30 +-
Lib/php/phprun.swg | 8 +-
Lib/php/typemaps.i | 75 +-
Lib/php/utils.i | 8 +-
Lib/python/boost_shared_ptr.i | 14 +-
Lib/python/director.swg | 11 +-
Lib/python/embed.i | 4 +-
Lib/python/embed15.i | 2 +-
Lib/python/file.i | 4 +-
Lib/python/pyabc.i | 10 +
Lib/python/pyapi.swg | 14 +
Lib/python/pybuffer.i | 107 ++
Lib/python/pyclasses.swg | 62 +-
Lib/python/pycomplex.swg | 8 +-
Lib/python/pycontainer.swg | 219 +--
Lib/python/pyerrors.swg | 7 +-
Lib/python/pyhead.swg | 64 +-
Lib/python/pyinit.swg | 80 +-
Lib/python/pyiterators.swg | 180 +--
Lib/python/pyname_compat.i | 88 ++
Lib/python/pyopers.swg | 8 +-
Lib/python/pyrun.swg | 424 +++---
Lib/python/pystdcommon.swg | 2 +-
Lib/python/pystrings.swg | 34 +-
Lib/python/pytypemaps.swg | 2 +-
Lib/python/pywstrings.swg | 4 +-
Lib/python/std_carray.i | 6 +-
Lib/python/std_map.i | 48 +-
Lib/python/std_multimap.i | 14 +-
Lib/python/std_multiset.i | 12 +-
Lib/python/std_pair.i | 8 +-
Lib/python/std_set.i | 12 +-
Lib/r/r.swg | 82 +-
Lib/r/rrun.swg | 2 -
Lib/r/rstdcommon.swg | 2 +-
Lib/r/rtype.swg | 101 +-
Lib/ruby/file.i | 7 +
Lib/ruby/rubyhead.swg | 3 +
Lib/ruby/rubywstrings.swg | 2 +-
Lib/shared_ptr.i | 12 +-
Lib/swig.swg | 66 +-
Lib/swigrun.swg | 98 +-
Lib/typemaps/attribute.swg | 87 +-
Lib/typemaps/swigtype.swg | 20 +-
Makefile.in | 119 +-
README | 23 +-
Source/CParse/cparse.h | 8 +-
Source/CParse/cscanner.c | 43 +-
Source/CParse/parser.y | 141 +-
Source/CParse/templ.c | 2 +-
Source/DOH/README | 12 +-
Source/DOH/base.c | 4 +-
Source/DOH/doh.h | 15 +-
Source/DOH/file.c | 11 +-
Source/DOH/hash.c | 2 +-
Source/DOH/list.c | 2 +-
Source/DOH/string.c | 2 +-
Source/Include/swigwarn.h | 5 +-
Source/Modules/allegrocl.cxx | 394 ++++--
Source/Modules/cffi.cxx | 51 +-
Source/Modules/chicken.cxx | 41 +-
Source/Modules/clisp.cxx | 13 +-
Source/Modules/contract.cxx | 8 +
Source/Modules/csharp.cxx | 108 +-
Source/Modules/directors.cxx | 4 +-
Source/Modules/guile.cxx | 41 +-
Source/Modules/java.cxx | 61 +-
Source/Modules/lang.cxx | 79 +-
Source/Modules/lua.cxx | 30 +-
Source/Modules/main.cxx | 200 +--
Source/Modules/modula3.cxx | 50 +-
Source/Modules/mzscheme.cxx | 24 +-
Source/Modules/ocaml.cxx | 35 +-
Source/Modules/octave.cxx | 47 +-
Source/Modules/overload.cxx | 8 +-
Source/Modules/perl5.cxx | 143 +-
Source/Modules/php.cxx | 130 +-
Source/Modules/pike.cxx | 28 +-
Source/Modules/python.cxx | 687 +++++++---
Source/Modules/r.cxx | 36 +-
Source/Modules/ruby.cxx | 93 +-
Source/Modules/s-exp.cxx | 12 +-
Source/Modules/swigmain.cxx | 6 +-
Source/Modules/swigmod.h | 21 +-
Source/Modules/tcl8.cxx | 30 +-
Source/Modules/typepass.cxx | 58 +-
Source/Modules/uffi.cxx | 25 +-
Source/Modules/xml.cxx | 6 +-
Source/Preprocessor/cpp.c | 35 +-
Source/Preprocessor/preprocessor.h | 4 +-
Source/README | 9 +-
Source/Swig/cwrap.c | 53 +-
Source/Swig/error.c | 10 +-
Source/Swig/getopt.c | 2 +-
Source/Swig/include.c | 57 +-
Source/Swig/misc.c | 95 +-
Source/Swig/naming.c | 32 +-
Source/Swig/parms.c | 2 +-
Source/Swig/scanner.c | 25 +-
Source/Swig/stype.c | 8 +-
Source/Swig/swig.h | 137 +-
Source/Swig/swigfile.h | 31 +-
Source/Swig/swigopt.h | 2 +-
Source/Swig/swigparm.h | 2 +-
Source/Swig/swigscan.h | 4 +-
Source/Swig/swigtree.h | 2 +-
Source/Swig/swigwrap.h | 12 +-
Source/Swig/symbol.c | 34 +-
Source/Swig/tree.c | 2 +-
Source/Swig/typemap.c | 30 +-
Source/Swig/typeobj.c | 10 +-
Source/Swig/typesys.c | 15 +-
Source/Swig/wrapfunc.c | 12 +-
TODO | 10 +-
Tools/mkdist.py | 10 +-
Tools/mkrelease.py | 2 +-
Tools/mkwindows.sh | 5 +-
Tools/pyname_patch.py | 123 ++
autogen.sh | 6 +-
configure.in | 354 +++--
902 files changed, 29652 insertions(+), 12562 deletions(-)
create mode 100644 CCache/COPYING
create mode 100644 CCache/Makefile.in
create mode 100644 CCache/README
create mode 100644 CCache/README.swig
create mode 100644 CCache/args.c
create mode 100644 CCache/ccache.c
create mode 100644 CCache/ccache.h
create mode 100644 CCache/ccache.yo
create mode 100644 CCache/ccache_swig_config.h.in
create mode 100644 CCache/cleanup.c
create mode 100644 CCache/configure.in
create mode 100644 CCache/debian/NEWS
create mode 100644 CCache/debian/README.Debian
create mode 100644 CCache/debian/changelog
create mode 100644 CCache/debian/compat
create mode 100644 CCache/debian/control
create mode 100644 CCache/debian/copyright
create mode 100644 CCache/debian/dirs
create mode 100644 CCache/debian/docs
create mode 100644 CCache/debian/examples
create mode 100644 CCache/debian/patches/01_no_home.diff
create mode 100644 CCache/debian/patches/02_ccache-compressed.diff
create mode 100644 CCache/debian/patches/03_long_options.diff
create mode 100644 CCache/debian/patches/04_ignore_profile.diff
create mode 100644 CCache/debian/patches/05_nfs_fix.diff
create mode 100644 CCache/debian/patches/06_md.diff
create mode 100644 CCache/debian/patches/07_cachedirtag.diff
create mode 100644 CCache/debian/patches/08_manpage_hyphens.diff
create mode 100644 CCache/debian/patches/09_respect_ldflags.diff
create mode 100644 CCache/debian/patches/10_lru_cleanup.diff
create mode 100644 CCache/debian/patches/11_utimes.diff
create mode 100644 CCache/debian/patches/12_cachesize_permissions.diff
create mode 100644 CCache/debian/patches/13_html_links.diff
create mode 100644 CCache/debian/patches/14_hardlink_doc.diff
create mode 100644 CCache/debian/patches/CREDITS
create mode 100644 CCache/debian/rules
create mode 100644 CCache/debian/update-ccache
create mode 100644 CCache/debian/watch
create mode 100644 CCache/execute.c
create mode 100644 CCache/hash.c
create mode 100755 CCache/install-sh
create mode 100644 CCache/mdfour.c
create mode 100644 CCache/mdfour.h
create mode 100644 CCache/packaging/README
create mode 100644 CCache/packaging/ccache.spec
create mode 100644 CCache/snprintf.c
create mode 100644 CCache/stats.c
create mode 100755 CCache/test.sh
create mode 100644 CCache/unify.c
create mode 100644 CCache/util.c
create mode 100644 CCache/web/index.html
mode change 100755 => 100644 Doc/Manual/Allegrocl.html
mode change 100755 => 100644 Doc/Manual/swig16.png
delete mode 100644 Examples/GIFPlot/Java/full/main.java
create mode 100644 Examples/GIFPlot/Java/full/runme.java
delete mode 100644 Examples/GIFPlot/Java/shadow/main.java
create mode 100644 Examples/GIFPlot/Java/shadow/runme.java
delete mode 100644 Examples/GIFPlot/Java/simple/main.java
create mode 100644 Examples/GIFPlot/Java/simple/runme.java
create mode 100644 Examples/GIFPlot/Php/check.list
create mode 100644 Examples/GIFPlot/Php/full/Makefile
create mode 100644 Examples/GIFPlot/Php/full/README
create mode 100644 Examples/GIFPlot/Php/full/cmap
create mode 100644 Examples/GIFPlot/Php/full/gifplot.i
create mode 100644 Examples/GIFPlot/Php/full/runme.php
create mode 100644 Examples/GIFPlot/Php/shadow/Makefile
create mode 100644 Examples/GIFPlot/Php/shadow/README
create mode 100644 Examples/GIFPlot/Php/shadow/cmap
create mode 100644 Examples/GIFPlot/Php/shadow/runme.php
create mode 100644 Examples/GIFPlot/Php/simple/Makefile
create mode 100644 Examples/GIFPlot/Php/simple/README
create mode 100644 Examples/GIFPlot/Php/simple/runme.php
create mode 100644 Examples/GIFPlot/Php/simple/simple.i
delete mode 100644 Examples/GIFPlot/Php4/check.list
delete mode 100644 Examples/GIFPlot/Php4/full/Makefile
delete mode 100644 Examples/GIFPlot/Php4/full/README
delete mode 100644 Examples/GIFPlot/Php4/full/cmap
delete mode 100644 Examples/GIFPlot/Php4/full/gifplot.i
delete mode 100644 Examples/GIFPlot/Php4/full/runme.php4
delete mode 100644 Examples/GIFPlot/Php4/shadow/Makefile
delete mode 100644 Examples/GIFPlot/Php4/shadow/README
delete mode 100644 Examples/GIFPlot/Php4/shadow/cmap
delete mode 100644 Examples/GIFPlot/Php4/shadow/runme.php4
delete mode 100644 Examples/GIFPlot/Php4/simple/Makefile
delete mode 100644 Examples/GIFPlot/Php4/simple/README
delete mode 100644 Examples/GIFPlot/Php4/simple/runme.php4
delete mode 100644 Examples/GIFPlot/Php4/simple/simple.i
create mode 100644 Examples/csharp/arrays/Makefile
create mode 100644 Examples/csharp/arrays/example.c
create mode 100644 Examples/csharp/arrays/example.h
create mode 100644 Examples/csharp/arrays/example.i
create mode 100644 Examples/csharp/arrays/runme.cs
mode change 100755 => 100644 Examples/guile/matrix/matrix.scm
delete mode 100644 Examples/java/callback/main.java
create mode 100644 Examples/java/callback/runme.java
delete mode 100644 Examples/java/class/main.java
create mode 100644 Examples/java/class/runme.java
delete mode 100644 Examples/java/constants/main.java
create mode 100644 Examples/java/constants/runme.java
delete mode 100644 Examples/java/enum/main.java
create mode 100644 Examples/java/enum/runme.java
delete mode 100644 Examples/java/extend/main.java
create mode 100644 Examples/java/extend/runme.java
delete mode 100644 Examples/java/funcptr/main.java
create mode 100644 Examples/java/funcptr/runme.java
delete mode 100644 Examples/java/multimap/main.java
create mode 100644 Examples/java/multimap/runme.java
delete mode 100644 Examples/java/native/main.java
create mode 100644 Examples/java/native/runme.java
delete mode 100644 Examples/java/pointer/main.java
create mode 100644 Examples/java/pointer/runme.java
delete mode 100644 Examples/java/reference/main.java
create mode 100644 Examples/java/reference/runme.java
delete mode 100644 Examples/java/simple/main.java
create mode 100644 Examples/java/simple/runme.java
delete mode 100644 Examples/java/template/main.java
create mode 100644 Examples/java/template/runme.java
delete mode 100644 Examples/java/typemap/main.java
create mode 100644 Examples/java/typemap/runme.java
delete mode 100644 Examples/java/variables/main.java
create mode 100644 Examples/java/variables/runme.java
create mode 100644 Examples/php/check.list
create mode 100644 Examples/php/class/Makefile
create mode 100644 Examples/php/class/example.cxx
create mode 100644 Examples/php/class/example.h
create mode 100644 Examples/php/class/example.i
create mode 100644 Examples/php/class/runme.php
create mode 100644 Examples/php/constants/Makefile
create mode 100644 Examples/php/constants/example.i
create mode 100644 Examples/php/constants/runme.php
create mode 100644 Examples/php/cpointer/Makefile
create mode 100644 Examples/php/cpointer/example.c
create mode 100644 Examples/php/cpointer/example.i
create mode 100644 Examples/php/cpointer/runme.php
create mode 100644 Examples/php/disown/Makefile
create mode 100644 Examples/php/disown/example.cxx
create mode 100644 Examples/php/disown/example.h
create mode 100644 Examples/php/disown/example.i
create mode 100644 Examples/php/disown/runme.php
create mode 100644 Examples/php/enum/Makefile
create mode 100644 Examples/php/enum/example.cxx
create mode 100644 Examples/php/enum/example.h
create mode 100644 Examples/php/enum/example.i
create mode 100644 Examples/php/enum/runme.php
create mode 100644 Examples/php/funcptr/Makefile
create mode 100644 Examples/php/funcptr/example.c
create mode 100644 Examples/php/funcptr/example.h
create mode 100644 Examples/php/funcptr/example.i
create mode 100644 Examples/php/funcptr/runme.php
create mode 100644 Examples/php/overloading/Makefile
create mode 100644 Examples/php/overloading/example.cxx
create mode 100644 Examples/php/overloading/example.h
create mode 100644 Examples/php/overloading/example.i
create mode 100644 Examples/php/overloading/runme.php
create mode 100644 Examples/php/pointer/Makefile
create mode 100644 Examples/php/pointer/example.c
create mode 100644 Examples/php/pointer/example.i
create mode 100644 Examples/php/pointer/runme.php
create mode 100644 Examples/php/pragmas/Makefile
create mode 100644 Examples/php/pragmas/example.i
create mode 100644 Examples/php/pragmas/include.php
create mode 100755 Examples/php/pragmas/runme.php
create mode 100644 Examples/php/proxy/Makefile
create mode 100644 Examples/php/proxy/example.cxx
create mode 100644 Examples/php/proxy/example.h
create mode 100644 Examples/php/proxy/example.i
create mode 100644 Examples/php/proxy/runme.php
create mode 100644 Examples/php/reference/Makefile
create mode 100644 Examples/php/reference/example.cxx
create mode 100644 Examples/php/reference/example.h
create mode 100644 Examples/php/reference/example.i
create mode 100644 Examples/php/reference/runme-proxy.php4
create mode 100644 Examples/php/reference/runme.php
create mode 100644 Examples/php/simple/Makefile
create mode 100644 Examples/php/simple/example.c
create mode 100644 Examples/php/simple/example.i
create mode 100755 Examples/php/simple/runme.php
create mode 100644 Examples/php/sync/Makefile
create mode 100644 Examples/php/sync/example.cxx
create mode 100644 Examples/php/sync/example.h
create mode 100644 Examples/php/sync/example.i
create mode 100644 Examples/php/sync/runme.php
create mode 100644 Examples/php/value/Makefile
create mode 100644 Examples/php/value/example.c
create mode 100644 Examples/php/value/example.h
create mode 100644 Examples/php/value/example.i
create mode 100644 Examples/php/value/runme.php
create mode 100644 Examples/php/variables/Makefile
create mode 100644 Examples/php/variables/example.c
create mode 100644 Examples/php/variables/example.h
create mode 100644 Examples/php/variables/example.i
create mode 100644 Examples/php/variables/runme.php
create mode 100644 Examples/php/variables/runme.php4.old
delete mode 100644 Examples/php4/check.list
delete mode 100644 Examples/php4/class/Makefile
delete mode 100644 Examples/php4/class/example.cxx
delete mode 100644 Examples/php4/class/example.h
delete mode 100644 Examples/php4/class/example.i
delete mode 100644 Examples/php4/class/runme.php4
delete mode 100644 Examples/php4/constants/Makefile
delete mode 100644 Examples/php4/constants/example.i
delete mode 100644 Examples/php4/constants/runme.php4
delete mode 100644 Examples/php4/cpointer/Makefile
delete mode 100644 Examples/php4/cpointer/example.c
delete mode 100644 Examples/php4/cpointer/example.i
delete mode 100644 Examples/php4/cpointer/runme.php4
delete mode 100644 Examples/php4/disown/Makefile
delete mode 100644 Examples/php4/disown/example.cxx
delete mode 100644 Examples/php4/disown/example.h
delete mode 100644 Examples/php4/disown/example.i
delete mode 100644 Examples/php4/disown/runme.php4
delete mode 100644 Examples/php4/enum/Makefile
delete mode 100644 Examples/php4/enum/example.cxx
delete mode 100644 Examples/php4/enum/example.h
delete mode 100644 Examples/php4/enum/example.i
delete mode 100644 Examples/php4/enum/runme.php4
delete mode 100644 Examples/php4/funcptr/Makefile
delete mode 100644 Examples/php4/funcptr/example.c
delete mode 100644 Examples/php4/funcptr/example.h
delete mode 100644 Examples/php4/funcptr/example.i
delete mode 100644 Examples/php4/funcptr/runme.php4
delete mode 100644 Examples/php4/overloading/Makefile
delete mode 100644 Examples/php4/overloading/example.cxx
delete mode 100644 Examples/php4/overloading/example.h
delete mode 100644 Examples/php4/overloading/example.i
delete mode 100644 Examples/php4/overloading/runme.php4
delete mode 100644 Examples/php4/pointer/Makefile
delete mode 100644 Examples/php4/pointer/example.c
delete mode 100644 Examples/php4/pointer/example.i
delete mode 100644 Examples/php4/pointer/runme.php4
delete mode 100644 Examples/php4/pragmas/Makefile
delete mode 100644 Examples/php4/pragmas/example.i
delete mode 100644 Examples/php4/pragmas/include.php
delete mode 100755 Examples/php4/pragmas/runme.php4
delete mode 100644 Examples/php4/proxy/Makefile
delete mode 100644 Examples/php4/proxy/example.cxx
delete mode 100644 Examples/php4/proxy/example.h
delete mode 100644 Examples/php4/proxy/example.i
delete mode 100644 Examples/php4/proxy/runme.php4
delete mode 100644 Examples/php4/reference/Makefile
delete mode 100644 Examples/php4/reference/example.cxx
delete mode 100644 Examples/php4/reference/example.h
delete mode 100644 Examples/php4/reference/example.i
delete mode 100644 Examples/php4/reference/runme-proxy.php4
delete mode 100644 Examples/php4/reference/runme.php4
delete mode 100644 Examples/php4/simple/Makefile
delete mode 100644 Examples/php4/simple/example.c
delete mode 100644 Examples/php4/simple/example.i
delete mode 100755 Examples/php4/simple/runme.php4
delete mode 100644 Examples/php4/sync/Makefile
delete mode 100644 Examples/php4/sync/example.cxx
delete mode 100644 Examples/php4/sync/example.h
delete mode 100644 Examples/php4/sync/example.i
delete mode 100644 Examples/php4/sync/runme.php4
delete mode 100644 Examples/php4/value/Makefile
delete mode 100644 Examples/php4/value/example.c
delete mode 100644 Examples/php4/value/example.h
delete mode 100644 Examples/php4/value/example.i
delete mode 100644 Examples/php4/value/runme.php4
delete mode 100644 Examples/php4/variables/Makefile
delete mode 100644 Examples/php4/variables/example.c
delete mode 100644 Examples/php4/variables/example.h
delete mode 100644 Examples/php4/variables/example.i
delete mode 100644 Examples/php4/variables/runme.php4
delete mode 100644 Examples/php4/variables/runme.php4.old
mode change 100755 => 100644 Examples/pike/class/Makefile
mode change 100755 => 100644 Examples/pike/class/example.cxx
mode change 100755 => 100644 Examples/pike/class/example.h
mode change 100755 => 100644 Examples/pike/class/example.i
mode change 100755 => 100644 Examples/pike/constants/Makefile
mode change 100755 => 100644 Examples/pike/constants/example.i
mode change 100755 => 100644 Examples/pike/overload/example.cxx
mode change 100755 => 100644 Examples/pike/overload/example.h
mode change 100755 => 100644 Examples/pike/template/Makefile
mode change 100755 => 100644 Examples/pike/template/example.h
mode change 100755 => 100644 Examples/pike/template/example.i
mode change 100755 => 100644 Examples/ruby/hashargs/Makefile
mode change 100755 => 100644 Examples/ruby/hashargs/example.i
create mode 100644 Examples/test-suite/argcargvtest.i
create mode 100644 Examples/test-suite/callback.i
create mode 100644 Examples/test-suite/chicken/chicken_ext_test_runme.ss
delete mode 100644 Examples/test-suite/chicken/ext_test.i
delete mode 100644 Examples/test-suite/chicken/ext_test_runme.ss
create mode 100644 Examples/test-suite/chicken_ext_test.i
create mode 100644 Examples/test-suite/complextest.i
mode change 100755 => 100644 Examples/test-suite/csharp/bools_runme.cs
create mode 100644 Examples/test-suite/csharp/csharp_lib_arrays_runme.cs
mode change 100755 => 100644 Examples/test-suite/csharp/director_classic_runme.cs
mode change 100755 => 100644 Examples/test-suite/csharp/enum_thorough_runme.cs
create mode 100644 Examples/test-suite/csharp/inherit_target_language_runme.cs
create mode 100644 Examples/test-suite/csharp/li_attribute_runme.cs
create mode 100644 Examples/test-suite/csharp/li_std_map_runme.cs
mode change 100755 => 100644 Examples/test-suite/csharp/li_std_wstring_runme.cs
mode change 100755 => 100644 Examples/test-suite/csharp/overload_complicated_runme.cs
create mode 100644 Examples/test-suite/csharp/typemap_out_optimal_runme.cs
create mode 100644 Examples/test-suite/csharp_lib_arrays.i
mode change 100755 => 100644 Examples/test-suite/director_classic.i
mode change 100755 => 100644 Examples/test-suite/director_ignore.i
create mode 100644 Examples/test-suite/director_profile.i
create mode 100644 Examples/test-suite/director_protected_overloaded.i
create mode 100644 Examples/test-suite/director_stl.i
create mode 100644 Examples/test-suite/global_namespace.i
delete mode 100644 Examples/test-suite/guilescm/ext_test.i
delete mode 100644 Examples/test-suite/guilescm/ext_test_runme.scm
create mode 100644 Examples/test-suite/guilescm/guilescm_ext_test_runme.scm
create mode 100644 Examples/test-suite/guilescm_ext_test.i
create mode 100644 Examples/test-suite/iadd.i
create mode 100644 Examples/test-suite/implicittest.i
create mode 100644 Examples/test-suite/inout.i
create mode 100644 Examples/test-suite/inplaceadd.i
create mode 100644 Examples/test-suite/input.i
create mode 100644 Examples/test-suite/insert_directive.i
mode change 100755 => 100644 Examples/test-suite/java/allprotected_runme.java
mode change 100755 => 100644 Examples/test-suite/java/director_classic_runme.java
mode change 100755 => 100644 Examples/test-suite/java/director_ignore_runme.java
create mode 100644 Examples/test-suite/java/global_namespace_runme.java
create mode 100644 Examples/test-suite/java/li_boost_intrusive_ptr_runme.java
mode change 100755 => 100644 Examples/test-suite/java/overload_complicated_runme.java
create mode 100644 Examples/test-suite/java/typemap_out_optimal_runme.java
create mode 100644 Examples/test-suite/li_boost_intrusive_ptr.i
create mode 100644 Examples/test-suite/li_std_carray.i
create mode 100644 Examples/test-suite/li_std_functors.i
create mode 100644 Examples/test-suite/li_std_list.i
create mode 100644 Examples/test-suite/li_std_multimap.i
create mode 100644 Examples/test-suite/li_std_pair_extra.i
create mode 100644 Examples/test-suite/li_std_pair_lang_object.i
create mode 100644 Examples/test-suite/li_std_queue.i
create mode 100644 Examples/test-suite/li_std_stack.i
create mode 100644 Examples/test-suite/li_std_string_extra.i
create mode 100644 Examples/test-suite/li_std_vector_extra.i
create mode 100644 Examples/test-suite/li_std_vector_ptr.i
create mode 100644 Examples/test-suite/li_std_vectora.i
create mode 100644 Examples/test-suite/li_std_wstream.i
create mode 100644 Examples/test-suite/nested_structs.i
delete mode 100644 Examples/test-suite/octave/cell_deref.i
delete mode 100644 Examples/test-suite/octave/cell_deref_runme.m
delete mode 100644 Examples/test-suite/octave/implicittest.i
delete mode 100644 Examples/test-suite/octave/li_std_pair.i
create mode 100644 Examples/test-suite/octave/li_std_pair_extra_runme.m
delete mode 100644 Examples/test-suite/octave/li_std_pair_runme.m
delete mode 100644 Examples/test-suite/octave/li_std_string.i
create mode 100644 Examples/test-suite/octave/li_std_string_extra_runme.m
delete mode 100644 Examples/test-suite/octave/li_std_string_runme.m
create mode 100644 Examples/test-suite/octave/octave_cell_deref_runme.m
create mode 100644 Examples/test-suite/octave_cell_deref.i
create mode 100644 Examples/test-suite/operbool.i
create mode 100644 Examples/test-suite/packageoption_c.i
create mode 100644 Examples/test-suite/perl5/byreference.i
create mode 100644 Examples/test-suite/perl5/byreference_runme.pl
delete mode 100644 Examples/test-suite/perl5/li_std_list.i
create mode 100644 Examples/test-suite/php/Makefile.in
create mode 100644 Examples/test-suite/php/abstract_inherit_ok_runme.php
create mode 100644 Examples/test-suite/php/abstract_inherit_runme.php
create mode 100644 Examples/test-suite/php/add_link_runme.php
create mode 100644 Examples/test-suite/php/argout_runme.php
create mode 100644 Examples/test-suite/php/arrayptr_runme.php
create mode 100644 Examples/test-suite/php/arrays_global_runme.php
create mode 100644 Examples/test-suite/php/arrays_global_twodim_runme.php
create mode 100644 Examples/test-suite/php/arrays_runme.php
create mode 100644 Examples/test-suite/php/arrays_scope_runme.php
create mode 100644 Examples/test-suite/php/casts_runme.php
create mode 100644 Examples/test-suite/php/class_ignore_runme.php
create mode 100644 Examples/test-suite/php/conversion_namespace_runme.php
create mode 100644 Examples/test-suite/php/conversion_ns_template_runme.php
create mode 100644 Examples/test-suite/php/conversion_runme.php
create mode 100644 Examples/test-suite/php/cpp_static_runme.php
create mode 100644 Examples/test-suite/php/enum_scope_template_runme.php
create mode 100644 Examples/test-suite/php/evil_diamond_ns_runme.php
create mode 100644 Examples/test-suite/php/evil_diamond_prop_runme.php
create mode 100644 Examples/test-suite/php/evil_diamond_runme.php
create mode 100644 Examples/test-suite/php/extend_template_ns_runme.php
create mode 100644 Examples/test-suite/php/extend_template_runme.php
create mode 100644 Examples/test-suite/php/grouping_runme.php
create mode 100644 Examples/test-suite/php/ignore_parameter_runme.php
create mode 100644 Examples/test-suite/php/li_carrays_runme.php
create mode 100644 Examples/test-suite/php/li_std_string_runme.php
create mode 100644 Examples/test-suite/php/rename_scope_runme.php
create mode 100644 Examples/test-suite/php/skel.php
create mode 100644 Examples/test-suite/php/smart_pointer_rename_runme.php
create mode 100644 Examples/test-suite/php/sym_runme.php
create mode 100644 Examples/test-suite/php/template_arg_typename_runme.php
create mode 100644 Examples/test-suite/php/template_construct_runme.php
create mode 100644 Examples/test-suite/php/tests.php
create mode 100644 Examples/test-suite/php/typedef_reference_runme.php
create mode 100644 Examples/test-suite/php/typemap_ns_using_runme.php
create mode 100644 Examples/test-suite/php/using1_runme.php
create mode 100644 Examples/test-suite/php/using2_runme.php
create mode 100644 Examples/test-suite/php/valuewrapper_base_runme.php
delete mode 100644 Examples/test-suite/php4/Makefile.in
delete mode 100644 Examples/test-suite/php4/abstract_inherit_ok_runme.php4
delete mode 100644 Examples/test-suite/php4/abstract_inherit_runme.php4
delete mode 100644 Examples/test-suite/php4/add_link_runme.php4
delete mode 100644 Examples/test-suite/php4/argout_runme.php4
delete mode 100644 Examples/test-suite/php4/arrayptr_runme.php4
delete mode 100644 Examples/test-suite/php4/arrays_global_runme.php4
delete mode 100644 Examples/test-suite/php4/arrays_global_twodim_runme.php4
delete mode 100644 Examples/test-suite/php4/arrays_runme.php4
delete mode 100644 Examples/test-suite/php4/arrays_scope_runme.php4
delete mode 100644 Examples/test-suite/php4/casts_runme.php4
delete mode 100644 Examples/test-suite/php4/class_ignore_runme.php4
delete mode 100644 Examples/test-suite/php4/conversion_namespace_runme.php4
delete mode 100644 Examples/test-suite/php4/conversion_ns_template_runme.php4
delete mode 100644 Examples/test-suite/php4/conversion_runme.php4
delete mode 100644 Examples/test-suite/php4/cpp_static_runme.php4
delete mode 100644 Examples/test-suite/php4/enum_scope_template_runme.php4
delete mode 100644 Examples/test-suite/php4/evil_diamond_ns_runme.php4
delete mode 100644 Examples/test-suite/php4/evil_diamond_prop_runme.php4
delete mode 100644 Examples/test-suite/php4/evil_diamond_runme.php4
delete mode 100644 Examples/test-suite/php4/extend_template_ns_runme.php4
delete mode 100644 Examples/test-suite/php4/extend_template_runme.php4
delete mode 100644 Examples/test-suite/php4/grouping_runme.php4
delete mode 100644 Examples/test-suite/php4/ignore_parameter_runme.php4
delete mode 100644 Examples/test-suite/php4/li_carrays_runme.php4
delete mode 100644 Examples/test-suite/php4/li_std_string_runme.php4
delete mode 100644 Examples/test-suite/php4/namewarn_rename.i
delete mode 100644 Examples/test-suite/php4/rename_scope_runme.php4
delete mode 100644 Examples/test-suite/php4/skel.php4
delete mode 100644 Examples/test-suite/php4/smart_pointer_rename_runme.php4
delete mode 100644 Examples/test-suite/php4/sym_runme.php4
delete mode 100644 Examples/test-suite/php4/template_arg_typename_runme.php4
delete mode 100644 Examples/test-suite/php4/template_construct_runme.php4
delete mode 100644 Examples/test-suite/php4/tests.php4
delete mode 100644 Examples/test-suite/php4/typedef_reference_runme.php4
delete mode 100644 Examples/test-suite/php4/typemap_ns_using_runme.php4
delete mode 100644 Examples/test-suite/php4/using1_runme.php4
delete mode 100644 Examples/test-suite/php4/using2_runme.php4
delete mode 100644 Examples/test-suite/php4/valuewrapper_base_runme.php4
create mode 100644 Examples/test-suite/php_namewarn_rename.i
delete mode 100644 Examples/test-suite/python/argcargvtest.i
delete mode 100644 Examples/test-suite/python/autodoc.i
delete mode 100644 Examples/test-suite/python/callback.i
delete mode 100644 Examples/test-suite/python/complextest.i
create mode 100644 Examples/test-suite/python/cpp_static_runme.py
delete mode 100644 Examples/test-suite/python/director_profile.i
delete mode 100644 Examples/test-suite/python/director_stl.i
delete mode 100644 Examples/test-suite/python/iadd.h
delete mode 100644 Examples/test-suite/python/iadd.i
delete mode 100644 Examples/test-suite/python/implicittest.i
delete mode 100644 Examples/test-suite/python/inout.i
delete mode 100644 Examples/test-suite/python/inplaceadd.i
delete mode 100644 Examples/test-suite/python/input.i
delete mode 100644 Examples/test-suite/python/kwargs.i
delete mode 100644 Examples/test-suite/python/kwargs_runme.py
delete mode 100644 Examples/test-suite/python/li_std_carray.i
delete mode 100644 Examples/test-suite/python/li_std_map.i
delete mode 100644 Examples/test-suite/python/li_std_pair.i
create mode 100644 Examples/test-suite/python/li_std_pair_extra_runme.py
delete mode 100644 Examples/test-suite/python/li_std_pair_runme.py
delete mode 100644 Examples/test-suite/python/li_std_set.i
delete mode 100644 Examples/test-suite/python/li_std_stream.i
delete mode 100644 Examples/test-suite/python/li_std_string.i
create mode 100644 Examples/test-suite/python/li_std_string_extra_runme.py
delete mode 100644 Examples/test-suite/python/li_std_string_runme.py
delete mode 100644 Examples/test-suite/python/li_std_vector.i
create mode 100644 Examples/test-suite/python/li_std_vector_extra_runme.py
create mode 100644 Examples/test-suite/python/li_std_vector_ptr_runme.py
delete mode 100644 Examples/test-suite/python/li_std_vector_runme.py
delete mode 100644 Examples/test-suite/python/li_std_vectora.i
delete mode 100644 Examples/test-suite/python/li_std_wstream.i
delete mode 100644 Examples/test-suite/python/li_std_wstring.i
delete mode 100644 Examples/test-suite/python/nondynamic.i
delete mode 100644 Examples/test-suite/python/nondynamic_runme.py
create mode 100644 Examples/test-suite/python/operbool_runme.py
delete mode 100644 Examples/test-suite/python/overload_simple_cast.i
delete mode 100644 Examples/test-suite/python/overload_simple_cast_runme.py
create mode 100644 Examples/test-suite/python/python_abstractbase_runme3.py
create mode 100644 Examples/test-suite/python/python_append_runme.py
create mode 100644 Examples/test-suite/python/python_kwargs_runme.py
create mode 100644 Examples/test-suite/python/python_nondynamic_runme.py
create mode 100644 Examples/test-suite/python/python_overload_simple_cast_runme.py
create mode 100644 Examples/test-suite/python/python_pybuf_runme3.py
create mode 100644 Examples/test-suite/python/rename_strip_encoder_runme.py
delete mode 100644 Examples/test-suite/python/simutry.i
delete mode 100644 Examples/test-suite/python/std_containers.i
delete mode 100644 Examples/test-suite/python/swigobject.i
delete mode 100644 Examples/test-suite/python/tag_no_clash_with_variable_runme.i
delete mode 100644 Examples/test-suite/python/template_matrix.i
create mode 100644 Examples/test-suite/python/typemap_out_optimal_runme.py
delete mode 100644 Examples/test-suite/python/vector.i
create mode 100644 Examples/test-suite/python_abstractbase.i
create mode 100644 Examples/test-suite/python_append.i
create mode 100644 Examples/test-suite/python_autodoc.i
create mode 100644 Examples/test-suite/python_kwargs.i
create mode 100644 Examples/test-suite/python_nondynamic.i
create mode 100644 Examples/test-suite/python_overload_simple_cast.i
create mode 100644 Examples/test-suite/python_pybuf.i
create mode 100644 Examples/test-suite/r/arrays_dimensionless_runme.R
delete mode 100644 Examples/test-suite/r/copy_struct.i
delete mode 100644 Examples/test-suite/r/copy_struct_runme.R
delete mode 100644 Examples/test-suite/r/double_delete.i
delete mode 100644 Examples/test-suite/r/double_delete_runme.R
create mode 100644 Examples/test-suite/r/integers_runme.R
delete mode 100644 Examples/test-suite/r/legacy.i
delete mode 100644 Examples/test-suite/r/legacy_runme.R
create mode 100644 Examples/test-suite/r/r_copy_struct_runme.R
create mode 100644 Examples/test-suite/r/r_double_delete_runme.R
create mode 100644 Examples/test-suite/r/r_legacy_runme.R
delete mode 100644 Examples/test-suite/r/simple_array.i
create mode 100644 Examples/test-suite/r_copy_struct.i
create mode 100644 Examples/test-suite/r_double_delete.i
create mode 100644 Examples/test-suite/r_legacy.i
create mode 100644 Examples/test-suite/rename_strip_encoder.i
delete mode 100644 Examples/test-suite/ruby/keywords.i
delete mode 100644 Examples/test-suite/ruby/keywords_runme.rb
delete mode 100644 Examples/test-suite/ruby/li_std_functors.i
create mode 100755 Examples/test-suite/ruby/li_std_multimap_runme.rb
delete mode 100644 Examples/test-suite/ruby/li_std_pair_lang_object.i
delete mode 100644 Examples/test-suite/ruby/li_std_queue.i
delete mode 100644 Examples/test-suite/ruby/li_std_speed.i
delete mode 100755 Examples/test-suite/ruby/li_std_speed_runme.rb
delete mode 100644 Examples/test-suite/ruby/li_std_stack.i
delete mode 100644 Examples/test-suite/ruby/naming.i
delete mode 100644 Examples/test-suite/ruby/naming_runme.rb
create mode 100644 Examples/test-suite/ruby/ruby_keywords_runme.rb
create mode 100755 Examples/test-suite/ruby/ruby_li_std_speed_runme.rb
create mode 100644 Examples/test-suite/ruby/ruby_naming_runme.rb
create mode 100644 Examples/test-suite/ruby/ruby_track_objects_directors_runme.rb
create mode 100644 Examples/test-suite/ruby/ruby_track_objects_runme.rb
delete mode 100644 Examples/test-suite/ruby/stl_new.i
delete mode 100644 Examples/test-suite/ruby/track_objects.i
delete mode 100644 Examples/test-suite/ruby/track_objects_directors.i
delete mode 100644 Examples/test-suite/ruby/track_objects_directors_runme.rb
delete mode 100644 Examples/test-suite/ruby/track_objects_runme.rb
create mode 100644 Examples/test-suite/ruby_keywords.i
create mode 100644 Examples/test-suite/ruby_li_std_speed.i
create mode 100644 Examples/test-suite/ruby_naming.i
create mode 100644 Examples/test-suite/ruby_track_objects.i
create mode 100644 Examples/test-suite/ruby_track_objects_directors.i
create mode 100644 Examples/test-suite/simple_array.i
create mode 100644 Examples/test-suite/simutry.i
create mode 100644 Examples/test-suite/stl_new.i
create mode 100644 Examples/test-suite/swigobject.i
delete mode 100644 Examples/test-suite/tcl/union.i
create mode 100644 Examples/test-suite/tcl/union_parameter_runme.tcl
delete mode 100755 Examples/test-suite/tcl/union_runme.tcl
create mode 100644 Examples/test-suite/template_matrix.i
create mode 100644 Examples/test-suite/typemap_out_optimal.i
create mode 100644 Examples/test-suite/union_parameter.i
mode change 100755 => 100644 Lib/allegrocl/inout_typemaps.i
mode change 100755 => 100644 Lib/allegrocl/longlongs.i
mode change 100755 => 100644 Lib/allegrocl/std_list.i
mode change 100755 => 100644 Lib/allegrocl/std_string.i
create mode 100644 Lib/csharp/arrays_csharp.i
mode change 100755 => 100644 Lib/csharp/std_vector.i
mode change 100755 => 100644 Lib/csharp/std_wstring.i
mode change 100755 => 100644 Lib/csharp/wchar.i
create mode 100644 Lib/intrusive_ptr.i
create mode 100644 Lib/java/boost_intrusive_ptr.i
create mode 100644 Lib/python/pyabc.i
create mode 100644 Lib/python/pybuffer.i
create mode 100644 Lib/python/pyname_compat.i
mode change 100755 => 100644 Source/Modules/ocaml.cxx
create mode 100644 Tools/pyname_patch.py
diff --git a/ANNOUNCE b/ANNOUNCE
index 7c0e95e3f..9ef41142a 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,11 +1,11 @@
-*** ANNOUNCE: SWIG 1.3.36 (24 June 2008) ***
+*** ANNOUNCE: SWIG 1.3.40 (in progress) ***
http://www.swig.org
-We're pleased to announce SWIG-1.3.36, the latest installment in the
-SWIG development effort. SWIG-1.3.36 includes a number of bug fixes
-and large number of enhancements throughout.
+We're pleased to announce SWIG-1.3.40, the latest installment in the
+SWIG development effort. SWIG-1.3.40 includes a number of bug fixes
+and enhancements.
What is SWIG?
-------------
@@ -24,21 +24,11 @@ Availability:
-------------
The release is available for download on Sourceforge at
- http://prdownloads.sourceforge.net/swig/swig-1.3.36.tar.gz
+ http://prdownloads.sourceforge.net/swig/swig-1.3.40.tar.gz
A Windows version is also available at
- http://prdownloads.sourceforge.net/swig/swigwin-1.3.36.zip
-
-Release numbers
----------------
-With SWIG-1.3, we are adopting an odd/even version numbering scheme for
-SWIG. Odd version numbers (1.3, 1.5, 1.7, etc...) are considered to
-be development releases. Even numbers (1.4,1.6,1.8) are stable
-releases. The current 1.3 effort is working to produce a stable 2.0
-release. A stable 2.0 release will not be made until it can
-accompanied by fully updated documentation. In the meantime, we will
-continue to make periodic 1.3.x releases.
+ http://prdownloads.sourceforge.net/swig/swigwin-1.3.40.zip
Please report problems with this release to the swig-dev mailing list,
details at http://www.swig.org/mail.html.
diff --git a/CCache/COPYING b/CCache/COPYING
new file mode 100644
index 000000000..a43ea2126
--- /dev/null
+++ b/CCache/COPYING
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ Appendix: How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C) 19yy
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ , 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/CCache/Makefile.in b/CCache/Makefile.in
new file mode 100644
index 000000000..ec55ccaf5
--- /dev/null
+++ b/CCache/Makefile.in
@@ -0,0 +1,73 @@
+datarootdir = @datarootdir@
+srcdir=@srcdir@
+VPATH=@srcdir@
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+mandir=@mandir@
+INSTALLCMD=@INSTALL@
+PACKAGE_NAME=@PACKAGE_NAME@
+# Soft link test can be skipped on systems that don't support soft linking
+NOSOFTLINKSTEST=
+
+CC=@CC@
+CFLAGS=@CFLAGS@ -I.
+SWIG=swig
+SWIG_LIB=../../Lib
+EXEEXT=@EXEEXT@
+
+# Use standard autoconf approach to transform executable name using --program-prefix and --program-suffix
+transform = @program_transform_name@
+
+LIBS= @LIBS@
+OBJS= ccache.o mdfour.o hash.o execute.o util.o args.o stats.o \
+ cleanup.o snprintf.o unify.o
+HEADERS = ccache.h mdfour.h
+
+all: $(PACKAGE_NAME)$(EXEEXT)
+
+# Note that HTML documentation is actually generated and used from the main SWIG documentation Makefile
+docs: $(PACKAGE_NAME).1 web/ccache-man.html
+
+$(PACKAGE_NAME)$(EXEEXT): $(OBJS) $(HEADERS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
+
+$(PACKAGE_NAME).1: ccache.yo
+ -yodl2man -o $(PACKAGE_NAME).1 ccache.yo
+
+web/ccache-man.html: ccache.yo
+ mkdir -p man
+ yodl2html -o web/ccache-man.html ccache.yo
+
+install: $(PACKAGE_NAME)$(EXEEXT) $(PACKAGE_NAME).1
+ ${INSTALLCMD} -d $(DESTDIR)${bindir}
+ ${INSTALLCMD} -m 755 $(PACKAGE_NAME)$(EXEEXT) $(DESTDIR)${bindir}/`echo $(PACKAGE_NAME) | sed '$(transform)'`$(EXEEXT)
+ ${INSTALLCMD} -d $(DESTDIR)${mandir}/man1
+ ${INSTALLCMD} -m 644 ${srcdir}/$(PACKAGE_NAME).1 $(DESTDIR)${mandir}/man1/`echo $(PACKAGE_NAME) | sed '$(transform)'`.1
+
+uninstall: $(PACKAGE_NAME)$(EXEEXT) $(PACKAGE_NAME).1
+ rm -f $(DESTDIR)${bindir}/`echo $(PACKAGE_NAME) | sed '$(transform)'`$(EXEEXT)
+ rm -f $(DESTDIR)${mandir}/man1/`echo $(PACKAGE_NAME) | sed '$(transform)'`.1
+
+clean:
+ /bin/rm -f $(OBJS) *~ $(PACKAGE_NAME)$(EXEEXT)
+
+clean-docs:
+ rm -f $(PACKAGE_NAME).1 web/ccache-man.html
+
+check : test
+
+test: test.sh
+ SWIG_LIB='$(SWIG_LIB)' PATH=../..:$$PATH SWIG='$(SWIG)' CC='$(CC)' NOSOFTLINKSTEST='$(NOSOFTLINKSTEST)' ./test.sh
+
+check: test
+
+distclean: clean
+ /bin/rm -f Makefile config.h config.sub config.log build-stamp config.status configure config.h
+
+# FIXME: To fix this, test.sh needs to be able to take ccache from the
+# installed prefix, not from the source dir.
+installcheck:
+ @echo "WARNING! This is not really \"installcheck\" yet."
+ $(MAKE) check
diff --git a/CCache/README b/CCache/README
new file mode 100644
index 000000000..6e68a6eb0
--- /dev/null
+++ b/CCache/README
@@ -0,0 +1,31 @@
+This is a re-implementation of "compilercache" in C
+
+The original compilercache scripts were by Erik Thiele
+(erikyyy@erikyyy.de) and I would like to thank him for an excellent
+piece of work. See http://www.erikyyy.de/compilercache/ for the
+original shell scripts.
+
+I wrote ccache because I wanted to get a bit more speed out of a
+compiler cache and I wanted to remove some of the limitations of the
+shell-script version.
+
+Please see the manual page and documentation at
+http://ccache.samba.org/
+
+INSTALLATION
+------------
+
+Please run:
+
+ ./configure
+ make
+ make install
+
+then read the ccache manual page
+
+-----------
+
+Andrew Tridgell
+http://samba.org/~tridge/
+bugs@ccache.samba.org
+
diff --git a/CCache/README.swig b/CCache/README.swig
new file mode 100644
index 000000000..aea0f3d82
--- /dev/null
+++ b/CCache/README.swig
@@ -0,0 +1,8 @@
+This directory contains a version of ccache. The initial version was based on ccache-2.4 plus
+debian patches 01-02, 04-14, see the debian/patches subdirectory. The ccache-win32-2.4 modifications
+to ccache-2.4 have also been merged in.
+
+Changes have been made to support cacheing the output from SWIG. The ability to cache c/c++ compiler
+output has been retained.
+
+Additional features added are the CCACHE_VERBOSE and CCACHE_SWIG environment variables, see docs.
diff --git a/CCache/args.c b/CCache/args.c
new file mode 100644
index 000000000..31e5471c1
--- /dev/null
+++ b/CCache/args.c
@@ -0,0 +1,91 @@
+/*
+ convenient routines for argument list handling
+
+ Copyright (C) Andrew Tridgell 2002
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "ccache.h"
+
+ARGS *args_init(int init_argc, char **init_args)
+{
+ ARGS *args;
+ int i;
+ args = (ARGS *)x_malloc(sizeof(ARGS));
+ args->argc = 0;
+ args->argv = (char **)x_malloc(sizeof(char *));
+ args->argv[0] = NULL;
+ for (i=0;iargv = (char**)x_realloc(args->argv, (args->argc + 2) * sizeof(char *));
+ args->argv[args->argc] = x_strdup(s);
+ args->argc++;
+ args->argv[args->argc] = NULL;
+}
+
+/* pop the last element off the args list */
+void args_pop(ARGS *args, int n)
+{
+ while (n--) {
+ args->argc--;
+ free(args->argv[args->argc]);
+ args->argv[args->argc] = NULL;
+ }
+}
+
+/* remove the first element of the argument list */
+void args_remove_first(ARGS *args)
+{
+ free(args->argv[0]);
+ memmove(&args->argv[0],
+ &args->argv[1],
+ args->argc * sizeof(args->argv[0]));
+ args->argc--;
+}
+
+/* add an argument into the front of the argument list */
+void args_add_prefix(ARGS *args, const char *s)
+{
+ args->argv = (char**)x_realloc(args->argv, (args->argc + 2) * sizeof(char *));
+ memmove(&args->argv[1], &args->argv[0],
+ (args->argc+1) * sizeof(args->argv[0]));
+ args->argv[0] = x_strdup(s);
+ args->argc++;
+}
+
+/* strip any arguments beginning with the specified prefix */
+void args_strip(ARGS *args, const char *prefix)
+{
+ int i;
+ for (i=0; iargc; ) {
+ if (strncmp(args->argv[i], prefix, strlen(prefix)) == 0) {
+ free(args->argv[i]);
+ memmove(&args->argv[i],
+ &args->argv[i+1],
+ args->argc * sizeof(args->argv[i]));
+ args->argc--;
+ } else {
+ i++;
+ }
+ }
+}
diff --git a/CCache/ccache.c b/CCache/ccache.c
new file mode 100644
index 000000000..d1696da88
--- /dev/null
+++ b/CCache/ccache.c
@@ -0,0 +1,1388 @@
+/*
+ a re-implementation of the compilercache scripts in C
+
+ The idea is based on the shell-script compilercache by Erik Thiele
+
+ Copyright (C) Andrew Tridgell 2002
+ Copyright (C) Martin Pool 2003
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "ccache.h"
+
+/* verbose mode */
+int ccache_verbose = 0;
+
+/* the base cache directory */
+char *cache_dir = NULL;
+
+/* the directory for temporary files */
+static char *temp_dir = NULL;
+
+/* the debug logfile name, if set */
+char *cache_logfile = NULL;
+
+/* the argument list after processing */
+static ARGS *stripped_args;
+
+/* the original argument list */
+static ARGS *orig_args;
+
+/* the output filename being compiled to */
+static char *output_file;
+
+/* the source file */
+static char *input_file;
+
+/* the name of the file containing the cached object code */
+static char *hashname;
+
+/* the extension of the file after pre-processing */
+static const char *i_extension;
+
+/* the name of the temporary pre-processor file */
+static char *i_tmpfile;
+
+/* are we compiling a .i or .ii file directly? */
+static int direct_i_file;
+
+/* the name of the cpp stderr file */
+static char *cpp_stderr;
+
+/* the name of the statistics file */
+char *stats_file = NULL;
+
+/* can we safely use the unification hashing backend? */
+static int enable_unify;
+
+/* should we strip -c when running the preprocessor only? */
+static int strip_c_option;
+
+/* customisation for using the SWIG compiler */
+static int swig;
+
+/* a list of supported file extensions, and the equivalent
+ extension for code that has been through the pre-processor
+*/
+static struct {
+ char *extension;
+ char *i_extension;
+} extensions[] = {
+ {"c", "i"},
+ {"C", "ii"},
+ {"m", "mi"},
+ {"cc", "ii"},
+ {"CC", "ii"},
+ {"cpp", "ii"},
+ {"CPP", "ii"},
+ {"cxx", "ii"},
+ {"CXX", "ii"},
+ {"c++", "ii"},
+ {"C++", "ii"},
+ {"i", "i"},
+ {"ii", "ii"},
+ {NULL, NULL}};
+
+/*
+ something went badly wrong - just execute the real compiler
+*/
+static void failed(void)
+{
+ char *e;
+
+ /* delete intermediate pre-processor file if needed */
+ if (i_tmpfile) {
+ if (!direct_i_file) {
+ unlink(i_tmpfile);
+ }
+ free(i_tmpfile);
+ i_tmpfile = NULL;
+ }
+
+ /* delete the cpp stderr file if necessary */
+ if (cpp_stderr) {
+ unlink(cpp_stderr);
+ free(cpp_stderr);
+ cpp_stderr = NULL;
+ }
+
+ /* strip any local args */
+ args_strip(orig_args, "--ccache-");
+
+ if ((e=getenv("CCACHE_PREFIX"))) {
+ char *p = find_executable(e, MYNAME);
+ if (!p) {
+ cc_log("could not find executable (%s)\n", e);
+ perror(e);
+ exit(1);
+ }
+ args_add_prefix(orig_args, p);
+ }
+
+ if (ccache_verbose) {
+ display_execute_args(orig_args->argv);
+ }
+
+ if (swig) {
+ putenv("CCACHE_OUTFILES");
+ }
+
+#ifndef _WIN32
+ execv(orig_args->argv[0], orig_args->argv);
+ cc_log("execv returned (%s)!\n", strerror(errno));
+ perror(orig_args->argv[0]);
+ exit(1);
+#else
+ /* execv on Windows causes the 'non-regular' testcase to fail, so use Win32 API instead */
+ {
+ PROCESS_INFORMATION pinfo;
+ STARTUPINFO sinfo;
+ BOOL ret;
+ DWORD exitcode;
+ char *args;
+
+ ZeroMemory(&pinfo, sizeof(PROCESS_INFORMATION));
+ ZeroMemory(&sinfo, sizeof(STARTUPINFO));
+ sinfo.cb = sizeof(STARTUPINFO);
+ args = argvtos(orig_args->argv);
+ ret = CreateProcessA(orig_args->argv[0], args, NULL, NULL, TRUE, 0, NULL, NULL,
+ &sinfo, &pinfo);
+ if (!ret) {
+ exitcode = 1;
+ cc_log("CreateProcessA failed starting %s\n", orig_args->argv[0]);
+ perror_win32(orig_args->argv[0]);
+ } else {
+ WaitForSingleObject(pinfo.hProcess, INFINITE);
+ GetExitCodeProcess(pinfo.hProcess, &exitcode);
+ CloseHandle(pinfo.hProcess);
+ CloseHandle(pinfo.hThread);
+ }
+ free(args);
+ exit(exitcode);
+ }
+#endif
+}
+
+
+/* return a string to be used to distinguish temporary files
+ this also tries to cope with NFS by adding the local hostname
+*/
+static const char *tmp_string(void)
+{
+ static char *ret;
+
+ if (!ret) {
+ char hostname[200];
+ strcpy(hostname, "unknown");
+#if HAVE_GETHOSTNAME
+ gethostname(hostname, sizeof(hostname)-1);
+#endif
+ hostname[sizeof(hostname)-1] = 0;
+ if (asprintf(&ret, "%s.%u", hostname, (unsigned)getpid()) == -1) {
+ fatal("could not allocate tmp_string");
+ }
+ }
+
+ return ret;
+}
+
+/* update cached file sizes and count helper function for to_cache() */
+static void to_cache_stats_helper(struct stat *pstat, char *cached_filename, char *tmp_outfiles, int *files_size, int *cached_files_count)
+{
+#if ENABLE_ZLIB
+ /* do an extra stat on the cache file for the size statistics */
+ if (stat(cached_filename, pstat) != 0) {
+ cc_log("failed to stat cache files - %s\n", strerror(errno));
+ stats_update(STATS_ERROR);
+ if (tmp_outfiles) {
+ unlink(tmp_outfiles);
+ }
+ failed();
+ }
+#else
+ (void)cached_filename;
+ (void)tmp_outfiles;
+#endif
+ (*files_size) += file_size(pstat);
+ (*cached_files_count)++;
+}
+
+/* run the real compiler and put the result in cache */
+static void to_cache(ARGS *args)
+{
+ char *path_stderr;
+ char *tmp_stdout, *tmp_stderr, *tmp_outfiles;
+ struct stat st1;
+ int status;
+ int cached_files_count = 0;
+ int files_size = 0;
+
+ x_asprintf(&tmp_stdout, "%s/tmp.stdout.%s", temp_dir, tmp_string());
+ x_asprintf(&tmp_stderr, "%s/tmp.stderr.%s", temp_dir, tmp_string());
+ x_asprintf(&tmp_outfiles, "%s/tmp.outfiles.%s", temp_dir, tmp_string());
+
+ if (strip_c_option && !swig) {
+ args_add(stripped_args, "-c");
+ }
+
+ if (output_file) {
+ args_add(args, "-o");
+ args_add(args, output_file);
+ }
+
+ /* Turn off DEPENDENCIES_OUTPUT when running cc1, because
+ * otherwise it will emit a line like
+ *
+ * tmp.stdout.vexed.732.o: /home/mbp/.ccache/tmp.stdout.vexed.732.i
+ *
+ * unsetenv() is on BSD and Linux but not portable. */
+ putenv("DEPENDENCIES_OUTPUT");
+
+ /* Give SWIG a filename for it to create and populate with a list of files that it generates */
+ if (swig) {
+ char *ccache_outfiles;
+ x_asprintf(&ccache_outfiles, "CCACHE_OUTFILES=%s", tmp_outfiles);
+ unlink(tmp_outfiles);
+ if (getenv("CCACHE_OUTFILES") || putenv(ccache_outfiles) == -1) {
+ cc_log("CCACHE_OUTFILES env variable already set or could not be set\n");
+ stats_update(STATS_ERROR);
+ failed();
+ }
+ }
+
+ if (getenv("CCACHE_CPP2")) {
+ args_add(args, input_file);
+ } else {
+ if (swig) {
+ args_add(args, "-nopreprocess");
+ }
+ args_add(args, i_tmpfile);
+ }
+ status = execute(args->argv, tmp_stdout, tmp_stderr);
+ args_pop(args, 3);
+
+ if (stat(tmp_stdout, &st1) != 0 || st1.st_size != 0) {
+ cc_log("compiler produced stdout for %s\n", input_file);
+ stats_update(STATS_STDOUT);
+ unlink(tmp_stdout);
+ unlink(tmp_stderr);
+ unlink(tmp_outfiles);
+ if (!swig) unlink(output_file);
+ failed();
+ }
+ unlink(tmp_stdout);
+
+ if (status != 0) {
+ int fd;
+ cc_log("compile of %s gave status = %d\n", input_file, status);
+ stats_update(STATS_STATUS);
+
+ fd = open(tmp_stderr, O_RDONLY | O_BINARY);
+ if (fd != -1) {
+ if (cpp_stderr) {
+ /* we might have some stderr from cpp */
+ int fd2 = open(cpp_stderr, O_RDONLY | O_BINARY);
+ if (fd2 != -1) {
+ copy_fd(fd2, 2);
+ close(fd2);
+ unlink(cpp_stderr);
+ cpp_stderr = NULL;
+ }
+ }
+
+ /* we can use a quick method of
+ getting the failed output */
+ copy_fd(fd, 2);
+ close(fd);
+ unlink(tmp_stderr);
+ if (i_tmpfile && !direct_i_file) {
+ unlink(i_tmpfile);
+ }
+ exit(status);
+ }
+
+ unlink(tmp_stderr);
+ unlink(tmp_outfiles);
+ if (!swig) unlink(output_file);
+ failed();
+ } else {
+ int hardlink = (getenv("CCACHE_NOCOMPRESS") != 0) && (getenv("CCACHE_HARDLINK") != 0);
+ if (swig) {
+ /* read the list of generated files and copy each of them into the cache */
+ FILE *file;
+ file = fopen(tmp_outfiles, "r");
+ if (file) {
+ char out_filename[FILENAME_MAX + 1];
+ char out_filename_cache[FILENAME_MAX + 1];
+ while (fgets(out_filename, FILENAME_MAX, file)) {
+ char *linefeed = strchr(out_filename, '\n');
+ if (linefeed) {
+ char *potential_cr = linefeed - 1;
+ if (potential_cr >= out_filename && *potential_cr == '\r')
+ *potential_cr = 0;
+ *linefeed = 0;
+
+ if (cached_files_count == 0) {
+ strcpy(out_filename_cache, hashname);
+ } else {
+ sprintf(out_filename_cache, "%s.%d", hashname, cached_files_count);
+ }
+
+ if (commit_to_cache(out_filename, out_filename_cache, hardlink) != 0) {
+ fclose(file);
+ unlink(tmp_outfiles);
+ failed();
+ }
+ to_cache_stats_helper(&st1, out_filename_cache, tmp_outfiles, &files_size, &cached_files_count);
+ } else {
+ cached_files_count = 0;
+ break;
+ }
+ }
+ fclose(file);
+ if (cached_files_count == 0) {
+ cc_log("failed to copy output files to cache - internal error\n");
+ stats_update(STATS_ERROR);
+ unlink(tmp_outfiles);
+ failed();
+ }
+
+ /* also copy the (uncompressed) file containing the list of generated files into the cache */
+ sprintf(out_filename_cache, "%s.outfiles", hashname);
+ if (stat(tmp_outfiles, &st1) != 0 ||
+ safe_rename(tmp_outfiles, out_filename_cache) != 0) {
+ cc_log("failed to copy outfiles file to cache - %s\n", strerror(errno));
+ stats_update(STATS_ERROR);
+ unlink(tmp_outfiles);
+ failed();
+ }
+ to_cache_stats_helper(&st1, out_filename_cache, tmp_outfiles, &files_size, &cached_files_count);
+ unlink(tmp_outfiles);
+ } else {
+ cc_log("failed to open temp outfiles file - %s\n", strerror(errno));
+ stats_update(STATS_ERROR);
+ failed();
+ }
+ } else {
+ if (commit_to_cache(output_file, hashname, hardlink) != 0) {
+ failed();
+ }
+ to_cache_stats_helper(&st1, hashname, 0, &files_size, &cached_files_count);
+ }
+ }
+
+ x_asprintf(&path_stderr, "%s.stderr", hashname);
+
+ if (stat(tmp_stderr, &st1) != 0 ||
+ move_file(tmp_stderr, path_stderr) != 0) {
+ cc_log("failed to rename tmp files - %s\n", strerror(errno));
+ stats_update(STATS_ERROR);
+ failed();
+ }
+
+ to_cache_stats_helper(&st1, path_stderr, 0, &files_size, &cached_files_count);
+
+ cc_log("Placed %d files for %s into cache\n", cached_files_count, input_file);
+ stats_tocache(files_size, cached_files_count);
+
+ free(tmp_stderr);
+ free(tmp_stdout);
+ free(tmp_outfiles);
+ free(path_stderr);
+}
+
+/* find the hash for a command. The hash includes all argument lists,
+ plus the output from running the compiler with -E */
+static void find_hash(ARGS *args)
+{
+ int i;
+ char *path_stdout, *path_stderr;
+ char *hash_dir;
+ char *s;
+ struct stat st;
+ int status;
+ int nlevels = 2;
+ char *input_base;
+ char *tmp;
+
+ if ((s = getenv("CCACHE_NLEVELS"))) {
+ nlevels = atoi(s);
+ if (nlevels < 1) nlevels = 1;
+ if (nlevels > 8) nlevels = 8;
+ }
+
+ hash_start();
+
+ /* when we are doing the unifying tricks we need to include
+ the input file name in the hash to get the warnings right */
+ if (enable_unify || swig) {
+ hash_string(input_file);
+ }
+
+ if (swig) {
+ if (output_file) {
+ hash_string(output_file);
+ }
+ } else {
+ /* we have to hash the extension, as a .i file isn't treated the same
+ by the compiler as a .ii file */
+ hash_string(i_extension);
+ }
+
+ /* first the arguments */
+ for (i=1;iargc;i++) {
+ /* some arguments don't contribute to the hash. The
+ theory is that these arguments will change the
+ output of -E if they are going to have any effect
+ at all, or they only affect linking */
+ if (i < args->argc-1) {
+ if (strcmp(args->argv[i], "-I") == 0 ||
+ strcmp(args->argv[i], "-include") == 0 ||
+ strcmp(args->argv[i], "-L") == 0 ||
+ strcmp(args->argv[i], "-D") == 0 ||
+ strcmp(args->argv[i], "-idirafter") == 0 ||
+ strcmp(args->argv[i], "-isystem") == 0) {
+ i++;
+ continue;
+ }
+ }
+ if (strncmp(args->argv[i], "-I", 2) == 0 ||
+ strncmp(args->argv[i], "-L", 2) == 0 ||
+ strncmp(args->argv[i], "-D", 2) == 0 ||
+ strncmp(args->argv[i], "-idirafter", 10) == 0 ||
+ strncmp(args->argv[i], "-isystem", 8) == 0) {
+ continue;
+ }
+
+ if (strncmp(args->argv[i], "--specs=", 8) == 0 &&
+ stat(args->argv[i]+8, &st) == 0) {
+ /* if given a explicit specs file, then hash that file, but
+ don't include the path to it in the hash */
+ hash_file(args->argv[i]+8);
+ continue;
+ }
+
+ /* all other arguments are included in the hash */
+ hash_string(args->argv[i]);
+ }
+
+ /* the compiler driver size and date. This is a simple minded way
+ to try and detect compiler upgrades. It is not 100% reliable */
+ if (stat(args->argv[0], &st) != 0) {
+ cc_log("Couldn't stat the compiler!? (argv[0]='%s')\n", args->argv[0]);
+ stats_update(STATS_COMPILER);
+ failed();
+ }
+
+ /* also include the hash of the compiler name - as some compilers
+ use hard links and behave differently depending on the real name */
+ if (st.st_nlink > 1) {
+ hash_string(str_basename(args->argv[0]));
+ }
+
+ hash_int(st.st_size);
+ hash_int(st.st_mtime);
+
+ /* possibly hash the current working directory */
+ if (getenv("CCACHE_HASHDIR")) {
+ char *cwd = gnu_getcwd();
+ if (cwd) {
+ hash_string(cwd);
+ free(cwd);
+ }
+ }
+
+ /* ~/hello.c -> tmp.hello.123.i
+ limit the basename to 10
+ characters in order to cope with filesystem with small
+ maximum filename length limits */
+ input_base = str_basename(input_file);
+ tmp = strchr(input_base, '.');
+ if (tmp != NULL) {
+ *tmp = 0;
+ }
+ if (strlen(input_base) > 10) {
+ input_base[10] = 0;
+ }
+
+ /* now the run */
+ x_asprintf(&path_stdout, "%s/%s.tmp.%s.%s", temp_dir,
+ input_base, tmp_string(),
+ i_extension);
+ x_asprintf(&path_stderr, "%s/tmp.cpp_stderr.%s", temp_dir, tmp_string());
+
+ if (!direct_i_file) {
+ /* run cpp on the input file to obtain the .i */
+ args_add(args, "-E");
+ args_add(args, input_file);
+ status = execute(args->argv, path_stdout, path_stderr);
+ args_pop(args, 2);
+ } else {
+ /* we are compiling a .i or .ii file - that means we
+ can skip the cpp stage and directly form the
+ correct i_tmpfile */
+ path_stdout = x_strdup(input_file);
+ if (create_empty_file(path_stderr) != 0) {
+ cc_log("failed to create empty stderr file\n");
+ stats_update(STATS_ERROR);
+ failed();
+ }
+ status = 0;
+ }
+
+ if (status != 0) {
+ if (!direct_i_file) {
+ unlink(path_stdout);
+ }
+ unlink(path_stderr);
+ cc_log("the preprocessor gave %d\n", status);
+ stats_update(STATS_PREPROCESSOR);
+ failed();
+ }
+
+ /* if the compilation is with -g then we have to include the whole of the
+ preprocessor output, which means we are sensitive to line number
+ information. Otherwise we can discard line number info, which makes
+ us less sensitive to reformatting changes
+
+ Note! I have now disabled the unification code by default
+ as it gives the wrong line numbers for warnings. Pity.
+ */
+ if (!enable_unify) {
+ hash_file(path_stdout);
+ } else {
+ if (unify_hash(path_stdout) != 0) {
+ stats_update(STATS_ERROR);
+ failed();
+ }
+ }
+ hash_file(path_stderr);
+
+ i_tmpfile = path_stdout;
+
+ if (!getenv("CCACHE_CPP2")) {
+ /* if we are using the CPP trick then we need to remember this stderr
+ data and output it just before the main stderr from the compiler
+ pass */
+ cpp_stderr = path_stderr;
+ } else {
+ unlink(path_stderr);
+ free(path_stderr);
+ }
+
+ /* we use a N level subdir for the cache path to reduce the impact
+ on filesystems which are slow for large directories
+ */
+ s = hash_result();
+ x_asprintf(&hash_dir, "%s/%c", cache_dir, s[0]);
+ x_asprintf(&stats_file, "%s/stats", hash_dir);
+ for (i=1; i= out_filename && *potential_cr == '\r')
+ *potential_cr = 0;
+ *linefeed = 0;
+
+ if (retrieved_files_count == 0) {
+ strcpy(out_filename_cache, hashname);
+ } else {
+ sprintf(out_filename_cache, "%s.%d", hashname, retrieved_files_count);
+ }
+
+ passfail = retrieve_from_cache(out_filename_cache, out_filename, hardlink);
+ if (passfail == -1) {
+ break;
+ }
+
+ retrieved_files_count++;
+ } else {
+ cc_log("failed to copy output files from cache - internal error\n");
+ stats_update(STATS_ERROR);
+ passfail = -1;
+ break;
+ }
+ }
+ if (retrieved_files_count == 0) {
+ cc_log("failed to copy output files from cache - internal error\n");
+ stats_update(STATS_ERROR);
+ passfail = -1;
+ }
+ fclose(file);
+ } else {
+ cc_log("failed to open cached outfiles file - %s\n", strerror(errno));
+ stats_update(STATS_ERROR);
+ }
+ } else {
+ passfail = retrieve_from_cache(hashname, output_file, hardlink);
+ }
+
+ free(stderr_file);
+ if (passfail == -1) {
+ close(fd_stderr);
+ unlink(stderr_file);
+ return;
+ }
+ }
+
+ /* get rid of the intermediate preprocessor file */
+ if (i_tmpfile) {
+ if (!direct_i_file) {
+ unlink(i_tmpfile);
+ }
+ free(i_tmpfile);
+ i_tmpfile = NULL;
+ }
+
+ /* send the cpp stderr, if applicable */
+ fd_cpp_stderr = open(cpp_stderr, O_RDONLY | O_BINARY);
+ if (fd_cpp_stderr != -1) {
+ copy_fd(fd_cpp_stderr, 2);
+ close(fd_cpp_stderr);
+ unlink(cpp_stderr);
+ free(cpp_stderr);
+ cpp_stderr = NULL;
+ }
+
+ /* send the stderr */
+ copy_fd(fd_stderr, 2);
+ close(fd_stderr);
+
+ /* and exit with the right status code */
+ if (first) {
+ cc_log("got cached result for %s\n", input_file);
+ stats_update(STATS_CACHED);
+ }
+
+ exit(0);
+}
+
+/* find the real compiler. We just search the PATH to find a executable of the
+ same name that isn't a link to ourselves */
+static void find_compiler(int argc, char **argv)
+{
+ char *base;
+ char *path;
+
+ orig_args = args_init(argc, argv);
+
+ base = str_basename(argv[0]);
+
+ /* we might be being invoked like "ccache gcc -c foo.c" */
+ if (strcmp(base, MYNAME) == 0) {
+ args_remove_first(orig_args);
+ free(base);
+ if (strchr(argv[1],'/')
+#ifdef _WIN32
+ || strchr(argv[1],'\\')
+#endif
+ ) {
+ /* a full path was given */
+ return;
+ }
+ base = str_basename(argv[1]);
+ }
+
+ /* support user override of the compiler */
+ if ((path=getenv("CCACHE_CC"))) {
+ base = x_strdup(path);
+ }
+
+ orig_args->argv[0] = find_executable(base, MYNAME);
+
+ /* can't find the compiler! */
+ if (!orig_args->argv[0]) {
+ stats_update(STATS_COMPILER);
+ cc_log("could not find compiler (%s)\n", base);
+ perror(base);
+ exit(1);
+ }
+}
+
+
+/* check a filename for C/C++ extension. Return the pre-processor
+ extension */
+static const char *check_extension(const char *fname, int *direct_i)
+{
+ int i;
+ const char *p;
+
+ if (direct_i) {
+ *direct_i = 0;
+ }
+
+ if (swig) return "ii"; /* any file extension is acceptable as input for SWIG */
+
+ p = strrchr(fname, '.');
+ if (!p) return NULL;
+ p++;
+ for (i=0; extensions[i].extension; i++) {
+ if (strcmp(p, extensions[i].extension) == 0) {
+ if (direct_i && strcmp(p, extensions[i].i_extension) == 0) {
+ *direct_i = 1;
+ }
+ p = getenv("CCACHE_EXTENSION");
+ if (p) return p;
+ return extensions[i].i_extension;
+ }
+ }
+ return NULL;
+}
+
+
+/*
+ process the compiler options to form the correct set of options
+ for obtaining the preprocessor output
+*/
+static void process_args(int argc, char **argv)
+{
+ int i;
+ int found_c_opt = 0;
+ int found_S_opt = 0;
+ struct stat st;
+ char *e;
+ /* is gcc being asked to output dependencies? */
+ int generating_dependencies = 0;
+ /* is the dependency makefile name overridden with -MF? */
+ int dependency_filename_specified = 0;
+ /* is the dependency makefile target name specified with -MQ or -MF? */
+ int dependency_target_specified = 0;
+
+
+ stripped_args = args_init(0, NULL);
+
+ args_add(stripped_args, argv[0]);
+
+ /* -c not required for SWIG */
+ if (swig) {
+ found_c_opt = 1;
+ }
+
+ for (i=1; iargv[0]);
+ if (strstr(basename, "swig") || getenv("CCACHE_SWIG")) {
+ swig = 1;
+ }
+ free(basename);
+}
+
+/* the main ccache driver function */
+static void ccache(int argc, char *argv[])
+{
+ /* find the real compiler */
+ find_compiler(argc, argv);
+
+ /* use the real compiler if HOME is not set */
+ if (!cache_dir) {
+ cc_log("Unable to determine home directory\n");
+ cc_log("ccache is disabled\n");
+ failed();
+ }
+
+ /* we might be disabled */
+ if (getenv("CCACHE_DISABLE")) {
+ cc_log("ccache is disabled\n");
+ failed();
+ }
+
+ if (getenv("CCACHE_STRIPC")) {
+ strip_c_option = 1;
+ }
+
+ if (getenv("CCACHE_UNIFY")) {
+ enable_unify = 1;
+ }
+
+ detect_swig();
+
+ /* process argument list, returning a new set of arguments for pre-processing */
+ process_args(orig_args->argc, orig_args->argv);
+
+ /* run with -E to find the hash */
+ find_hash(stripped_args);
+
+ /* if we can return from cache at this point then do */
+ from_cache(1);
+
+ if (getenv("CCACHE_READONLY")) {
+ cc_log("read-only set - doing real compile\n");
+ failed();
+ }
+
+ /* run real compiler, sending output to cache */
+ to_cache(stripped_args);
+
+ /* return from cache */
+ from_cache(0);
+
+ /* oh oh! */
+ cc_log("secondary from_cache failed!\n");
+ stats_update(STATS_ERROR);
+ failed();
+}
+
+
+static void usage(void)
+{
+ printf("%s, a compiler cache including support for SWIG. Version %s\n", MYNAME, CCACHE_VERSION);
+ printf("Copyright Andrew Tridgell, 2002\n\n");
+
+ printf("Usage:\n");
+ printf("\t" MYNAME " [options]\n");
+ printf("\t" MYNAME " compiler [compile options]\n");
+ printf("\tcompiler [compile options] (via symbolic link)\n");
+ printf("\nOptions:\n");
+
+ printf("-s show statistics summary\n");
+ printf("-z zero statistics\n");
+ printf("-c run a cache cleanup\n");
+ printf("-C clear the cache completely\n");
+ printf("-F set maximum files in cache\n");
+ printf("-M set maximum size of cache (use G, M or K)\n");
+ printf("-h this help page\n");
+ printf("-V print version number\n");
+}
+
+static void check_cache_dir(void)
+{
+ if (!cache_dir) {
+ fatal("Unable to determine home directory");
+ }
+}
+
+/* the main program when not doing a compile */
+static int ccache_main(int argc, char *argv[])
+{
+ int c;
+ size_t v;
+
+ while ((c = getopt(argc, argv, "hszcCF:M:V")) != -1) {
+ switch (c) {
+ case 'V':
+ printf("%s version %s\n", MYNAME, CCACHE_VERSION);
+ printf("Copyright Andrew Tridgell 2002\n");
+ printf("Released under the GNU GPL v2 or later\n");
+ exit(0);
+
+ case 'h':
+ usage();
+ exit(0);
+
+ case 's':
+ check_cache_dir();
+ stats_summary();
+ break;
+
+ case 'c':
+ check_cache_dir();
+ cleanup_all(cache_dir);
+ printf("Cleaned cache\n");
+ break;
+
+ case 'C':
+ check_cache_dir();
+ wipe_all(cache_dir);
+ printf("Cleared cache\n");
+ break;
+
+ case 'z':
+ check_cache_dir();
+ stats_zero();
+ printf("Statistics cleared\n");
+ break;
+
+ case 'F':
+ check_cache_dir();
+ v = atoi(optarg);
+ if (stats_set_limits(v, -1) == 0) {
+ printf("Set cache file limit to %u\n", (unsigned)v);
+ } else {
+ printf("Could not set cache file limit.\n");
+ exit(1);
+ }
+ break;
+
+ case 'M':
+ check_cache_dir();
+ v = value_units(optarg);
+ if (stats_set_limits(-1, v) == 0) {
+ printf("Set cache size limit to %uk\n", (unsigned)v);
+ } else {
+ printf("Could not set cache size limit.\n");
+ exit(1);
+ }
+ break;
+
+ default:
+ usage();
+ exit(1);
+ }
+ }
+
+ return 0;
+}
+
+
+/* Make a copy of stderr that will not be cached, so things like
+ distcc can send networking errors to it. */
+static void setup_uncached_err(void)
+{
+ char *buf;
+ int uncached_fd;
+
+ uncached_fd = dup(2);
+ if (uncached_fd == -1) {
+ cc_log("dup(2) failed\n");
+ stats_update(STATS_ERROR);
+ failed();
+ }
+
+ /* leak a pointer to the environment */
+ x_asprintf(&buf, "UNCACHED_ERR_FD=%d", uncached_fd);
+
+ if (putenv(buf) == -1) {
+ cc_log("putenv failed\n");
+ stats_update(STATS_ERROR);
+ failed();
+ }
+}
+
+
+int main(int argc, char *argv[])
+{
+ char *p;
+
+ cache_dir = getenv("CCACHE_DIR");
+ if (!cache_dir) {
+ const char *home_directory = get_home_directory();
+ if (home_directory) {
+ x_asprintf(&cache_dir, "%s/.ccache", home_directory);
+ }
+ }
+
+ cache_logfile = getenv("CCACHE_LOGFILE");
+
+ if (getenv("CCACHE_VERBOSE")) {
+ ccache_verbose = 1;
+ }
+
+ setup_uncached_err();
+
+
+ /* the user might have set CCACHE_UMASK */
+ p = getenv("CCACHE_UMASK");
+ if (p) {
+ mode_t mask;
+ errno = 0;
+ mask = strtol(p, NULL, 8);
+ if (errno == 0) {
+ umask(mask);
+ }
+ }
+
+
+ /* check if we are being invoked as "ccache" */
+ if (strlen(argv[0]) >= strlen(MYNAME) &&
+ strcmp(argv[0] + strlen(argv[0]) - strlen(MYNAME), MYNAME) == 0) {
+ if (argc < 2) {
+ usage();
+ exit(1);
+ }
+ /* if the first argument isn't an option, then assume we are
+ being passed a compiler name and options */
+ if (argv[1][0] == '-') {
+ return ccache_main(argc, argv);
+ }
+ }
+
+ /* make sure the cache dir exists */
+ if (cache_dir && (create_dir(cache_dir) != 0)) {
+ fprintf(stderr,"ccache: failed to create %s (%s)\n",
+ cache_dir, strerror(errno));
+ exit(1);
+ }
+
+ temp_dir = getenv("CCACHE_TEMPDIR");
+ if (!temp_dir) {
+ x_asprintf(&temp_dir, "%s/temp", cache_dir);
+ /* make sure temp dir exists if not supplied by user */
+ if (temp_dir && create_dir(temp_dir) != 0) {
+ fprintf(stderr,"ccache: failed to create %s (%s)\n",
+ temp_dir, strerror(errno));
+ exit(1);
+ }
+ }
+
+ if (!getenv("CCACHE_READONLY")) {
+ if (create_cachedirtag(cache_dir) != 0) {
+ fprintf(stderr,"ccache: failed to create %s/CACHEDIR.TAG (%s)\n",
+ cache_dir, strerror(errno));
+ exit(1);
+ }
+ }
+
+ ccache(argc, argv);
+ return 1;
+}
diff --git a/CCache/ccache.h b/CCache/ccache.h
new file mode 100644
index 000000000..668ce8288
--- /dev/null
+++ b/CCache/ccache.h
@@ -0,0 +1,205 @@
+#include "ccache_swig_config.h"
+
+#define CCACHE_VERSION SWIG_VERSION
+
+#ifndef _WIN32
+#include "config.h"
+#else
+#include
+#define PACKAGE_NAME "ccache-swig.exe"
+#endif
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#ifndef _WIN32
+ #include
+ #include
+#else
+#define _WIN32_WINNT 0x0500
+ #include
+ #include
+#endif
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#ifdef HAVE_PWD_H
+#include
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include
+#endif
+
+#ifdef ENABLE_ZLIB
+#include
+#endif
+
+#define STATUS_NOTFOUND 3
+#define STATUS_FATAL 4
+#define STATUS_NOCACHE 5
+
+#define MYNAME PACKAGE_NAME
+
+#define LIMIT_MULTIPLE 0.8
+
+/* default maximum cache size */
+#ifndef DEFAULT_MAXSIZE
+#define DEFAULT_MAXSIZE (1000*1000)
+#endif
+
+/* file copy mode */
+#ifdef ENABLE_ZLIB
+#define COPY_UNCOMPRESSED 0
+#define COPY_FROM_CACHE 1
+#define COPY_TO_CACHE 2
+#endif
+
+enum stats {
+ STATS_NONE=0,
+ STATS_STDOUT,
+ STATS_STATUS,
+ STATS_ERROR,
+ STATS_TOCACHE,
+ STATS_PREPROCESSOR,
+ STATS_COMPILER,
+ STATS_MISSING,
+ STATS_CACHED,
+ STATS_ARGS,
+ STATS_LINK,
+ STATS_NUMFILES,
+ STATS_TOTALSIZE,
+ STATS_MAXFILES,
+ STATS_MAXSIZE,
+ STATS_NOTC,
+ STATS_DEVICE,
+ STATS_NOINPUT,
+ STATS_ENVIRONMMENT,
+ STATS_MULTIPLE,
+ STATS_CONFTEST,
+ STATS_UNSUPPORTED,
+ STATS_OUTSTDOUT,
+
+ STATS_END
+};
+
+typedef unsigned uint32;
+
+#include "mdfour.h"
+
+void hash_start(void);
+void hash_string(const char *s);
+void hash_int(int x);
+void hash_file(const char *fname);
+char *hash_result(void);
+void hash_buffer(const char *s, int len);
+
+void cc_log(const char *format, ...);
+void fatal(const char *msg);
+
+void copy_fd(int fd_in, int fd_out);
+int safe_rename(const char* oldpath, const char* newpath);
+int move_file(const char *src, const char *dest);
+int test_if_compressed(const char *filename);
+
+int commit_to_cache(const char *src, const char *dest, int hardlink);
+int retrieve_from_cache(const char *src, const char *dest, int hardlink);
+
+int create_dir(const char *dir);
+int create_cachedirtag(const char *dir);
+void x_asprintf(char **ptr, const char *format, ...);
+char *x_strdup(const char *s);
+void *x_realloc(void *ptr, size_t size);
+void *x_malloc(size_t size);
+void traverse(const char *dir, void (*fn)(const char *, struct stat *));
+char *str_basename(const char *s);
+char *dirname(char *s);
+int lock_fd(int fd);
+size_t file_size(struct stat *st);
+int safe_open(const char *fname);
+char *x_realpath(const char *path);
+char *gnu_getcwd(void);
+int create_empty_file(const char *fname);
+const char *get_home_directory(void);
+int x_utimes(const char *filename);
+#ifdef _WIN32
+void perror_win32(LPTSTR pszFunction);
+#endif
+
+void stats_update(enum stats stat);
+void stats_zero(void);
+void stats_summary(void);
+void stats_tocache(size_t size, size_t numfiles);
+void stats_read(const char *stats_file, unsigned counters[STATS_END]);
+int stats_set_limits(long maxfiles, long maxsize);
+size_t value_units(const char *s);
+void display_size(unsigned v);
+void stats_set_sizes(const char *dir, size_t num_files, size_t total_size);
+
+int unify_hash(const char *fname);
+
+#ifndef HAVE_VASPRINTF
+int vasprintf(char **, const char *, va_list );
+#endif
+#ifndef HAVE_ASPRINTF
+int asprintf(char **ptr, const char *format, ...);
+#endif
+
+#ifndef HAVE_SNPRINTF
+int snprintf(char *,size_t ,const char *, ...);
+#endif
+
+void cleanup_dir(const char *dir, size_t maxfiles, size_t maxsize);
+void cleanup_all(const char *dir);
+void wipe_all(const char *dir);
+
+#ifdef _WIN32
+char *argvtos(char **argv);
+#endif
+int execute(char **argv,
+ const char *path_stdout,
+ const char *path_stderr);
+char *find_executable(const char *name, const char *exclude_name);
+void display_execute_args(char **argv);
+
+typedef struct {
+ char **argv;
+ int argc;
+} ARGS;
+
+
+ARGS *args_init(int , char **);
+void args_add(ARGS *args, const char *s);
+void args_add_prefix(ARGS *args, const char *s);
+void args_pop(ARGS *args, int n);
+void args_strip(ARGS *args, const char *prefix);
+void args_remove_first(ARGS *args);
+
+extern int ccache_verbose;
+
+#if HAVE_COMPAR_FN_T
+#define COMPAR_FN_T __compar_fn_t
+#else
+typedef int (*COMPAR_FN_T)(const void *, const void *);
+#endif
+
+/* work with silly DOS binary open */
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
+/* mkstemp() on some versions of cygwin don't handle binary files, so
+ override */
+#ifdef __CYGWIN__
+#undef HAVE_MKSTEMP
+#endif
diff --git a/CCache/ccache.yo b/CCache/ccache.yo
new file mode 100644
index 000000000..2477662dc
--- /dev/null
+++ b/CCache/ccache.yo
@@ -0,0 +1,422 @@
+whenman(
+COMMENT(html output not great if included when using html2doc)
+manpage(ccache-swig)(1)()()()
+)
+
+whenhtml(htmlcommand(
+
+
+
+
+ccache-swig(1) manpage
+
+
+
+
+
NOTE! This release changes the hash input slighly, so you will
+ probably find that you will not get any hits against your existing
+@@ -87,7 +87,7 @@
+
+
+
+ For the bleeding edge, you can fetch ccache via CVS or
+ rsync. To fetch via cvs use the following command:
diff --git a/CCache/debian/patches/14_hardlink_doc.diff b/CCache/debian/patches/14_hardlink_doc.diff
new file mode 100644
index 000000000..bd9e25ba6
--- /dev/null
+++ b/CCache/debian/patches/14_hardlink_doc.diff
@@ -0,0 +1,48 @@
+Index: ccache.1
+===================================================================
+RCS file: /cvsroot/ccache/ccache.1,v
+retrieving revision 1.26
+diff -u -r1.26 ccache.1
+--- ccache.1 24 Nov 2005 21:10:08 -0000 1.26
++++ ccache.1 21 Jul 2007 21:03:32 -0000
+@@ -330,7 +330,7 @@
+ .IP o
+ Use the same \fBCCACHE_DIR\fP environment variable setting
+ .IP o
+-Set the \fBCCACHE_NOLINK\fP environment variable
++Unset the \fBCCACHE_HARDLINK\fP environment variable
+ .IP o
+ Make sure everyone sets the CCACHE_UMASK environment variable
+ to 002, this ensures that cached files are accessible to everyone in
+Index: ccache.yo
+===================================================================
+RCS file: /cvsroot/ccache/ccache.yo,v
+retrieving revision 1.27
+diff -u -r1.27 ccache.yo
+--- ccache.yo 24 Nov 2005 21:54:09 -0000 1.27
++++ ccache.yo 21 Jul 2007 21:03:32 -0000
+@@ -289,7 +289,7 @@
+
+ itemize(
+ it() Use the same bf(CCACHE_DIR) environment variable setting
+- it() Set the bf(CCACHE_NOLINK) environment variable
++ it() Unset the bf(CCACHE_HARDLINK) environment variable
+ it() Make sure everyone sets the CCACHE_UMASK environment variable
+ to 002, this ensures that cached files are accessible to everyone in
+ the group.
+Index: web/ccache-man.html
+===================================================================
+RCS file: /cvsroot/ccache/web/ccache-man.html,v
+retrieving revision 1.25
+diff -u -r1.25 ccache-man.html
+--- web/ccache-man.html 13 Sep 2004 10:38:17 -0000 1.25
++++ web/ccache-man.html 21 Jul 2007 21:03:32 -0000
+@@ -256,7 +256,7 @@
+ following conditions need to be met:
+
+
Use the same CCACHE_DIR environment variable setting
+-
Set the CCACHE_NOLINK environment variable
++
Unset the CCACHE_HARDLINK environment variable
+
Make sure everyone sets the CCACHE_UMASK environment variable
+ to 002, this ensures that cached files are accessible to everyone in
+ the group.
diff --git a/CCache/debian/patches/CREDITS b/CCache/debian/patches/CREDITS
new file mode 100644
index 000000000..c4e323b7b
--- /dev/null
+++ b/CCache/debian/patches/CREDITS
@@ -0,0 +1,47 @@
+01_no_home.diff:
+ Francois Marier
+ Made especially for the Debian package.
+
+02_ccache_compressed.diff:
+ Lars Gustäbel
+ http://www.gustaebel.de/lars/ccache/ (downloaded on 2007-05-20)
+
+03_long_options.diff:
+ Francois Marier
+ Made especially for the Debian package.
+
+04_ignore_profile.diff:
+ Ted Percival
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=20;filename=ccache-profile.patch;att=1;bug=215849
+
+05_nfs_fix.diff:
+ John Coiner
+ http://lists.samba.org/archive/ccache/2007q1/000265.html
+
+06_md.diff:
+ Andrea Bittau
+ http://darkircop.org/ccache/ccache-2.4-md.patch (downloaded on 2007-06-30)
+
+07_cachedirtag.diff:
+ Karl Chen
+ http://lists.samba.org/archive/ccache/2008q1/000316.html (downloaded on 2008-02-02)
+
+08_manpage_hyphens.diff:
+ Francois Marier
+ Made especially for the Debian package.
+
+09_respect_ldflags.diff:
+ Lisa Seelye
+ http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/ccache/files/ccache-2.4-respectflags.patch?rev=1.1&view=markup
+
+10_lru_cleanup.diff:
+ RW
+ http://lists.samba.org/archive/ccache/2008q2/000339.html (downloaded on 2008-04-11)
+
+11_utimes.diff:
+ Robin H. Johnson
+ http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/ccache/files/ccache-2.4-utimes.patch?rev=1.1&view=markup
+
+12_cachesize_permissions.diff:
+ Francois Marier
+ Made especially for the Debian package to fix http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=332527
diff --git a/CCache/debian/rules b/CCache/debian/rules
new file mode 100644
index 000000000..c5b538b78
--- /dev/null
+++ b/CCache/debian/rules
@@ -0,0 +1,141 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# These are used for cross-compiling and for saving the configure script
+# from having to guess our platform (since we know it already)
+export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
+ confflags += --build $(DEB_HOST_GNU_TYPE)
+else
+ confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
+endif
+
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+ CFLAGS += -g
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+ INSTALL_PROGRAM += -s
+endif
+
+config.status: configure
+ dh_testdir
+
+ # Apply Debian specific patches
+ cp $(CURDIR)/ccache.c $(CURDIR)/ccache.c.unpatched
+ cp $(CURDIR)/util.c $(CURDIR)/util.c.unpatched
+ cp $(CURDIR)/ccache.1 $(CURDIR)/ccache.1.unpatched
+ cp $(CURDIR)/ccache.h $(CURDIR)/ccache.h.unpatched
+ cp $(CURDIR)/ccache.yo $(CURDIR)/ccache.yo.unpatched
+ cp $(CURDIR)/config.h.in $(CURDIR)/config.h.in.unpatched
+ cp $(CURDIR)/configure $(CURDIR)/configure.unpatched
+ cp $(CURDIR)/configure.in $(CURDIR)/configure.in.unpatched
+ cp $(CURDIR)/Makefile.in $(CURDIR)/Makefile.in.unpatched
+ if test ! -f patch-stamp; then \
+ for patch in $(CURDIR)/debian/patches/*.diff ;\
+ do \
+ echo APPLYING PATCH\: $${patch##*/};\
+ patch -p0 < $$patch ;\
+ done ;\
+ touch patch-stamp ;\
+ fi
+ chmod +x $(CURDIR)/manage-cache.sh
+
+ ./configure $(confflags) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info
+
+build: build-stamp
+
+build-stamp: config.status
+ dh_testdir
+
+ $(MAKE)
+
+ touch build-stamp
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp
+
+ # Unapply patches
+ -test -r $(CURDIR)/ccache.c.unpatched && mv $(CURDIR)/ccache.c.unpatched $(CURDIR)/ccache.c
+ -test -r $(CURDIR)/util.c.unpatched && mv $(CURDIR)/util.c.unpatched $(CURDIR)/util.c
+ -test -r $(CURDIR)/ccache.1.unpatched && mv $(CURDIR)/ccache.1.unpatched $(CURDIR)/ccache.1
+ -test -r $(CURDIR)/ccache.h.unpatched && mv $(CURDIR)/ccache.h.unpatched $(CURDIR)/ccache.h
+ -test -r $(CURDIR)/ccache.yo.unpatched && mv $(CURDIR)/ccache.yo.unpatched $(CURDIR)/ccache.yo
+ -test -r $(CURDIR)/config.h.in.unpatched && mv $(CURDIR)/config.h.in.unpatched $(CURDIR)/config.h.in
+ -test -r $(CURDIR)/configure.unpatched && mv $(CURDIR)/configure.unpatched $(CURDIR)/configure
+ -test -r $(CURDIR)/configure.in.unpatched && mv $(CURDIR)/configure.in.unpatched $(CURDIR)/configure.in
+ -test -r $(CURDIR)/Makefile.in.unpatched && mv $(CURDIR)/Makefile.in.unpatched $(CURDIR)/Makefile.in
+ -rm -f $(CURDIR)/manage-cache.sh
+ -rm -f patch-stamp
+
+ [ ! -f Makefile ] || $(MAKE) distclean
+
+ dh_clean
+
+ # Update config.sub and config.guess
+ -test -r /usr/share/misc/config.sub && \
+ cp -f /usr/share/misc/config.sub config.sub
+ -test -r /usr/share/misc/config.guess && \
+ cp -f /usr/share/misc/config.guess config.guess
+
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the package into debian/ccache.
+ $(MAKE) install prefix=$(CURDIR)/debian/ccache/usr
+
+ ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/$(DEB_BUILD_GNU_TYPE)-gcc
+ ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/$(DEB_BUILD_GNU_TYPE)-g++
+ set -e; for ver in 2.95 3.0 3.2 3.3 3.4 4.0 4.1 4.2 4.3; do \
+ ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/$(DEB_BUILD_GNU_TYPE)-gcc-$$ver; \
+ ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/gcc-$$ver; \
+ ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/$(DEB_BUILD_GNU_TYPE)-g++-$$ver; \
+ ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/g++-$$ver; \
+ done
+ ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/cc
+ ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/c++
+ ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/gcc
+ ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/g++
+ ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/i586-mingw32msvc-c++
+ ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/i586-mingw32msvc-cc
+ ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/i586-mingw32msvc-g++
+ ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/i586-mingw32msvc-gcc
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installdocs
+ dh_installexamples
+ dh_installmenu
+ dh_installcron
+ dh_installman
+ dh_installinfo
+ dh_installchangelogs
+ dh_link
+ dh_strip
+ dh_compress
+ dh_fixperms
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install
diff --git a/CCache/debian/update-ccache b/CCache/debian/update-ccache
new file mode 100644
index 000000000..0ef97a140
--- /dev/null
+++ b/CCache/debian/update-ccache
@@ -0,0 +1,43 @@
+#!/bin/sh
+#
+# Update compiler links to ccache (in /usr/local/bin)
+#
+# The idea is that /usr/local/bin is ahead of /usr/bin in your PATH, so adding
+# the link /usr/local/bin/cc -> /usr/bin/ccache means that it is run instead of
+# /usr/bin/cc
+#
+# Written by: Behan Webster
+#
+
+DIRECTORY=/usr/local/bin
+CCACHE=/usr/bin/ccache
+CCDIR=/usr/lib/ccache
+
+usage() {
+ echo "Usage: `basename $0` [--directory ] [--remove]"
+ exit 0
+}
+
+while [ $# -gt 0 ] ; do
+ case "$1" in
+ -d*|--d*|--directory) DIRECTORY=$2; shift; shift;;
+ -h*|--h*|--help) usage;;
+ -r*|--r*|--remove) REMOVE=1; shift;;
+ -t*|--t*|--test) TEST=echo; shift;;
+ esac
+done
+
+for FILE in `cd $CCDIR; ls` ; do
+ LINK=$DIRECTORY/$FILE
+ if [ -z "$REMOVE" ] ; then
+ # Add link
+ $TEST ln -fs $CCACHE $LINK
+ else
+ # Remove link
+ if [ -L "$LINK" ] ; then
+ $TEST rm -f $LINK
+ fi
+ fi
+done
+
+# vim: sw=4 ts=4
diff --git a/CCache/debian/watch b/CCache/debian/watch
new file mode 100644
index 000000000..a72959e50
--- /dev/null
+++ b/CCache/debian/watch
@@ -0,0 +1,2 @@
+version=2
+http://samba.org/ftp/ccache/ccache-(.*)\.tar\.gz
diff --git a/CCache/execute.c b/CCache/execute.c
new file mode 100644
index 000000000..165b91e66
--- /dev/null
+++ b/CCache/execute.c
@@ -0,0 +1,286 @@
+/*
+ Copyright (C) Andrew Tridgell 2002
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "ccache.h"
+
+#ifdef _WIN32
+char *argvtos(char **argv)
+{
+ int i, len;
+ char *ptr, *str;
+
+ for (i = 0, len = 0; argv[i]; i++) {
+ len += strlen(argv[i]) + 3;
+ }
+
+ str = ptr = (char *)malloc(len + 1);
+ if (str == NULL)
+ return NULL;
+
+ for (i = 0; argv[i]; i++) {
+ len = strlen(argv[i]);
+ *ptr++ = '"';
+ memcpy(ptr, argv[i], len);
+ ptr += len;
+ *ptr++ = '"';
+ *ptr++ = ' ';
+ }
+ *ptr = 0;
+
+ return str;
+}
+#endif
+
+/*
+ execute a compiler backend, capturing all output to the given paths
+ the full path to the compiler to run is in argv[0]
+*/
+int execute(char **argv,
+ const char *path_stdout,
+ const char *path_stderr)
+{
+#ifdef _WIN32
+
+#if 1
+ PROCESS_INFORMATION pinfo;
+ STARTUPINFO sinfo;
+ BOOL ret;
+ DWORD exitcode;
+ char *args;
+ HANDLE fd_out, fd_err;
+ SECURITY_ATTRIBUTES sa = {sizeof(SECURITY_ATTRIBUTES), NULL, TRUE};
+
+ /* TODO: needs moving after possible exit() below, but before stdout is redirected */
+ if (ccache_verbose) {
+ display_execute_args(argv);
+ }
+
+ fd_out = CreateFile(path_stdout, GENERIC_WRITE, 0, &sa, CREATE_ALWAYS,
+ FILE_ATTRIBUTE_NORMAL, NULL);
+ if (fd_out == INVALID_HANDLE_VALUE) {
+ return STATUS_NOCACHE;
+ }
+
+ fd_err = CreateFile(path_stderr, GENERIC_WRITE, 0, &sa, CREATE_ALWAYS,
+ FILE_ATTRIBUTE_NORMAL, NULL);
+ if (fd_err == INVALID_HANDLE_VALUE) {
+ return STATUS_NOCACHE;
+ }
+
+ ZeroMemory(&pinfo, sizeof(PROCESS_INFORMATION));
+ ZeroMemory(&sinfo, sizeof(STARTUPINFO));
+
+ sinfo.cb = sizeof(STARTUPINFO);
+ sinfo.hStdError = fd_err;
+ sinfo.hStdOutput = fd_out;
+ sinfo.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
+ sinfo.dwFlags |= STARTF_USESTDHANDLES;
+
+ args = argvtos(argv);
+
+ ret = CreateProcessA(argv[0], args, NULL, NULL, TRUE, 0, NULL, NULL,
+ &sinfo, &pinfo);
+
+ free(args);
+ CloseHandle(fd_out);
+ CloseHandle(fd_err);
+
+ if (ret == 0)
+ return -1;
+
+ WaitForSingleObject(pinfo.hProcess, INFINITE);
+ GetExitCodeProcess(pinfo.hProcess, &exitcode);
+ CloseHandle(pinfo.hProcess);
+ CloseHandle(pinfo.hThread);
+
+ return exitcode;
+#else /* possibly slightly faster */
+ /* needs fixing to quote commandline options to handle spaces in CCACHE_DIR etc */
+ int status = -2;
+ int fd, std_od = -1, std_ed = -1;
+
+ /* TODO: needs moving after possible exit() below, but before stdout is redirected */
+ if (ccache_verbose) {
+ display_execute_args(argv);
+ }
+
+ unlink(path_stdout);
+ std_od = _dup(1);
+ fd = _open(path_stdout, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL|O_BINARY, 0666);
+ if (fd == -1) {
+ exit(STATUS_NOCACHE);
+ }
+ _dup2(fd, 1);
+ _close(fd);
+
+ unlink(path_stderr);
+ fd = _open(path_stderr, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL|O_BINARY, 0666);
+ std_ed = _dup(2);
+ if (fd == -1) {
+ exit(STATUS_NOCACHE);
+ }
+ _dup2(fd, 2);
+ _close(fd);
+
+ /* Spawn process (_exec* familly doesn't return) */
+ status = _spawnv(_P_WAIT, argv[0], (const char **)argv);
+
+ /* Restore descriptors */
+ if (std_od != -1) _dup2(std_od, 1);
+ if (std_ed != -1) _dup2(std_ed, 2);
+ _flushall();
+
+ return (status>0);
+
+#endif
+
+#else
+ pid_t pid;
+ int status;
+
+ pid = fork();
+ if (pid == -1) fatal("Failed to fork");
+
+ if (pid == 0) {
+ int fd;
+
+ /* TODO: needs moving after possible exit() below, but before stdout is redirected */
+ if (ccache_verbose) {
+ display_execute_args(argv);
+ }
+
+ unlink(path_stdout);
+ fd = open(path_stdout, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL|O_BINARY, 0666);
+ if (fd == -1) {
+ exit(STATUS_NOCACHE);
+ }
+ dup2(fd, 1);
+ close(fd);
+
+ unlink(path_stderr);
+ fd = open(path_stderr, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL|O_BINARY, 0666);
+ if (fd == -1) {
+ exit(STATUS_NOCACHE);
+ }
+ dup2(fd, 2);
+ close(fd);
+
+ exit(execv(argv[0], argv));
+ }
+
+ if (waitpid(pid, &status, 0) != pid) {
+ fatal("waitpid failed");
+ }
+
+ if (WEXITSTATUS(status) == 0 && WIFSIGNALED(status)) {
+ return -1;
+ }
+
+ return WEXITSTATUS(status);
+#endif
+}
+
+
+/*
+ find an executable by name in $PATH. Exclude any that are links to exclude_name
+*/
+char *find_executable(const char *name, const char *exclude_name)
+{
+#if _WIN32
+ (void)exclude_name;
+ DWORD ret;
+ char namebuf[MAX_PATH];
+
+ ret = SearchPathA(getenv("CCACHE_PATH"), name, ".exe",
+ sizeof(namebuf), namebuf, NULL);
+ if (ret != 0) {
+ return x_strdup(namebuf);
+ }
+
+ return NULL;
+#else
+ char *path;
+ char *tok;
+ struct stat st1, st2;
+
+ if (*name == '/') {
+ return x_strdup(name);
+ }
+
+ path = getenv("CCACHE_PATH");
+ if (!path) {
+ path = getenv("PATH");
+ }
+ if (!path) {
+ cc_log("no PATH variable!?\n");
+ stats_update(STATS_ENVIRONMMENT);
+ return NULL;
+ }
+
+ path = x_strdup(path);
+
+ /* search the path looking for the first compiler of the right name
+ that isn't us */
+ for (tok=strtok(path,":"); tok; tok = strtok(NULL, ":")) {
+ char *fname;
+ x_asprintf(&fname, "%s/%s", tok, name);
+ /* look for a normal executable file */
+ if (access(fname, X_OK) == 0 &&
+ lstat(fname, &st1) == 0 &&
+ stat(fname, &st2) == 0 &&
+ S_ISREG(st2.st_mode)) {
+ /* if its a symlink then ensure it doesn't
+ point at something called exclude_name */
+ if (S_ISLNK(st1.st_mode)) {
+ char *buf = x_realpath(fname);
+ if (buf) {
+ char *p = str_basename(buf);
+ if (strcmp(p, exclude_name) == 0) {
+ /* its a link to "ccache" ! */
+ free(p);
+ free(buf);
+ continue;
+ }
+ free(buf);
+ free(p);
+ }
+ }
+
+ /* found it! */
+ free(path);
+ return fname;
+ }
+ free(fname);
+ }
+
+ return NULL;
+#endif
+}
+
+void display_execute_args(char **argv)
+{
+ if (argv) {
+ printf("ccache executing: ");
+ while (*argv) {
+ printf("%s ", *argv);
+ ++argv;
+ }
+ printf("\n");
+ fflush(stdout);
+ }
+}
diff --git a/CCache/hash.c b/CCache/hash.c
new file mode 100644
index 000000000..d0ce8a6ba
--- /dev/null
+++ b/CCache/hash.c
@@ -0,0 +1,80 @@
+/*
+ Copyright (C) Andrew Tridgell 2002
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+/*
+ simple front-end functions to mdfour code
+*/
+
+#include "ccache.h"
+
+static struct mdfour md;
+
+void hash_buffer(const char *s, int len)
+{
+ mdfour_update(&md, (unsigned char *)s, len);
+}
+
+void hash_start(void)
+{
+ mdfour_begin(&md);
+}
+
+void hash_string(const char *s)
+{
+ hash_buffer(s, strlen(s));
+}
+
+void hash_int(int x)
+{
+ hash_buffer((char *)&x, sizeof(x));
+}
+
+/* add contents of a file to the hash */
+void hash_file(const char *fname)
+{
+ char buf[1024];
+ int fd, n;
+
+ fd = open(fname, O_RDONLY|O_BINARY);
+ if (fd == -1) {
+ cc_log("Failed to open %s\n", fname);
+ fatal("hash_file");
+ }
+
+ while ((n = read(fd, buf, sizeof(buf))) > 0) {
+ hash_buffer(buf, n);
+ }
+ close(fd);
+}
+
+/* return the hash result as a static string */
+char *hash_result(void)
+{
+ unsigned char sum[16];
+ static char ret[53];
+ int i;
+
+ hash_buffer(NULL, 0);
+ mdfour_result(&md, sum);
+
+ for (i=0;i<16;i++) {
+ sprintf(&ret[i*2], "%02x", (unsigned)sum[i]);
+ }
+ sprintf(&ret[i*2], "-%u", (unsigned)md.totalN);
+
+ return ret;
+}
diff --git a/CCache/install-sh b/CCache/install-sh
new file mode 100755
index 000000000..58719246f
--- /dev/null
+++ b/CCache/install-sh
@@ -0,0 +1,238 @@
+#! /bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+#
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+ case $1 in
+ -c) instcmd="$cpprog"
+ shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd="$stripprog"
+ shift
+ continue;;
+
+ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+ shift
+ continue;;
+
+ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+ shift
+ continue;;
+
+ *) if [ x"$src" = x ]
+ then
+ src=$1
+ else
+ # this colon is to work around a 386BSD /bin/sh bug
+ :
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x"$src" = x ]
+then
+ echo "install: no input file specified"
+ exit 1
+else
+ true
+fi
+
+if [ x"$dir_arg" != x ]; then
+ dst=$src
+ src=""
+
+ if [ -d $dst ]; then
+ instcmd=:
+ else
+ instcmd=mkdir
+ fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad
+# if $src (and thus $dsttmp) contains '*'.
+
+ if [ -f $src -o -d $src ]
+ then
+ true
+ else
+ echo "install: $src does not exist"
+ exit 1
+ fi
+
+ if [ x"$dst" = x ]
+ then
+ echo "install: no destination specified"
+ exit 1
+ else
+ true
+ fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+ if [ -d $dst ]
+ then
+ dst="$dst"/`basename $src`
+ else
+ true
+ fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+# this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='
+'
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+ pathcomp="${pathcomp}${1}"
+ shift
+
+ if [ ! -d "${pathcomp}" ] ;
+ then
+ $mkdirprog "${pathcomp}"
+ else
+ true
+ fi
+
+ pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+ $doit $instcmd $dst &&
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+ if [ x"$transformarg" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ dstfile=`basename $dst $transformbasename |
+ sed $transformarg`$transformbasename
+ fi
+
+# don't allow the sed command to completely eliminate the filename
+
+ if [ x"$dstfile" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ true
+ fi
+
+# Make a temp file name in the proper directory.
+
+ dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+ $doit $instcmd $src $dsttmp &&
+
+ trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing. If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+
+# Now rename the file to the real destination.
+
+ $doit $rmcmd -f $dstdir/$dstfile &&
+ $doit $mvcmd $dsttmp $dstdir/$dstfile
+
+fi &&
+
+
+exit 0
diff --git a/CCache/mdfour.c b/CCache/mdfour.c
new file mode 100644
index 000000000..b098e0215
--- /dev/null
+++ b/CCache/mdfour.c
@@ -0,0 +1,284 @@
+/*
+ a implementation of MD4 designed for use in the SMB authentication protocol
+ Copyright (C) Andrew Tridgell 1997-1998.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "ccache.h"
+
+/* NOTE: This code makes no attempt to be fast!
+
+ It assumes that a int is at least 32 bits long
+*/
+
+static struct mdfour *m;
+
+#define MASK32 (0xffffffff)
+
+#define F(X,Y,Z) ((((X)&(Y)) | ((~(X))&(Z))))
+#define G(X,Y,Z) ((((X)&(Y)) | ((X)&(Z)) | ((Y)&(Z))))
+#define H(X,Y,Z) (((X)^(Y)^(Z)))
+#define lshift(x,s) (((((x)<<(s))&MASK32) | (((x)>>(32-(s)))&MASK32)))
+
+#define ROUND1(a,b,c,d,k,s) a = lshift((a + F(b,c,d) + M[k])&MASK32, s)
+#define ROUND2(a,b,c,d,k,s) a = lshift((a + G(b,c,d) + M[k] + 0x5A827999)&MASK32,s)
+#define ROUND3(a,b,c,d,k,s) a = lshift((a + H(b,c,d) + M[k] + 0x6ED9EBA1)&MASK32,s)
+
+/* this applies md4 to 64 byte chunks */
+static void mdfour64(uint32 *M)
+{
+ uint32 AA, BB, CC, DD;
+ uint32 A,B,C,D;
+
+ A = m->A; B = m->B; C = m->C; D = m->D;
+ AA = A; BB = B; CC = C; DD = D;
+
+ ROUND1(A,B,C,D, 0, 3); ROUND1(D,A,B,C, 1, 7);
+ ROUND1(C,D,A,B, 2, 11); ROUND1(B,C,D,A, 3, 19);
+ ROUND1(A,B,C,D, 4, 3); ROUND1(D,A,B,C, 5, 7);
+ ROUND1(C,D,A,B, 6, 11); ROUND1(B,C,D,A, 7, 19);
+ ROUND1(A,B,C,D, 8, 3); ROUND1(D,A,B,C, 9, 7);
+ ROUND1(C,D,A,B, 10, 11); ROUND1(B,C,D,A, 11, 19);
+ ROUND1(A,B,C,D, 12, 3); ROUND1(D,A,B,C, 13, 7);
+ ROUND1(C,D,A,B, 14, 11); ROUND1(B,C,D,A, 15, 19);
+
+
+ ROUND2(A,B,C,D, 0, 3); ROUND2(D,A,B,C, 4, 5);
+ ROUND2(C,D,A,B, 8, 9); ROUND2(B,C,D,A, 12, 13);
+ ROUND2(A,B,C,D, 1, 3); ROUND2(D,A,B,C, 5, 5);
+ ROUND2(C,D,A,B, 9, 9); ROUND2(B,C,D,A, 13, 13);
+ ROUND2(A,B,C,D, 2, 3); ROUND2(D,A,B,C, 6, 5);
+ ROUND2(C,D,A,B, 10, 9); ROUND2(B,C,D,A, 14, 13);
+ ROUND2(A,B,C,D, 3, 3); ROUND2(D,A,B,C, 7, 5);
+ ROUND2(C,D,A,B, 11, 9); ROUND2(B,C,D,A, 15, 13);
+
+ ROUND3(A,B,C,D, 0, 3); ROUND3(D,A,B,C, 8, 9);
+ ROUND3(C,D,A,B, 4, 11); ROUND3(B,C,D,A, 12, 15);
+ ROUND3(A,B,C,D, 2, 3); ROUND3(D,A,B,C, 10, 9);
+ ROUND3(C,D,A,B, 6, 11); ROUND3(B,C,D,A, 14, 15);
+ ROUND3(A,B,C,D, 1, 3); ROUND3(D,A,B,C, 9, 9);
+ ROUND3(C,D,A,B, 5, 11); ROUND3(B,C,D,A, 13, 15);
+ ROUND3(A,B,C,D, 3, 3); ROUND3(D,A,B,C, 11, 9);
+ ROUND3(C,D,A,B, 7, 11); ROUND3(B,C,D,A, 15, 15);
+
+ A += AA; B += BB;
+ C += CC; D += DD;
+
+ A &= MASK32; B &= MASK32;
+ C &= MASK32; D &= MASK32;
+
+ m->A = A; m->B = B; m->C = C; m->D = D;
+}
+
+static void copy64(uint32 *M, const unsigned char *in)
+{
+ int i;
+
+ for (i=0;i<16;i++)
+ M[i] = (in[i*4+3]<<24) | (in[i*4+2]<<16) |
+ (in[i*4+1]<<8) | (in[i*4+0]<<0);
+}
+
+static void copy4(unsigned char *out,uint32 x)
+{
+ out[0] = x&0xFF;
+ out[1] = (x>>8)&0xFF;
+ out[2] = (x>>16)&0xFF;
+ out[3] = (x>>24)&0xFF;
+}
+
+void mdfour_begin(struct mdfour *md)
+{
+ md->A = 0x67452301;
+ md->B = 0xefcdab89;
+ md->C = 0x98badcfe;
+ md->D = 0x10325476;
+ md->totalN = 0;
+ md->tail_len = 0;
+}
+
+
+static void mdfour_tail(const unsigned char *in, int n)
+{
+ unsigned char buf[128];
+ uint32 M[16];
+ uint32 b;
+
+ m->totalN += n;
+
+ b = m->totalN * 8;
+
+ memset(buf, 0, 128);
+ if (n) memcpy(buf, in, n);
+ buf[n] = 0x80;
+
+ if (n <= 55) {
+ copy4(buf+56, b);
+ copy64(M, buf);
+ mdfour64(M);
+ } else {
+ copy4(buf+120, b);
+ copy64(M, buf);
+ mdfour64(M);
+ copy64(M, buf+64);
+ mdfour64(M);
+ }
+}
+
+void mdfour_update(struct mdfour *md, const unsigned char *in, int n)
+{
+ uint32 M[16];
+
+ m = md;
+
+ if (in == NULL) {
+ mdfour_tail(md->tail, md->tail_len);
+ return;
+ }
+
+ if (md->tail_len) {
+ int len = 64 - md->tail_len;
+ if (len > n) len = n;
+ memcpy(md->tail+md->tail_len, in, len);
+ md->tail_len += len;
+ n -= len;
+ in += len;
+ if (md->tail_len == 64) {
+ copy64(M, md->tail);
+ mdfour64(M);
+ m->totalN += 64;
+ md->tail_len = 0;
+ }
+ }
+
+ while (n >= 64) {
+ copy64(M, in);
+ mdfour64(M);
+ in += 64;
+ n -= 64;
+ m->totalN += 64;
+ }
+
+ if (n) {
+ memcpy(md->tail, in, n);
+ md->tail_len = n;
+ }
+}
+
+
+void mdfour_result(struct mdfour *md, unsigned char *out)
+{
+ m = md;
+
+ copy4(out, m->A);
+ copy4(out+4, m->B);
+ copy4(out+8, m->C);
+ copy4(out+12, m->D);
+}
+
+
+void mdfour(unsigned char *out, const unsigned char *in, int n)
+{
+ struct mdfour md;
+ mdfour_begin(&md);
+ mdfour_update(&md, in, n);
+ mdfour_update(&md, NULL, 0);
+ mdfour_result(&md, out);
+}
+
+#ifdef TEST_MDFOUR
+static void file_checksum1(char *fname)
+{
+ int fd, i;
+ struct mdfour md;
+ unsigned char buf[1024], sum[16];
+ unsigned chunk;
+
+ fd = open(fname,O_RDONLY|O_BINARY);
+ if (fd == -1) {
+ perror("fname");
+ exit(1);
+ }
+
+ chunk = 1 + random() % (sizeof(buf) - 1);
+
+ mdfour_begin(&md);
+
+ while (1) {
+ int n = read(fd, buf, chunk);
+ if (n >= 0) {
+ mdfour_update(&md, buf, n);
+ }
+ if (n < chunk) break;
+ }
+
+ close(fd);
+
+ mdfour_update(&md, NULL, 0);
+
+ mdfour_result(&md, sum);
+
+ for (i=0;i<16;i++)
+ printf("%02x", sum[i]);
+ printf("\n");
+}
+
+#if 0
+#include "../md4.h"
+
+static void file_checksum2(char *fname)
+{
+ int fd, i;
+ MDstruct md;
+ unsigned char buf[64], sum[16];
+
+ fd = open(fname,O_RDONLY|O_BINARY);
+ if (fd == -1) {
+ perror("fname");
+ exit(1);
+ }
+
+ MDbegin(&md);
+
+ while (1) {
+ int n = read(fd, buf, sizeof(buf));
+ if (n <= 0) break;
+ MDupdate(&md, buf, n*8);
+ }
+
+ if (!md.done) {
+ MDupdate(&md, buf, 0);
+ }
+
+ close(fd);
+
+ memcpy(sum, md.buffer, 16);
+
+ for (i=0;i<16;i++)
+ printf("%02x", sum[i]);
+ printf("\n");
+}
+#endif
+
+ int main(int argc, char *argv[])
+{
+ file_checksum1(argv[1]);
+#if 0
+ file_checksum2(argv[1]);
+#endif
+ return 0;
+}
+#endif
diff --git a/CCache/mdfour.h b/CCache/mdfour.h
new file mode 100644
index 000000000..92ef2f831
--- /dev/null
+++ b/CCache/mdfour.h
@@ -0,0 +1,36 @@
+/*
+ Unix SMB/Netbios implementation.
+ Version 1.9.
+ a implementation of MD4 designed for use in the SMB authentication protocol
+ Copyright (C) Andrew Tridgell 1997-1998.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+struct mdfour {
+ uint32 A, B, C, D;
+ uint32 totalN;
+ unsigned char tail[64];
+ unsigned tail_len;
+};
+
+void mdfour_begin(struct mdfour *md);
+void mdfour_update(struct mdfour *md, const unsigned char *in, int n);
+void mdfour_result(struct mdfour *md, unsigned char *out);
+void mdfour(unsigned char *out, const unsigned char *in, int n);
+
+
+
+
diff --git a/CCache/packaging/README b/CCache/packaging/README
new file mode 100644
index 000000000..fadc342c4
--- /dev/null
+++ b/CCache/packaging/README
@@ -0,0 +1,5 @@
+These packaging files are contributd by users of ccache. I do not
+maintain them, and they may well need updating before you use them.
+
+I don't distribute binary packages of ccache myself, but if you wish
+to add ccache to a distribution then that's OK
diff --git a/CCache/packaging/ccache.spec b/CCache/packaging/ccache.spec
new file mode 100644
index 000000000..0972121d7
--- /dev/null
+++ b/CCache/packaging/ccache.spec
@@ -0,0 +1,37 @@
+Summary: Compiler Cache
+Name: ccache
+Version: 2.3
+Release: 1
+Group: Development/Languages
+License: GPL
+URL: http://ccache.samba.org/
+Source: ccache-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-root
+
+%description
+ccache caches gcc output files
+
+%prep
+%setup -q
+
+%build
+%configure
+make
+
+install -d -m 0755 $RPM_BUILD_ROOT%{_bindir}
+install -m 0755 ccache $RPM_BUILD_ROOT%{_bindir}
+install -d -m 0755 $RPM_BUILD_ROOT%{_mandir}/man1
+install -m 0644 ccache.1 $RPM_BUILD_ROOT%{_mandir}/man1
+
+%files
+%defattr(-,root,root)
+%doc README
+%{_mandir}/man1/ccache.1*
+%{_bindir}/ccache
+
+%clean
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+
+%changelog
+* Mon Apr 01 2002 Peter Jones
+- Created the package
diff --git a/CCache/snprintf.c b/CCache/snprintf.c
new file mode 100644
index 000000000..32187c1a5
--- /dev/null
+++ b/CCache/snprintf.c
@@ -0,0 +1,962 @@
+/*
+ * Copyright Patrick Powell 1995
+ * This code is based on code written by Patrick Powell (papowell@astart.com)
+ * It may be used for any purpose as long as this notice remains intact
+ * on all source code distributions
+ */
+
+/**************************************************************
+ * Original:
+ * Patrick Powell Tue Apr 11 09:48:21 PDT 1995
+ * A bombproof version of doprnt (dopr) included.
+ * Sigh. This sort of thing is always nasty do deal with. Note that
+ * the version here does not include floating point...
+ *
+ * snprintf() is used instead of sprintf() as it does limit checks
+ * for string length. This covers a nasty loophole.
+ *
+ * The other functions are there to prevent NULL pointers from
+ * causing nast effects.
+ *
+ * More Recently:
+ * Brandon Long 9/15/96 for mutt 0.43
+ * This was ugly. It is still ugly. I opted out of floating point
+ * numbers, but the formatter understands just about everything
+ * from the normal C string format, at least as far as I can tell from
+ * the Solaris 2.5 printf(3S) man page.
+ *
+ * Brandon Long 10/22/97 for mutt 0.87.1
+ * Ok, added some minimal floating point support, which means this
+ * probably requires libm on most operating systems. Don't yet
+ * support the exponent (e,E) and sigfig (g,G). Also, fmtint()
+ * was pretty badly broken, it just wasn't being exercised in ways
+ * which showed it, so that's been fixed. Also, formated the code
+ * to mutt conventions, and removed dead code left over from the
+ * original. Also, there is now a builtin-test, just compile with:
+ * gcc -DTEST_SNPRINTF -o snprintf snprintf.c -lm
+ * and run snprintf for results.
+ *
+ * Thomas Roessler 01/27/98 for mutt 0.89i
+ * The PGP code was using unsigned hexadecimal formats.
+ * Unfortunately, unsigned formats simply didn't work.
+ *
+ * Michael Elkins 03/05/98 for mutt 0.90.8
+ * The original code assumed that both snprintf() and vsnprintf() were
+ * missing. Some systems only have snprintf() but not vsnprintf(), so
+ * the code is now broken down under HAVE_SNPRINTF and HAVE_VSNPRINTF.
+ *
+ * Andrew Tridgell (tridge@samba.org) Oct 1998
+ * fixed handling of %.0f
+ * added test for HAVE_LONG_DOUBLE
+ *
+ * tridge@samba.org, idra@samba.org, April 2001
+ * got rid of fcvt code (twas buggy and made testing harder)
+ * added C99 semantics
+ *
+ **************************************************************/
+
+#ifndef NO_CONFIG_H /* for some tests */
+#include "config.h"
+#endif
+
+#ifdef HAVE_STRING_H
+#include
+#endif
+
+#ifdef HAVE_STRINGS_H
+#include
+#endif
+#ifdef HAVE_CTYPE_H
+#include
+#endif
+#include
+#include
+#ifdef HAVE_STDLIB_H
+#include
+#endif
+
+#if defined(HAVE_SNPRINTF) && defined(HAVE_VSNPRINTF) && defined(HAVE_C99_VSNPRINTF)
+/* only include stdio.h if we are not re-defining snprintf or vsnprintf */
+#include
+ /* make the compiler happy with an empty file */
+ void dummy_snprintf(void) {}
+#else
+
+#ifdef HAVE_LONG_DOUBLE
+#define LDOUBLE long double
+#else
+#define LDOUBLE double
+#endif
+
+#ifdef HAVE_LONG_LONG
+#define LLONG long long
+#else
+#define LLONG long
+#endif
+
+static size_t dopr(char *buffer, size_t maxlen, const char *format,
+ va_list args);
+static void fmtstr(char *buffer, size_t *currlen, size_t maxlen,
+ char *value, int flags, int min, int max);
+static void fmtint(char *buffer, size_t *currlen, size_t maxlen,
+ long value, int base, int min, int max, int flags);
+static void fmtfp(char *buffer, size_t *currlen, size_t maxlen,
+ LDOUBLE fvalue, int min, int max, int flags);
+static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c);
+
+/*
+ * dopr(): poor man's version of doprintf
+ */
+
+/* format read states */
+#define DP_S_DEFAULT 0
+#define DP_S_FLAGS 1
+#define DP_S_MIN 2
+#define DP_S_DOT 3
+#define DP_S_MAX 4
+#define DP_S_MOD 5
+#define DP_S_CONV 6
+#define DP_S_DONE 7
+
+/* format flags - Bits */
+#define DP_F_MINUS (1 << 0)
+#define DP_F_PLUS (1 << 1)
+#define DP_F_SPACE (1 << 2)
+#define DP_F_NUM (1 << 3)
+#define DP_F_ZERO (1 << 4)
+#define DP_F_UP (1 << 5)
+#define DP_F_UNSIGNED (1 << 6)
+
+/* Conversion Flags */
+#define DP_C_SHORT 1
+#define DP_C_LONG 2
+#define DP_C_LDOUBLE 3
+#define DP_C_LLONG 4
+
+#define char_to_int(p) ((p)- '0')
+#ifndef MAX
+#define MAX(p,q) (((p) >= (q)) ? (p) : (q))
+#endif
+
+static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args)
+{
+ char ch;
+ LLONG value;
+ LDOUBLE fvalue;
+ char *strvalue;
+ int min;
+ int max;
+ int state;
+ int flags;
+ int cflags;
+ size_t currlen;
+
+ state = DP_S_DEFAULT;
+ currlen = flags = cflags = min = 0;
+ max = -1;
+ ch = *format++;
+
+ while (state != DP_S_DONE) {
+ if (ch == '\0')
+ state = DP_S_DONE;
+
+ switch(state) {
+ case DP_S_DEFAULT:
+ if (ch == '%')
+ state = DP_S_FLAGS;
+ else
+ dopr_outch (buffer, &currlen, maxlen, ch);
+ ch = *format++;
+ break;
+ case DP_S_FLAGS:
+ switch (ch) {
+ case '-':
+ flags |= DP_F_MINUS;
+ ch = *format++;
+ break;
+ case '+':
+ flags |= DP_F_PLUS;
+ ch = *format++;
+ break;
+ case ' ':
+ flags |= DP_F_SPACE;
+ ch = *format++;
+ break;
+ case '#':
+ flags |= DP_F_NUM;
+ ch = *format++;
+ break;
+ case '0':
+ flags |= DP_F_ZERO;
+ ch = *format++;
+ break;
+ default:
+ state = DP_S_MIN;
+ break;
+ }
+ break;
+ case DP_S_MIN:
+ if (isdigit((unsigned char)ch)) {
+ min = 10*min + char_to_int (ch);
+ ch = *format++;
+ } else if (ch == '*') {
+ min = va_arg (args, int);
+ ch = *format++;
+ state = DP_S_DOT;
+ } else {
+ state = DP_S_DOT;
+ }
+ break;
+ case DP_S_DOT:
+ if (ch == '.') {
+ state = DP_S_MAX;
+ ch = *format++;
+ } else {
+ state = DP_S_MOD;
+ }
+ break;
+ case DP_S_MAX:
+ if (isdigit((unsigned char)ch)) {
+ if (max < 0)
+ max = 0;
+ max = 10*max + char_to_int (ch);
+ ch = *format++;
+ } else if (ch == '*') {
+ max = va_arg (args, int);
+ ch = *format++;
+ state = DP_S_MOD;
+ } else {
+ state = DP_S_MOD;
+ }
+ break;
+ case DP_S_MOD:
+ switch (ch) {
+ case 'h':
+ cflags = DP_C_SHORT;
+ ch = *format++;
+ break;
+ case 'l':
+ cflags = DP_C_LONG;
+ ch = *format++;
+ if (ch == 'l') { /* It's a long long */
+ cflags = DP_C_LLONG;
+ ch = *format++;
+ }
+ break;
+ case 'L':
+ cflags = DP_C_LDOUBLE;
+ ch = *format++;
+ break;
+ default:
+ break;
+ }
+ state = DP_S_CONV;
+ break;
+ case DP_S_CONV:
+ switch (ch) {
+ case 'd':
+ case 'i':
+ if (cflags == DP_C_SHORT)
+ value = va_arg (args, int);
+ else if (cflags == DP_C_LONG)
+ value = va_arg (args, long int);
+ else if (cflags == DP_C_LLONG)
+ value = va_arg (args, LLONG);
+ else
+ value = va_arg (args, int);
+ fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags);
+ break;
+ case 'o':
+ flags |= DP_F_UNSIGNED;
+ if (cflags == DP_C_SHORT)
+ value = va_arg (args, unsigned int);
+ else if (cflags == DP_C_LONG)
+ value = (long)va_arg (args, unsigned long int);
+ else if (cflags == DP_C_LLONG)
+ value = (long)va_arg (args, unsigned LLONG);
+ else
+ value = (long)va_arg (args, unsigned int);
+ fmtint (buffer, &currlen, maxlen, value, 8, min, max, flags);
+ break;
+ case 'u':
+ flags |= DP_F_UNSIGNED;
+ if (cflags == DP_C_SHORT)
+ value = va_arg (args, unsigned int);
+ else if (cflags == DP_C_LONG)
+ value = (long)va_arg (args, unsigned long int);
+ else if (cflags == DP_C_LLONG)
+ value = (LLONG)va_arg (args, unsigned LLONG);
+ else
+ value = (long)va_arg (args, unsigned int);
+ fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags);
+ break;
+ case 'X':
+ flags |= DP_F_UP;
+ case 'x':
+ flags |= DP_F_UNSIGNED;
+ if (cflags == DP_C_SHORT)
+ value = va_arg (args, unsigned int);
+ else if (cflags == DP_C_LONG)
+ value = (long)va_arg (args, unsigned long int);
+ else if (cflags == DP_C_LLONG)
+ value = (LLONG)va_arg (args, unsigned LLONG);
+ else
+ value = (long)va_arg (args, unsigned int);
+ fmtint (buffer, &currlen, maxlen, value, 16, min, max, flags);
+ break;
+ case 'f':
+ if (cflags == DP_C_LDOUBLE)
+ fvalue = va_arg (args, LDOUBLE);
+ else
+ fvalue = va_arg (args, double);
+ /* um, floating point? */
+ fmtfp (buffer, &currlen, maxlen, fvalue, min, max, flags);
+ break;
+ case 'E':
+ flags |= DP_F_UP;
+ case 'e':
+ if (cflags == DP_C_LDOUBLE)
+ fvalue = va_arg (args, LDOUBLE);
+ else
+ fvalue = va_arg (args, double);
+ break;
+ case 'G':
+ flags |= DP_F_UP;
+ case 'g':
+ if (cflags == DP_C_LDOUBLE)
+ fvalue = va_arg (args, LDOUBLE);
+ else
+ fvalue = va_arg (args, double);
+ break;
+ case 'c':
+ dopr_outch (buffer, &currlen, maxlen, va_arg (args, int));
+ break;
+ case 's':
+ strvalue = va_arg (args, char *);
+ if (!strvalue) strvalue = "(NULL)";
+ if (max == -1) {
+ max = strlen(strvalue);
+ }
+ if (min > 0 && max >= 0 && min > max) max = min;
+ fmtstr (buffer, &currlen, maxlen, strvalue, flags, min, max);
+ break;
+ case 'p':
+ strvalue = (char *)va_arg(args, void *);
+ fmtint (buffer, &currlen, maxlen, (long) strvalue, 16, min, max, flags);
+ break;
+ case 'n':
+ if (cflags == DP_C_SHORT) {
+ short int *num;
+ num = va_arg (args, short int *);
+ *num = currlen;
+ } else if (cflags == DP_C_LONG) {
+ long int *num;
+ num = va_arg (args, long int *);
+ *num = (long int)currlen;
+ } else if (cflags == DP_C_LLONG) {
+ LLONG *num;
+ num = va_arg (args, LLONG *);
+ *num = (LLONG)currlen;
+ } else {
+ int *num;
+ num = va_arg (args, int *);
+ *num = currlen;
+ }
+ break;
+ case '%':
+ dopr_outch (buffer, &currlen, maxlen, ch);
+ break;
+ case 'w':
+ /* not supported yet, treat as next char */
+ ch = *format++;
+ break;
+ default:
+ /* Unknown, skip */
+ break;
+ }
+ ch = *format++;
+ state = DP_S_DEFAULT;
+ flags = cflags = min = 0;
+ max = -1;
+ break;
+ case DP_S_DONE:
+ break;
+ default:
+ /* hmm? */
+ break; /* some picky compilers need this */
+ }
+ }
+ if (maxlen != 0) {
+ if (currlen < maxlen - 1)
+ buffer[currlen] = '\0';
+ else if (maxlen > 0)
+ buffer[maxlen - 1] = '\0';
+ }
+
+ return currlen;
+}
+
+static void fmtstr(char *buffer, size_t *currlen, size_t maxlen,
+ char *value, int flags, int min, int max)
+{
+ int padlen, strln; /* amount to pad */
+ int cnt = 0;
+
+#ifdef DEBUG_SNPRINTF
+ printf("fmtstr min=%d max=%d s=[%s]\n", min, max, value);
+#endif
+ if (value == 0) {
+ value = "";
+ }
+
+ for (strln = 0; value[strln]; ++strln); /* strlen */
+ padlen = min - strln;
+ if (padlen < 0)
+ padlen = 0;
+ if (flags & DP_F_MINUS)
+ padlen = -padlen; /* Left Justify */
+
+ while ((padlen > 0) && (cnt < max)) {
+ dopr_outch (buffer, currlen, maxlen, ' ');
+ --padlen;
+ ++cnt;
+ }
+ while (*value && (cnt < max)) {
+ dopr_outch (buffer, currlen, maxlen, *value++);
+ ++cnt;
+ }
+ while ((padlen < 0) && (cnt < max)) {
+ dopr_outch (buffer, currlen, maxlen, ' ');
+ ++padlen;
+ ++cnt;
+ }
+}
+
+/* Have to handle DP_F_NUM (ie 0x and 0 alternates) */
+
+static void fmtint(char *buffer, size_t *currlen, size_t maxlen,
+ long value, int base, int min, int max, int flags)
+{
+ int signvalue = 0;
+ unsigned long uvalue;
+ char convert[20];
+ int place = 0;
+ int spadlen = 0; /* amount to space pad */
+ int zpadlen = 0; /* amount to zero pad */
+ int caps = 0;
+
+ if (max < 0)
+ max = 0;
+
+ uvalue = value;
+
+ if(!(flags & DP_F_UNSIGNED)) {
+ if( value < 0 ) {
+ signvalue = '-';
+ uvalue = -value;
+ } else {
+ if (flags & DP_F_PLUS) /* Do a sign (+/i) */
+ signvalue = '+';
+ else if (flags & DP_F_SPACE)
+ signvalue = ' ';
+ }
+ }
+
+ if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */
+
+ do {
+ convert[place++] =
+ (caps? "0123456789ABCDEF":"0123456789abcdef")
+ [uvalue % (unsigned)base ];
+ uvalue = (uvalue / (unsigned)base );
+ } while(uvalue && (place < 20));
+ if (place == 20) place--;
+ convert[place] = 0;
+
+ zpadlen = max - place;
+ spadlen = min - MAX (max, place) - (signvalue ? 1 : 0);
+ if (zpadlen < 0) zpadlen = 0;
+ if (spadlen < 0) spadlen = 0;
+ if (flags & DP_F_ZERO) {
+ zpadlen = MAX(zpadlen, spadlen);
+ spadlen = 0;
+ }
+ if (flags & DP_F_MINUS)
+ spadlen = -spadlen; /* Left Justifty */
+
+#ifdef DEBUG_SNPRINTF
+ printf("zpad: %d, spad: %d, min: %d, max: %d, place: %d\n",
+ zpadlen, spadlen, min, max, place);
+#endif
+
+ /* Spaces */
+ while (spadlen > 0) {
+ dopr_outch (buffer, currlen, maxlen, ' ');
+ --spadlen;
+ }
+
+ /* Sign */
+ if (signvalue)
+ dopr_outch (buffer, currlen, maxlen, signvalue);
+
+ /* Zeros */
+ if (zpadlen > 0) {
+ while (zpadlen > 0) {
+ dopr_outch (buffer, currlen, maxlen, '0');
+ --zpadlen;
+ }
+ }
+
+ /* Digits */
+ while (place > 0)
+ dopr_outch (buffer, currlen, maxlen, convert[--place]);
+
+ /* Left Justified spaces */
+ while (spadlen < 0) {
+ dopr_outch (buffer, currlen, maxlen, ' ');
+ ++spadlen;
+ }
+}
+
+static LDOUBLE abs_val(LDOUBLE value)
+{
+ LDOUBLE result = value;
+
+ if (value < 0)
+ result = -value;
+
+ return result;
+}
+
+static LDOUBLE POW10(int exp)
+{
+ LDOUBLE result = 1;
+
+ while (exp) {
+ result *= 10;
+ exp--;
+ }
+
+ return result;
+}
+
+static LLONG ROUND(LDOUBLE value)
+{
+ LLONG intpart;
+
+ intpart = (LLONG)value;
+ value = value - intpart;
+ if (value >= 0.5) intpart++;
+
+ return intpart;
+}
+
+/* a replacement for modf that doesn't need the math library. Should
+ be portable, but slow */
+static double my_modf(double x0, double *iptr)
+{
+ int i;
+ long l;
+ double x = x0;
+ double f = 1.0;
+
+ for (i=0;i<100;i++) {
+ l = (long)x;
+ if (l <= (x+1) && l >= (x-1)) break;
+ x *= 0.1;
+ f *= 10.0;
+ }
+
+ if (i == 100) {
+ /* yikes! the number is beyond what we can handle. What do we do? */
+ (*iptr) = 0;
+ return 0;
+ }
+
+ if (i != 0) {
+ double i2;
+ double ret;
+
+ ret = my_modf(x0-l*f, &i2);
+ (*iptr) = l*f + i2;
+ return ret;
+ }
+
+ (*iptr) = l;
+ return x - (*iptr);
+}
+
+
+static void fmtfp (char *buffer, size_t *currlen, size_t maxlen,
+ LDOUBLE fvalue, int min, int max, int flags)
+{
+ int signvalue = 0;
+ double ufvalue;
+ char iconvert[311];
+ char fconvert[311];
+ int iplace = 0;
+ int fplace = 0;
+ int padlen = 0; /* amount to pad */
+ int zpadlen = 0;
+ int caps = 0;
+ int index;
+ double intpart;
+ double fracpart;
+ double temp;
+
+ /*
+ * AIX manpage says the default is 0, but Solaris says the default
+ * is 6, and sprintf on AIX defaults to 6
+ */
+ if (max < 0)
+ max = 6;
+
+ ufvalue = abs_val (fvalue);
+
+ if (fvalue < 0) {
+ signvalue = '-';
+ } else {
+ if (flags & DP_F_PLUS) { /* Do a sign (+/i) */
+ signvalue = '+';
+ } else {
+ if (flags & DP_F_SPACE)
+ signvalue = ' ';
+ }
+ }
+
+#if 0
+ if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */
+#endif
+
+#if 0
+ if (max == 0) ufvalue += 0.5; /* if max = 0 we must round */
+#endif
+
+ /*
+ * Sorry, we only support 16 digits past the decimal because of our
+ * conversion method
+ */
+ if (max > 16)
+ max = 16;
+
+ /* We "cheat" by converting the fractional part to integer by
+ * multiplying by a factor of 10
+ */
+
+ temp = ufvalue;
+ my_modf(temp, &intpart);
+
+ fracpart = ROUND((POW10(max)) * (ufvalue - intpart));
+
+ if (fracpart >= POW10(max)) {
+ intpart++;
+ fracpart -= POW10(max);
+ }
+
+
+ /* Convert integer part */
+ do {
+ temp = intpart;
+ my_modf(intpart*0.1, &intpart);
+ temp = temp*0.1;
+ index = (int) ((temp -intpart +0.05)* 10.0);
+ /* index = (int) (((double)(temp*0.1) -intpart +0.05) *10.0); */
+ /* printf ("%llf, %f, %x\n", temp, intpart, index); */
+ iconvert[iplace++] =
+ (caps? "0123456789ABCDEF":"0123456789abcdef")[index];
+ } while (intpart && (iplace < 311));
+ if (iplace == 311) iplace--;
+ iconvert[iplace] = 0;
+
+ /* Convert fractional part */
+ if (fracpart)
+ {
+ do {
+ temp = fracpart;
+ my_modf(fracpart*0.1, &fracpart);
+ temp = temp*0.1;
+ index = (int) ((temp -fracpart +0.05)* 10.0);
+ /* index = (int) ((((temp/10) -fracpart) +0.05) *10); */
+ /* printf ("%lf, %lf, %ld\n", temp, fracpart, index); */
+ fconvert[fplace++] =
+ (caps? "0123456789ABCDEF":"0123456789abcdef")[index];
+ } while(fracpart && (fplace < 311));
+ if (fplace == 311) fplace--;
+ }
+ fconvert[fplace] = 0;
+
+ /* -1 for decimal point, another -1 if we are printing a sign */
+ padlen = min - iplace - max - 1 - ((signvalue) ? 1 : 0);
+ zpadlen = max - fplace;
+ if (zpadlen < 0) zpadlen = 0;
+ if (padlen < 0)
+ padlen = 0;
+ if (flags & DP_F_MINUS)
+ padlen = -padlen; /* Left Justifty */
+
+ if ((flags & DP_F_ZERO) && (padlen > 0)) {
+ if (signvalue) {
+ dopr_outch (buffer, currlen, maxlen, signvalue);
+ --padlen;
+ signvalue = 0;
+ }
+ while (padlen > 0) {
+ dopr_outch (buffer, currlen, maxlen, '0');
+ --padlen;
+ }
+ }
+ while (padlen > 0) {
+ dopr_outch (buffer, currlen, maxlen, ' ');
+ --padlen;
+ }
+ if (signvalue)
+ dopr_outch (buffer, currlen, maxlen, signvalue);
+
+ while (iplace > 0)
+ dopr_outch (buffer, currlen, maxlen, iconvert[--iplace]);
+
+#ifdef DEBUG_SNPRINTF
+ printf("fmtfp: fplace=%d zpadlen=%d\n", fplace, zpadlen);
+#endif
+
+ /*
+ * Decimal point. This should probably use locale to find the correct
+ * char to print out.
+ */
+ if (max > 0) {
+ dopr_outch (buffer, currlen, maxlen, '.');
+
+ while (fplace > 0)
+ dopr_outch (buffer, currlen, maxlen, fconvert[--fplace]);
+ }
+
+ while (zpadlen > 0) {
+ dopr_outch (buffer, currlen, maxlen, '0');
+ --zpadlen;
+ }
+
+ while (padlen < 0) {
+ dopr_outch (buffer, currlen, maxlen, ' ');
+ ++padlen;
+ }
+}
+
+static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c)
+{
+ if (*currlen < maxlen) {
+ buffer[(*currlen)] = c;
+ }
+ (*currlen)++;
+}
+
+/* yes this really must be a ||. Don't muck with this (tridge) */
+#if !defined(HAVE_VSNPRINTF) || !defined(HAVE_C99_VSNPRINTF)
+ int vsnprintf (char *str, size_t count, const char *fmt, va_list args)
+{
+ return dopr(str, count, fmt, args);
+}
+#endif
+
+/* yes this really must be a ||. Don't muck wiith this (tridge)
+ *
+ * The logic for these two is that we need our own definition if the
+ * OS *either* has no definition of *sprintf, or if it does have one
+ * that doesn't work properly according to the autoconf test. Perhaps
+ * these should really be smb_snprintf to avoid conflicts with buggy
+ * linkers? -- mbp
+ */
+#if !defined(HAVE_SNPRINTF) || !defined(HAVE_C99_SNPRINTF)
+ int snprintf(char *str,size_t count,const char *fmt,...)
+{
+ size_t ret;
+ va_list ap;
+
+ va_start(ap, fmt);
+ ret = vsnprintf(str, count, fmt, ap);
+ va_end(ap);
+ return ret;
+}
+#endif
+
+#endif
+
+#ifndef HAVE_VASPRINTF
+ int vasprintf(char **ptr, const char *format, va_list ap)
+{
+ int ret;
+
+ ret = vsnprintf(0, 0, format, ap);
+ if (ret <= 0) return ret;
+
+ (*ptr) = (char *)malloc(ret+1);
+ if (!*ptr) return -1;
+ ret = vsnprintf(*ptr, ret+1, format, ap);
+
+ return ret;
+}
+#endif
+
+
+#ifndef HAVE_ASPRINTF
+ int asprintf(char **ptr, const char *format, ...)
+{
+ va_list ap;
+ int ret;
+
+ *ptr = 0;
+ va_start(ap, format);
+ ret = vasprintf(ptr, format, ap);
+ va_end(ap);
+
+ return ret;
+}
+#endif
+
+#ifndef HAVE_VSYSLOG
+#ifdef HAVE_SYSLOG
+ void vsyslog (int facility_priority, char *format, va_list arglist)
+{
+ char *msg = 0;
+ vasprintf(&msg, format, arglist);
+ if (!msg)
+ return;
+ syslog(facility_priority, "%s", msg);
+ free(msg);
+}
+#endif /* HAVE_SYSLOG */
+#endif /* HAVE_VSYSLOG */
+
+#ifdef TEST_SNPRINTF
+
+ int sprintf(char *str,const char *fmt,...);
+
+ int main (void)
+{
+ char buf1[1024];
+ char buf2[1024];
+ char *fp_fmt[] = {
+ "%1.1f",
+ "%-1.5f",
+ "%1.5f",
+ "%123.9f",
+ "%10.5f",
+ "% 10.5f",
+ "%+22.9f",
+ "%+4.9f",
+ "%01.3f",
+ "%4f",
+ "%3.1f",
+ "%3.2f",
+ "%.0f",
+ "%f",
+ "-16.16f",
+ 0
+ };
+ double fp_nums[] = { 6442452944.1234, -1.5, 134.21, 91340.2, 341.1234, 0203.9, 0.96, 0.996,
+ 0.9996, 1.996, 4.136, 0};
+ char *int_fmt[] = {
+ "%-1.5d",
+ "%1.5d",
+ "%123.9d",
+ "%5.5d",
+ "%10.5d",
+ "% 10.5d",
+ "%+22.33d",
+ "%01.3d",
+ "%4d",
+ "%d",
+ 0
+ };
+ long int_nums[] = { -1, 134, 91340, 341, 0203, 0};
+ char *str_fmt[] = {
+ "10.5s",
+ "5.10s",
+ "10.1s",
+ "0.10s",
+ "10.0s",
+ "1.10s",
+ "%s",
+ "%.1s",
+ "%.10s",
+ "%10s",
+ 0
+ };
+ char *str_vals[] = {"hello", "a", "", "a longer string", 0};
+ int x, y;
+ int fail = 0;
+ int num = 0;
+
+ printf ("Testing snprintf format codes against system sprintf...\n");
+
+ for (x = 0; fp_fmt[x] ; x++) {
+ for (y = 0; fp_nums[y] != 0 ; y++) {
+ int l1 = snprintf(0, 0, fp_fmt[x], fp_nums[y]);
+ int l2 = snprintf(buf1, sizeof(buf1), fp_fmt[x], fp_nums[y]);
+ sprintf (buf2, fp_fmt[x], fp_nums[y]);
+ if (strcmp (buf1, buf2)) {
+ printf("snprintf doesn't match Format: %s\n\tsnprintf = [%s]\n\t sprintf = [%s]\n",
+ fp_fmt[x], buf1, buf2);
+ fail++;
+ }
+ if (l1 != l2) {
+ printf("snprintf l1 != l2 (%d %d) %s\n", l1, l2, fp_fmt[x]);
+ fail++;
+ }
+ num++;
+ }
+ }
+
+ for (x = 0; int_fmt[x] ; x++) {
+ for (y = 0; int_nums[y] != 0 ; y++) {
+ int l1 = snprintf(0, 0, int_fmt[x], int_nums[y]);
+ int l2 = snprintf(buf1, sizeof(buf1), int_fmt[x], int_nums[y]);
+ sprintf (buf2, int_fmt[x], int_nums[y]);
+ if (strcmp (buf1, buf2)) {
+ printf("snprintf doesn't match Format: %s\n\tsnprintf = [%s]\n\t sprintf = [%s]\n",
+ int_fmt[x], buf1, buf2);
+ fail++;
+ }
+ if (l1 != l2) {
+ printf("snprintf l1 != l2 (%d %d) %s\n", l1, l2, int_fmt[x]);
+ fail++;
+ }
+ num++;
+ }
+ }
+
+ for (x = 0; str_fmt[x] ; x++) {
+ for (y = 0; str_vals[y] != 0 ; y++) {
+ int l1 = snprintf(0, 0, str_fmt[x], str_vals[y]);
+ int l2 = snprintf(buf1, sizeof(buf1), str_fmt[x], str_vals[y]);
+ sprintf (buf2, str_fmt[x], str_vals[y]);
+ if (strcmp (buf1, buf2)) {
+ printf("snprintf doesn't match Format: %s\n\tsnprintf = [%s]\n\t sprintf = [%s]\n",
+ str_fmt[x], buf1, buf2);
+ fail++;
+ }
+ if (l1 != l2) {
+ printf("snprintf l1 != l2 (%d %d) %s\n", l1, l2, str_fmt[x]);
+ fail++;
+ }
+ num++;
+ }
+ }
+
+ printf ("%d tests failed out of %d.\n", fail, num);
+
+ printf("seeing how many digits we support\n");
+ {
+ double v0 = 0.12345678901234567890123456789012345678901;
+ for (x=0; x<100; x++) {
+ snprintf(buf1, sizeof(buf1), "%1.1f", v0*pow(10, x));
+ sprintf(buf2, "%1.1f", v0*pow(10, x));
+ if (strcmp(buf1, buf2)) {
+ printf("we seem to support %d digits\n", x-1);
+ break;
+ }
+ }
+ }
+
+ return 0;
+}
+#endif /* SNPRINTF_TEST */
diff --git a/CCache/stats.c b/CCache/stats.c
new file mode 100644
index 000000000..92bc4a835
--- /dev/null
+++ b/CCache/stats.c
@@ -0,0 +1,361 @@
+/*
+ Copyright (C) Andrew Tridgell 2002
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+/*
+ routines to handle the stats files
+
+ the stats file is stored one per cache subdirectory to make this more
+ scalable
+ */
+
+#include "ccache.h"
+
+extern char *stats_file;
+extern char *cache_dir;
+
+#define STATS_VERSION 1
+
+#define FLAG_NOZERO 1 /* don't zero with the -z option */
+#define FLAG_ALWAYS 2 /* always show, even if zero */
+
+static struct {
+ enum stats stat;
+ char *message;
+ void (*fn)(unsigned );
+ unsigned flags;
+} stats_info[] = {
+ { STATS_CACHED, "cache hit ", NULL, FLAG_ALWAYS },
+ { STATS_TOCACHE, "cache miss ", NULL, FLAG_ALWAYS },
+ { STATS_LINK, "called for link ", NULL, 0 },
+ { STATS_MULTIPLE, "multiple source files ", NULL, 0 },
+ { STATS_STDOUT, "compiler produced stdout ", NULL, 0 },
+ { STATS_STATUS, "compile failed ", NULL, 0 },
+ { STATS_ERROR, "ccache internal error ", NULL, 0 },
+ { STATS_PREPROCESSOR, "preprocessor error ", NULL, 0 },
+ { STATS_COMPILER, "couldn't find the compiler ", NULL, 0 },
+ { STATS_MISSING, "cache file missing ", NULL, 0 },
+ { STATS_ARGS, "bad compiler arguments ", NULL, 0 },
+ { STATS_NOTC, "not a C/C++ file ", NULL, 0 },
+ { STATS_CONFTEST, "autoconf compile/link ", NULL, 0 },
+ { STATS_UNSUPPORTED, "unsupported compiler option ", NULL, 0 },
+ { STATS_OUTSTDOUT, "output to stdout ", NULL, 0 },
+ { STATS_DEVICE, "output to a non-regular file ", NULL, 0 },
+ { STATS_NOINPUT, "no input file ", NULL, 0 },
+ { STATS_ENVIRONMMENT, "error due to bad env variable ", NULL, 0 },
+ { STATS_NUMFILES, "files in cache ", NULL, FLAG_NOZERO|FLAG_ALWAYS },
+ { STATS_TOTALSIZE, "cache size ", display_size , FLAG_NOZERO|FLAG_ALWAYS },
+ { STATS_MAXFILES, "max files ", NULL, FLAG_NOZERO },
+ { STATS_MAXSIZE, "max cache size ", display_size, FLAG_NOZERO },
+ { STATS_NONE, NULL, NULL, 0 }
+};
+
+/* parse a stats file from a buffer - adding to the counters */
+static void parse_stats(unsigned counters[STATS_END], char *buf)
+{
+ int i;
+ char *p, *p2;
+
+ p = buf;
+ for (i=0;i= (int)sizeof(buf)-1) fatal("stats too long?!");
+ }
+ len += snprintf(buf+len, sizeof(buf)-(len+1), "\n");
+ if (len >= (int)sizeof(buf)-1) fatal("stats too long?!");
+
+ lseek(fd, 0, SEEK_SET);
+ if (write(fd, buf, len) == -1) fatal("could not write stats");
+}
+
+
+/* fill in some default stats values */
+static void stats_default(unsigned counters[STATS_END])
+{
+ counters[STATS_MAXSIZE] += DEFAULT_MAXSIZE / 16;
+}
+
+/* read in the stats from one dir and add to the counters */
+static void stats_read_fd(int fd, unsigned counters[STATS_END])
+{
+ char buf[1024];
+ int len;
+ len = read(fd, buf, sizeof(buf)-1);
+ if (len <= 0) {
+ stats_default(counters);
+ return;
+ }
+ buf[len] = 0;
+ parse_stats(counters, buf);
+}
+
+/* update the stats counter for this compile */
+static void stats_update_size(enum stats stat, size_t size, size_t numfiles)
+{
+ int fd;
+ unsigned counters[STATS_END];
+ int need_cleanup = 0;
+
+ if (getenv("CCACHE_NOSTATS")) return;
+
+ if (!stats_file) {
+ if (!cache_dir) return;
+ x_asprintf(&stats_file, "%s/stats", cache_dir);
+ }
+
+ /* open safely to try to prevent symlink races */
+ fd = safe_open(stats_file);
+
+ /* still can't get it? don't bother ... */
+ if (fd == -1) return;
+
+ memset(counters, 0, sizeof(counters));
+
+ if (lock_fd(fd) != 0) return;
+
+ /* read in the old stats */
+ stats_read_fd(fd, counters);
+
+ /* update them */
+ counters[stat]++;
+
+ /* on a cache miss we up the file count and size */
+ if (stat == STATS_TOCACHE) {
+ counters[STATS_NUMFILES] += numfiles;
+ counters[STATS_TOTALSIZE] += size;
+ }
+
+ /* and write them out */
+ write_stats(fd, counters);
+ close(fd);
+
+ /* we might need to cleanup if the cache has now got too big */
+ if (counters[STATS_MAXFILES] != 0 &&
+ counters[STATS_NUMFILES] > counters[STATS_MAXFILES]) {
+ need_cleanup = 1;
+ }
+ if (counters[STATS_MAXSIZE] != 0 &&
+ counters[STATS_TOTALSIZE] > counters[STATS_MAXSIZE]) {
+ need_cleanup = 1;
+ }
+
+ if (need_cleanup) {
+ char *p = dirname(stats_file);
+ cleanup_dir(p, counters[STATS_MAXFILES], counters[STATS_MAXSIZE]);
+ free(p);
+ }
+}
+
+/* record a cache miss */
+void stats_tocache(size_t size, size_t numfiles)
+{
+ /* convert size to kilobytes */
+ size = size / 1024;
+
+ stats_update_size(STATS_TOCACHE, size, numfiles);
+}
+
+/* update a normal stat */
+void stats_update(enum stats stat)
+{
+ stats_update_size(stat, 0, 0);
+}
+
+/* read in the stats from one dir and add to the counters */
+void stats_read(const char *stats_file, unsigned counters[STATS_END])
+{
+ int fd;
+
+ fd = open(stats_file, O_RDONLY|O_BINARY);
+ if (fd == -1) {
+ stats_default(counters);
+ return;
+ }
+ lock_fd(fd);
+ stats_read_fd(fd, counters);
+ close(fd);
+}
+
+/* sum and display the total stats for all cache dirs */
+void stats_summary(void)
+{
+ int dir, i;
+ unsigned counters[STATS_END];
+
+ memset(counters, 0, sizeof(counters));
+
+ /* add up the stats in each directory */
+ for (dir=-1;dir<=0xF;dir++) {
+ char *fname;
+
+ if (dir == -1) {
+ x_asprintf(&fname, "%s/stats", cache_dir);
+ } else {
+ x_asprintf(&fname, "%s/%1x/stats", cache_dir, dir);
+ }
+
+ stats_read(fname, counters);
+ free(fname);
+
+ /* oh what a nasty hack ... */
+ if (dir == -1) {
+ counters[STATS_MAXSIZE] = 0;
+ }
+
+ }
+
+ printf("cache directory %s\n", cache_dir);
+
+ /* and display them */
+ for (i=0;stats_info[i].message;i++) {
+ enum stats stat = stats_info[i].stat;
+
+ if (counters[stat] == 0 &&
+ !(stats_info[i].flags & FLAG_ALWAYS)) {
+ continue;
+ }
+
+ printf("%s ", stats_info[i].message);
+ if (stats_info[i].fn) {
+ stats_info[i].fn(counters[stat]);
+ printf("\n");
+ } else {
+ printf("%8u\n", counters[stat]);
+ }
+ }
+}
+
+/* zero all the stats structures */
+void stats_zero(void)
+{
+ int dir, fd;
+ unsigned i;
+ char *fname;
+ unsigned counters[STATS_END];
+
+ x_asprintf(&fname, "%s/stats", cache_dir);
+ unlink(fname);
+ free(fname);
+
+ for (dir=0;dir<=0xF;dir++) {
+ x_asprintf(&fname, "%s/%1x/stats", cache_dir, dir);
+ fd = safe_open(fname);
+ if (fd == -1) {
+ free(fname);
+ continue;
+ }
+ memset(counters, 0, sizeof(counters));
+ lock_fd(fd);
+ stats_read_fd(fd, counters);
+ for (i=0;stats_info[i].message;i++) {
+ if (!(stats_info[i].flags & FLAG_NOZERO)) {
+ counters[stats_info[i].stat] = 0;
+ }
+ }
+ write_stats(fd, counters);
+ close(fd);
+ free(fname);
+ }
+}
+
+
+/* set the per directory limits */
+int stats_set_limits(long maxfiles, long maxsize)
+{
+ int dir;
+ unsigned counters[STATS_END];
+
+ if (maxfiles != -1) {
+ maxfiles /= 16;
+ }
+ if (maxsize != -1) {
+ maxsize /= 16;
+ }
+
+ if (create_dir(cache_dir) != 0) {
+ return 1;
+ }
+
+ /* set the limits in each directory */
+ for (dir=0;dir<=0xF;dir++) {
+ char *fname, *cdir;
+ int fd;
+
+ x_asprintf(&cdir, "%s/%1x", cache_dir, dir);
+ if (create_dir(cdir) != 0) {
+ return 1;
+ }
+ x_asprintf(&fname, "%s/stats", cdir);
+ free(cdir);
+
+ memset(counters, 0, sizeof(counters));
+ fd = safe_open(fname);
+ if (fd != -1) {
+ lock_fd(fd);
+ stats_read_fd(fd, counters);
+ if (maxfiles != -1) {
+ counters[STATS_MAXFILES] = maxfiles;
+ }
+ if (maxsize != -1) {
+ counters[STATS_MAXSIZE] = maxsize;
+ }
+ write_stats(fd, counters);
+ close(fd);
+ }
+ free(fname);
+ }
+
+ return 0;
+}
+
+/* set the per directory sizes */
+void stats_set_sizes(const char *dir, size_t num_files, size_t total_size)
+{
+ int fd;
+ unsigned counters[STATS_END];
+ char *stats_file;
+
+ create_dir(dir);
+ x_asprintf(&stats_file, "%s/stats", dir);
+
+ memset(counters, 0, sizeof(counters));
+
+ fd = safe_open(stats_file);
+ if (fd != -1) {
+ lock_fd(fd);
+ stats_read_fd(fd, counters);
+ counters[STATS_NUMFILES] = num_files;
+ counters[STATS_TOTALSIZE] = total_size;
+ write_stats(fd, counters);
+ close(fd);
+ }
+
+ free(stats_file);
+}
diff --git a/CCache/test.sh b/CCache/test.sh
new file mode 100755
index 000000000..9581c85e3
--- /dev/null
+++ b/CCache/test.sh
@@ -0,0 +1,452 @@
+#!/bin/sh
+
+# a simple test suite for ccache
+# tridge@samba.org
+
+if test -n "$CC"; then
+ COMPILER="$CC"
+else
+ COMPILER=cc
+fi
+
+if test -n "$SWIG"; then
+ SWIG="$SWIG"
+else
+ SWIG=swig
+fi
+
+CCACHE=../ccache-swig
+TESTDIR=test.$$
+
+test_failed() {
+ reason="$1"
+ echo $1
+ $CCACHE -s
+ cd ..
+ rm -rf $TESTDIR
+ echo TEST FAILED
+ exit 1
+}
+
+randcode() {
+ outfile="$1"
+ nlines=$2
+ i=0;
+ (
+ while [ $i -lt $nlines ]; do
+ echo "int foo$nlines$i(int x) { return x; }"
+ i=`expr $i + 1`
+ done
+ ) >> "$outfile"
+}
+
+genswigcode() {
+ outfile="$1"
+ nlines=$2
+ i=0;
+ (
+ echo "%module swigtest$2;"
+ while [ $i -lt $nlines ]; do
+ echo "int foo$nlines$i(int x);"
+ echo "struct Bar$nlines$i { int y; };"
+ i=`expr $i + 1`
+ done
+ ) >> "$outfile"
+}
+
+
+getstat() {
+ stat="$1"
+ value=`$CCACHE -s | grep "$stat" | cut -c34-40`
+ echo $value
+}
+
+checkstat() {
+ stat="$1"
+ expected_value="$2"
+ value=`getstat "$stat"`
+# echo "exp: $expected_value got: $value $testname"
+ if [ "$expected_value" != "$value" ]; then
+ test_failed "SUITE: $testsuite TEST: $testname - Expected $stat to be $expected_value got $value"
+ fi
+}
+
+
+basetests() {
+ echo "starting testsuite $testsuite"
+ rm -rf "$CCACHE_DIR"
+ checkstat 'cache hit' 0
+ checkstat 'cache miss' 0
+
+ j=1
+ rm -f *.c
+ while [ $j -lt 32 ]; do
+ randcode test$j.c $j
+ j=`expr $j + 1`
+ done
+
+ testname="BASIC"
+ $CCACHE_COMPILE -c test1.c
+ checkstat 'cache hit' 0
+ checkstat 'cache miss' 1
+
+ testname="BASIC2"
+ $CCACHE_COMPILE -c test1.c
+ checkstat 'cache hit' 1
+ checkstat 'cache miss' 1
+
+ testname="debug"
+ $CCACHE_COMPILE -c test1.c -g
+ checkstat 'cache hit' 1
+ checkstat 'cache miss' 2
+
+ testname="debug2"
+ $CCACHE_COMPILE -c test1.c -g
+ checkstat 'cache hit' 2
+ checkstat 'cache miss' 2
+
+ testname="output"
+ $CCACHE_COMPILE -c test1.c -o foo.o
+ checkstat 'cache hit' 3
+ checkstat 'cache miss' 2
+
+ testname="link"
+ $CCACHE_COMPILE test1.c -o test 2> /dev/null
+ checkstat 'called for link' 1
+
+ testname="multiple"
+ $CCACHE_COMPILE -c test1.c test2.c
+ checkstat 'multiple source files' 1
+
+ testname="find"
+ $CCACHE blahblah -c test1.c 2> /dev/null
+ checkstat "couldn't find the compiler" 1
+
+ testname="bad"
+ $CCACHE_COMPILE -c test1.c -I 2> /dev/null
+ checkstat 'bad compiler arguments' 1
+
+ testname="c/c++"
+ ln -f test1.c test1.ccc
+ $CCACHE_COMPILE -c test1.ccc 2> /dev/null
+ checkstat 'not a C/C++ file' 1
+
+ testname="unsupported"
+ $CCACHE_COMPILE -M foo -c test1.c > /dev/null 2>&1
+ checkstat 'unsupported compiler option' 1
+
+ testname="stdout"
+ $CCACHE echo foo -c test1.c > /dev/null
+ checkstat 'compiler produced stdout' 1
+
+ testname="non-regular"
+ mkdir testd
+ $CCACHE_COMPILE -o testd -c test1.c > /dev/null 2>&1
+ rmdir testd
+ checkstat 'output to a non-regular file' 1
+
+ testname="no-input"
+ $CCACHE_COMPILE -c -O2 2> /dev/null
+ checkstat 'no input file' 1
+
+
+ testname="CCACHE_DISABLE"
+ CCACHE_DISABLE=1 $CCACHE_COMPILE -c test1.c 2> /dev/null
+ checkstat 'cache hit' 3
+ $CCACHE_COMPILE -c test1.c
+ checkstat 'cache hit' 4
+
+ testname="CCACHE_CPP2"
+ CCACHE_CPP2=1 $CCACHE_COMPILE -c test1.c -O -O
+ checkstat 'cache hit' 4
+ checkstat 'cache miss' 3
+
+ CCACHE_CPP2=1 $CCACHE_COMPILE -c test1.c -O -O
+ checkstat 'cache hit' 5
+ checkstat 'cache miss' 3
+
+ testname="CCACHE_NOSTATS"
+ CCACHE_NOSTATS=1 $CCACHE_COMPILE -c test1.c -O -O
+ checkstat 'cache hit' 5
+ checkstat 'cache miss' 3
+
+ testname="CCACHE_RECACHE"
+ CCACHE_RECACHE=1 $CCACHE_COMPILE -c test1.c -O -O
+ checkstat 'cache hit' 5
+ checkstat 'cache miss' 4
+
+ # strictly speaking should be 6 - RECACHE causes a double counting!
+ checkstat 'files in cache' 8
+ $CCACHE -c > /dev/null
+ checkstat 'files in cache' 6
+
+
+ testname="CCACHE_HASHDIR"
+ CCACHE_HASHDIR=1 $CCACHE_COMPILE -c test1.c -O -O
+ checkstat 'cache hit' 5
+ checkstat 'cache miss' 5
+
+ CCACHE_HASHDIR=1 $CCACHE_COMPILE -c test1.c -O -O
+ checkstat 'cache hit' 6
+ checkstat 'cache miss' 5
+
+ checkstat 'files in cache' 8
+
+ testname="comments"
+ echo '/* a silly comment */' > test1-comment.c
+ cat test1.c >> test1-comment.c
+ $CCACHE_COMPILE -c test1-comment.c
+ rm -f test1-comment*
+ checkstat 'cache hit' 6
+ checkstat 'cache miss' 6
+
+ testname="CCACHE_UNIFY"
+ CCACHE_UNIFY=1 $CCACHE_COMPILE -c test1.c
+ checkstat 'cache hit' 6
+ checkstat 'cache miss' 7
+ mv test1.c test1-saved.c
+ echo '/* another comment */' > test1.c
+ cat test1-saved.c >> test1.c
+ CCACHE_UNIFY=1 $CCACHE_COMPILE -c test1.c
+ mv test1-saved.c test1.c
+ checkstat 'cache hit' 7
+ checkstat 'cache miss' 7
+
+ testname="cache-size"
+ for f in *.c; do
+ $CCACHE_COMPILE -c $f
+ done
+ checkstat 'cache hit' 8
+ checkstat 'cache miss' 37
+ checkstat 'files in cache' 72
+ $CCACHE -F 48 -c > /dev/null
+ if [ `getstat 'files in cache'` -gt 48 ]; then
+ test_failed '-F test failed'
+ fi
+
+ testname="cpp call"
+ $CCACHE_COMPILE -c test1.c -E > test1.i
+ checkstat 'cache hit' 8
+ checkstat 'cache miss' 37
+
+ testname="direct .i compile"
+ $CCACHE_COMPILE -c test1.c
+ checkstat 'cache hit' 8
+ checkstat 'cache miss' 38
+
+ $CCACHE_COMPILE -c test1.i
+ checkstat 'cache hit' 9
+ checkstat 'cache miss' 38
+
+ $CCACHE_COMPILE -c test1.i
+ checkstat 'cache hit' 10
+ checkstat 'cache miss' 38
+
+ # removed these tests as some compilers (including newer versions of gcc)
+ # determine which language to use based on .ii/.i extension, and C++ may
+ # not be installed
+# testname="direct .ii file"
+# mv test1.i test1.ii
+# $CCACHE_COMPILE -c test1.ii
+# checkstat 'cache hit' 10
+# checkstat 'cache miss' 39
+
+# $CCACHE_COMPILE -c test1.ii
+# checkstat 'cache hit' 11
+# checkstat 'cache miss' 39
+
+ testname="stripc" # This test might not be portable
+ CCACHE_STRIPC=1 $CCACHE_COMPILE -c test1.c
+ checkstat 'cache hit' 10
+ checkstat 'cache miss' 39
+
+ CCACHE_STRIPC=1 $CCACHE_COMPILE -c test1.c
+ checkstat 'cache hit' 11
+ checkstat 'cache miss' 39
+
+ testname="zero-stats"
+ $CCACHE -z > /dev/null
+ checkstat 'cache hit' 0
+ checkstat 'cache miss' 0
+
+ testname="clear"
+ $CCACHE -C > /dev/null
+ checkstat 'files in cache' 0
+
+
+ rm -f test1.c
+}
+
+swigtests() {
+ echo "starting swig testsuite $testsuite"
+ rm -rf "$CCACHE_DIR"
+ checkstat 'cache hit' 0
+ checkstat 'cache miss' 0
+
+ j=1
+ rm -f *.i
+ genswigcode testswig1.i 1
+
+ testname="BASIC"
+ $CCACHE_COMPILE -java testswig1.i
+ checkstat 'cache hit' 0
+ checkstat 'cache miss' 1
+
+ checkstat 'files in cache' 6
+
+ testname="BASIC2"
+ $CCACHE_COMPILE -java testswig1.i
+ checkstat 'cache hit' 1
+ checkstat 'cache miss' 1
+
+ testname="output"
+ $CCACHE_COMPILE -java testswig1.i -o foo_wrap.c
+ checkstat 'cache hit' 1
+ checkstat 'cache miss' 2
+
+ testname="bad"
+ $CCACHE_COMPILE -java testswig1.i -I 2> /dev/null
+ checkstat 'bad compiler arguments' 1
+
+ testname="stdout"
+ $CCACHE_COMPILE -v -java testswig1.i > /dev/null
+ checkstat 'compiler produced stdout' 1
+
+ testname="non-regular"
+ mkdir testd
+ $CCACHE_COMPILE -o testd -java testswig1.i > /dev/null 2>&1
+ rmdir testd
+ checkstat 'output to a non-regular file' 1
+
+ testname="no-input"
+ $CCACHE_COMPILE -java 2> /dev/null
+ checkstat 'no input file' 1
+
+
+ testname="CCACHE_DISABLE"
+ CCACHE_DISABLE=1 $CCACHE_COMPILE -java testswig1.i 2> /dev/null
+ checkstat 'cache hit' 1
+ $CCACHE_COMPILE -java testswig1.i
+ checkstat 'cache hit' 2
+
+ testname="CCACHE_CPP2"
+ CCACHE_CPP2=1 $CCACHE_COMPILE -java -O -O testswig1.i
+ checkstat 'cache hit' 2
+ checkstat 'cache miss' 3
+
+ CCACHE_CPP2=1 $CCACHE_COMPILE -java -O -O testswig1.i
+ checkstat 'cache hit' 3
+ checkstat 'cache miss' 3
+
+ testname="CCACHE_NOSTATS"
+ CCACHE_NOSTATS=1 $CCACHE_COMPILE -java -O -O testswig1.i
+ checkstat 'cache hit' 3
+ checkstat 'cache miss' 3
+
+ testname="CCACHE_RECACHE"
+ CCACHE_RECACHE=1 $CCACHE_COMPILE -java -O -O testswig1.i
+ checkstat 'cache hit' 3
+ checkstat 'cache miss' 4
+
+ # strictly speaking should be 3x6=18 instead of 4x6=24 - RECACHE causes a double counting!
+ checkstat 'files in cache' 24
+ $CCACHE -c > /dev/null
+ checkstat 'files in cache' 18
+
+
+ testname="CCACHE_HASHDIR"
+ CCACHE_HASHDIR=1 $CCACHE_COMPILE -java -O -O testswig1.i
+ checkstat 'cache hit' 3
+ checkstat 'cache miss' 5
+
+ CCACHE_HASHDIR=1 $CCACHE_COMPILE -java -O -O testswig1.i
+ checkstat 'cache hit' 4
+ checkstat 'cache miss' 5
+
+ checkstat 'files in cache' 24
+
+ testname="cpp call"
+ $CCACHE_COMPILE -java -E testswig1.i > testswig1-preproc.i
+ checkstat 'cache hit' 4
+ checkstat 'cache miss' 5
+
+ testname="direct .i compile"
+ $CCACHE_COMPILE -java testswig1.i
+ checkstat 'cache hit' 5
+ checkstat 'cache miss' 5
+
+ # No cache hit due to different input file name, -nopreprocess should not be given twice to SWIG
+ $CCACHE_COMPILE -java -nopreprocess testswig1-preproc.i
+ checkstat 'cache hit' 5
+ checkstat 'cache miss' 6
+
+ $CCACHE_COMPILE -java -nopreprocess testswig1-preproc.i
+ checkstat 'cache hit' 6
+ checkstat 'cache miss' 6
+
+ testname="stripc"
+ CCACHE_STRIPC=1 $CCACHE_COMPILE -java -O -O testswig1.i
+ checkstat 'cache hit' 7
+ checkstat 'cache miss' 6
+
+ CCACHE_STRIPC=1 $CCACHE_COMPILE -java -O -O -O testswig1.i
+ checkstat 'cache hit' 7
+ checkstat 'cache miss' 7
+
+ rm -f testswig1-preproc.i
+ rm -f testswig1.i
+}
+
+######
+# main program
+rm -rf $TESTDIR
+mkdir $TESTDIR
+cd $TESTDIR || exit 1
+CCACHE_DIR="ccache dir" # with space in directory name (like Windows default)
+mkdir "$CCACHE_DIR"
+export CCACHE_DIR
+
+testsuite="base"
+CCACHE_COMPILE="$CCACHE $COMPILER"
+basetests
+CCACHE_COMPILE="$CCACHE $SWIG"
+swigtests
+
+if test -z "$NOSOFTLINKSTEST"; then
+ testsuite="link"
+ ln -s $CCACHE $COMPILER
+ CCACHE_COMPILE="./$COMPILER"
+ basetests
+ rm "./$COMPILER"
+ ln -s $CCACHE $SWIG
+ CCACHE_COMPILE="./$SWIG"
+ swigtests
+ rm "./$SWIG"
+else
+ echo "skipping testsuite link"
+fi
+
+testsuite="hardlink"
+CCACHE_COMPILE="env CCACHE_NOCOMPRESS=1 CCACHE_HARDLINK=1 $CCACHE $COMPILER"
+basetests
+CCACHE_COMPILE="env CCACHE_NOCOMPRESS=1 CCACHE_HARDLINK=1 $CCACHE $SWIG"
+swigtests
+
+testsuite="cpp2"
+CCACHE_COMPILE="env CCACHE_CPP2=1 $CCACHE $COMPILER"
+basetests
+CCACHE_COMPILE="env CCACHE_CPP2=1 $CCACHE $SWIG"
+swigtests
+
+testsuite="nlevels4"
+CCACHE_COMPILE="env CCACHE_NLEVELS=4 $CCACHE $COMPILER"
+basetests
+
+testsuite="nlevels1"
+CCACHE_COMPILE="env CCACHE_NLEVELS=1 $CCACHE $COMPILER"
+basetests
+
+cd ..
+rm -rf $TESTDIR
+echo test done - OK
+exit 0
diff --git a/CCache/unify.c b/CCache/unify.c
new file mode 100644
index 000000000..a93d48a02
--- /dev/null
+++ b/CCache/unify.c
@@ -0,0 +1,307 @@
+/*
+ Copyright (C) Andrew Tridgell 2002
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+/*
+ C/C++ unifier
+
+ the idea is that changes that don't affect the resulting C code
+ should not change the hash. This is achieved by folding white-space
+ and other non-semantic fluff in the input into a single unified format.
+
+ This unifier was design to match the output of the unifier in
+ compilercache, which is flex based. The major difference is that
+ this unifier is much faster (about 2x) and more forgiving of
+ syntactic errors. Continuing on syntactic errors is important to
+ cope with C/C++ extensions in the local compiler (for example,
+ inline assembly systems).
+*/
+
+#include "ccache.h"
+
+static char *s_tokens[] = {
+ "...", ">>=", "<<=", "+=", "-=", "*=", "/=", "%=", "&=", "^=",
+ "|=", ">>", "<<", "++", "--", "->", "&&", "||", "<=", ">=",
+ "==", "!=", ";", "{", "<%", "}", "%>", ",", ":", "=",
+ "(", ")", "[", "<:", "]", ":>", ".", "&", "!", "~",
+ "-", "+", "*", "/", "%", "<", ">", "^", "|", "?",
+ 0
+};
+
+#define C_ALPHA 1
+#define C_SPACE 2
+#define C_TOKEN 4
+#define C_QUOTE 8
+#define C_DIGIT 16
+#define C_HEX 32
+#define C_FLOAT 64
+#define C_SIGN 128
+
+static struct {
+ unsigned char type;
+ unsigned char num_toks;
+ char *toks[7];
+} tokens[256];
+
+/* build up the table used by the unifier */
+static void build_table(void)
+{
+ unsigned char c;
+ int i;
+ static int done;
+
+ if (done) return;
+ done = 1;
+
+ memset(tokens, 0, sizeof(tokens));
+ for (c=0;c<128;c++) {
+ if (isalpha(c) || c == '_') tokens[c].type |= C_ALPHA;
+ if (isdigit(c)) tokens[c].type |= C_DIGIT;
+ if (isspace(c)) tokens[c].type |= C_SPACE;
+ if (isxdigit(c)) tokens[c].type |= C_HEX;
+ }
+ tokens['\''].type |= C_QUOTE;
+ tokens['"'].type |= C_QUOTE;
+ tokens['l'].type |= C_FLOAT;
+ tokens['L'].type |= C_FLOAT;
+ tokens['f'].type |= C_FLOAT;
+ tokens['F'].type |= C_FLOAT;
+ tokens['U'].type |= C_FLOAT;
+ tokens['u'].type |= C_FLOAT;
+
+ tokens['-'].type |= C_SIGN;
+ tokens['+'].type |= C_SIGN;
+
+ for (i=0;s_tokens[i];i++) {
+ c = s_tokens[i][0];
+ tokens[c].type |= C_TOKEN;
+ tokens[c].toks[tokens[c].num_toks] = s_tokens[i];
+ tokens[c].num_toks++;
+ }
+}
+
+/* buffer up characters before hashing them */
+static void pushchar(unsigned char c)
+{
+ static unsigned char buf[64];
+ static int len;
+
+ if (c == 0) {
+ if (len > 0) {
+ hash_buffer((char *)buf, len);
+ len = 0;
+ }
+ hash_buffer(NULL, 0);
+ return;
+ }
+
+ buf[len++] = c;
+ if (len == 64) {
+ hash_buffer((char *)buf, len);
+ len = 0;
+ }
+}
+
+/* hash some C/C++ code after unifying */
+static void unify(unsigned char *p, size_t size)
+{
+ size_t ofs;
+ unsigned char q;
+ int i;
+
+ build_table();
+
+ for (ofs=0; ofs 2 && p[ofs+1] == ' ' && isdigit(p[ofs+2])) {
+ do {
+ ofs++;
+ } while (ofs < size && p[ofs] != '\n');
+ ofs++;
+ } else {
+ do {
+ pushchar(p[ofs]);
+ ofs++;
+ } while (ofs < size && p[ofs] != '\n');
+ pushchar('\n');
+ ofs++;
+ }
+ continue;
+ }
+
+ if (tokens[p[ofs]].type & C_ALPHA) {
+ do {
+ pushchar(p[ofs]);
+ ofs++;
+ } while (ofs < size &&
+ (tokens[p[ofs]].type & (C_ALPHA|C_DIGIT)));
+ pushchar('\n');
+ continue;
+ }
+
+ if (tokens[p[ofs]].type & C_DIGIT) {
+ do {
+ pushchar(p[ofs]);
+ ofs++;
+ } while (ofs < size &&
+ ((tokens[p[ofs]].type & C_DIGIT) || p[ofs] == '.'));
+ if (ofs < size && (p[ofs] == 'x' || p[ofs] == 'X')) {
+ do {
+ pushchar(p[ofs]);
+ ofs++;
+ } while (ofs < size && (tokens[p[ofs]].type & C_HEX));
+ }
+ if (ofs < size && (p[ofs] == 'E' || p[ofs] == 'e')) {
+ pushchar(p[ofs]);
+ ofs++;
+ while (ofs < size &&
+ (tokens[p[ofs]].type & (C_DIGIT|C_SIGN))) {
+ pushchar(p[ofs]);
+ ofs++;
+ }
+ }
+ while (ofs < size && (tokens[p[ofs]].type & C_FLOAT)) {
+ pushchar(p[ofs]);
+ ofs++;
+ }
+ pushchar('\n');
+ continue;
+ }
+
+ if (tokens[p[ofs]].type & C_SPACE) {
+ do {
+ ofs++;
+ } while (ofs < size && (tokens[p[ofs]].type & C_SPACE));
+ continue;
+ }
+
+ if (tokens[p[ofs]].type & C_QUOTE) {
+ q = p[ofs];
+ pushchar(p[ofs]);
+ do {
+ ofs++;
+ while (ofs < size-1 && p[ofs] == '\\') {
+ pushchar(p[ofs]);
+ pushchar(p[ofs+1]);
+ ofs+=2;
+ }
+ pushchar(p[ofs]);
+ } while (ofs < size && p[ofs] != q);
+ pushchar('\n');
+ ofs++;
+ continue;
+ }
+
+ if (tokens[p[ofs]].type & C_TOKEN) {
+ q = p[ofs];
+ for (i=0;i= ofs+len && memcmp(&p[ofs], s, len) == 0) {
+ int j;
+ for (j=0;s[j];j++) {
+ pushchar(s[j]);
+ ofs++;
+ }
+ pushchar('\n');
+ break;
+ }
+ }
+ if (i < tokens[q].num_toks) {
+ continue;
+ }
+ }
+
+ pushchar(p[ofs]);
+ pushchar('\n');
+ ofs++;
+ }
+ pushchar(0);
+}
+
+
+/* hash a file that consists of preprocessor output, but remove any line
+ number information from the hash
+*/
+int unify_hash(const char *fname)
+{
+#ifdef _WIN32
+ HANDLE file;
+ HANDLE section;
+ DWORD filesize_low;
+ char *map;
+ int ret = -1;
+
+ file = CreateFileA(fname, GENERIC_READ, FILE_SHARE_READ, NULL,
+ OPEN_EXISTING, 0, NULL);
+ if (file != INVALID_HANDLE_VALUE) {
+ filesize_low = GetFileSize(file, NULL);
+ if (!(filesize_low == INVALID_FILE_SIZE && GetLastError() != NO_ERROR)) {
+ section = CreateFileMappingA(file, NULL, PAGE_READONLY, 0, 0, NULL);
+ CloseHandle(file);
+ if (section != NULL) {
+ map = MapViewOfFile(section, FILE_MAP_READ, 0, 0, 0);
+ CloseHandle(section);
+ if (map != NULL)
+ ret = 0;
+ }
+ }
+ }
+
+ if (ret == -1) {
+ cc_log("Failed to open preprocessor output %s\n", fname);
+ stats_update(STATS_PREPROCESSOR);
+ return -1;
+ }
+
+ /* pass it through the unifier */
+ unify((unsigned char *)map, filesize_low);
+
+ UnmapViewOfFile(map);
+
+ return 0;
+#else
+ int fd;
+ struct stat st;
+ char *map;
+
+ fd = open(fname, O_RDONLY|O_BINARY);
+ if (fd == -1 || fstat(fd, &st) != 0) {
+ cc_log("Failed to open preprocessor output %s\n", fname);
+ stats_update(STATS_PREPROCESSOR);
+ return -1;
+ }
+
+ /* we use mmap() to make it easy to handle arbitrarily long
+ lines in preprocessor output. I have seen lines of over
+ 100k in length, so this is well worth it */
+ map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
+ if (map == (char *)-1) {
+ cc_log("Failed to mmap %s\n", fname);
+ stats_update(STATS_PREPROCESSOR);
+ return -1;
+ }
+ close(fd);
+
+ /* pass it through the unifier */
+ unify((unsigned char *)map, st.st_size);
+
+ munmap(map, st.st_size);
+
+ return 0;
+#endif
+}
+
diff --git a/CCache/util.c b/CCache/util.c
new file mode 100644
index 000000000..bba232492
--- /dev/null
+++ b/CCache/util.c
@@ -0,0 +1,884 @@
+/*
+ Copyright (C) Andrew Tridgell 2002
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "ccache.h"
+
+static FILE *logfile;
+
+/* log a message to the CCACHE_LOGFILE location */
+void cc_log(const char *format, ...)
+{
+ va_list ap;
+ extern char *cache_logfile;
+
+ if (!cache_logfile) return;
+
+ if (!logfile) logfile = fopen(cache_logfile, "a");
+ if (!logfile) return;
+
+ va_start(ap, format);
+ vfprintf(logfile, format, ap);
+ va_end(ap);
+ fflush(logfile);
+}
+
+/* something went badly wrong! */
+void fatal(const char *msg)
+{
+ cc_log("FATAL: %s\n", msg);
+ exit(1);
+}
+
+int safe_rename(const char* oldpath, const char* newpath)
+{
+ /* safe_rename is for creating entries in the cache.
+
+ Works like rename(), but it never overwrites an existing
+ cache entry. This avoids corruption on NFS. */
+#ifndef _WIN32
+ int status = link(oldpath, newpath);
+ if( status == 0 || errno == EEXIST )
+#else
+ int status = CreateHardLinkA(newpath, oldpath, NULL) ? 0 : -1;
+ if( status == 0 || GetLastError() == ERROR_ALREADY_EXISTS )
+#endif
+ {
+ return unlink( oldpath );
+ }
+ else
+ {
+ return -1;
+ }
+}
+
+#ifndef ENABLE_ZLIB
+/* copy all data from one file descriptor to another */
+void copy_fd(int fd_in, int fd_out)
+{
+ char buf[10240];
+ int n;
+
+ while ((n = read(fd_in, buf, sizeof(buf))) > 0) {
+ if (write(fd_out, buf, n) != n) {
+ fatal("Failed to copy fd");
+ }
+ }
+}
+
+#ifndef HAVE_MKSTEMP
+/* cheap and nasty mkstemp replacement */
+static int mkstemp(char *template)
+{
+ mktemp(template);
+ return open(template, O_RDWR | O_CREAT | O_EXCL | O_BINARY, 0600);
+}
+#endif
+
+/* move a file using rename */
+int move_file(const char *src, const char *dest) {
+ return safe_rename(src, dest);
+}
+
+/* copy a file - used when hard links don't work
+ the copy is done via a temporary file and atomic rename
+*/
+static int copy_file(const char *src, const char *dest)
+{
+ int fd1, fd2;
+ char buf[10240];
+ int n;
+ char *tmp_name;
+ mode_t mask;
+
+ x_asprintf(&tmp_name, "%s.XXXXXX", dest);
+
+ fd1 = open(src, O_RDONLY|O_BINARY);
+ if (fd1 == -1) {
+ free(tmp_name);
+ return -1;
+ }
+
+ fd2 = mkstemp(tmp_name);
+ if (fd2 == -1) {
+ close(fd1);
+ free(tmp_name);
+ return -1;
+ }
+
+ while ((n = read(fd1, buf, sizeof(buf))) > 0) {
+ if (write(fd2, buf, n) != n) {
+ close(fd2);
+ close(fd1);
+ unlink(tmp_name);
+ free(tmp_name);
+ return -1;
+ }
+ }
+
+ close(fd1);
+
+ /* get perms right on the tmp file */
+#ifndef _WIN32
+ mask = umask(0);
+ fchmod(fd2, 0666 & ~mask);
+ umask(mask);
+#else
+ (void)mask;
+#endif
+
+ /* the close can fail on NFS if out of space */
+ if (close(fd2) == -1) {
+ unlink(tmp_name);
+ free(tmp_name);
+ return -1;
+ }
+
+ unlink(dest);
+
+ if (rename(tmp_name, dest) == -1) {
+ unlink(tmp_name);
+ free(tmp_name);
+ return -1;
+ }
+
+ free(tmp_name);
+
+ return 0;
+}
+
+/* copy a file to the cache */
+static int copy_file_to_cache(const char *src, const char *dest) {
+ return copy_file(src, dest);
+}
+
+/* copy a file from the cache */
+static int copy_file_from_cache(const char *src, const char *dest) {
+ return copy_file(src, dest);
+}
+
+#else /* ENABLE_ZLIB */
+
+/* copy all data from one file descriptor to another
+ possibly decompressing it
+*/
+void copy_fd(int fd_in, int fd_out) {
+ char buf[10240];
+ int n;
+ gzFile gz_in;
+
+ gz_in = gzdopen(dup(fd_in), "rb");
+
+ if (!gz_in) {
+ fatal("Failed to copy fd");
+ }
+
+ while ((n = gzread(gz_in, buf, sizeof(buf))) > 0) {
+ if (write(fd_out, buf, n) != n) {
+ fatal("Failed to copy fd");
+ }
+ }
+}
+
+static int _copy_file(const char *src, const char *dest, int mode) {
+ int fd_in, fd_out;
+ gzFile gz_in, gz_out = NULL;
+ char buf[10240];
+ int n, ret;
+ char *tmp_name;
+ mode_t mask;
+ struct stat st;
+
+ x_asprintf(&tmp_name, "%s.XXXXXX", dest);
+
+ if (getenv("CCACHE_NOCOMPRESS")) {
+ mode = COPY_UNCOMPRESSED;
+ }
+
+ /* open source file */
+ fd_in = open(src, O_RDONLY);
+ if (fd_in == -1) {
+ return -1;
+ }
+
+ gz_in = gzdopen(fd_in, "rb");
+ if (!gz_in) {
+ close(fd_in);
+ return -1;
+ }
+
+ /* open destination file */
+ fd_out = mkstemp(tmp_name);
+ if (fd_out == -1) {
+ gzclose(gz_in);
+ free(tmp_name);
+ return -1;
+ }
+
+ if (mode == COPY_TO_CACHE) {
+ /* The gzip file format occupies at least 20 bytes. So
+ it will always occupy an entire filesystem block,
+ even for empty files.
+ Since most stderr files will be empty, we turn off
+ compression in this case to save space.
+ */
+ if (fstat(fd_in, &st) != 0) {
+ gzclose(gz_in);
+ close(fd_out);
+ free(tmp_name);
+ return -1;
+ }
+ if (file_size(&st) == 0) {
+ mode = COPY_UNCOMPRESSED;
+ }
+ }
+
+ if (mode == COPY_TO_CACHE) {
+ gz_out = gzdopen(dup(fd_out), "wb");
+ if (!gz_out) {
+ gzclose(gz_in);
+ close(fd_out);
+ free(tmp_name);
+ return -1;
+ }
+ }
+
+ while ((n = gzread(gz_in, buf, sizeof(buf))) > 0) {
+ if (mode == COPY_TO_CACHE) {
+ ret = gzwrite(gz_out, buf, n);
+ } else {
+ ret = write(fd_out, buf, n);
+ }
+ if (ret != n) {
+ gzclose(gz_in);
+ if (gz_out) {
+ gzclose(gz_out);
+ }
+ close(fd_out);
+ unlink(tmp_name);
+ free(tmp_name);
+ return -1;
+ }
+ }
+
+ gzclose(gz_in);
+ if (gz_out) {
+ gzclose(gz_out);
+ }
+
+ /* get perms right on the tmp file */
+ mask = umask(0);
+ fchmod(fd_out, 0666 & ~mask);
+ umask(mask);
+
+ /* the close can fail on NFS if out of space */
+ if (close(fd_out) == -1) {
+ unlink(tmp_name);
+ free(tmp_name);
+ return -1;
+ }
+
+ unlink(dest);
+
+ if (rename(tmp_name, dest) == -1) {
+ unlink(tmp_name);
+ free(tmp_name);
+ return -1;
+ }
+
+ free(tmp_name);
+
+ return 0;
+}
+
+/* move a file to the cache, compressing it */
+int move_file(const char *src, const char *dest) {
+ int ret;
+
+ ret = _copy_file(src, dest, COPY_TO_CACHE);
+ if (ret != -1) unlink(src);
+ return ret;
+}
+
+/* copy a file to the cache, compressing it */
+static int copy_file_to_cache(const char *src, const char *dest) {
+ return _copy_file(src, dest, COPY_TO_CACHE);
+}
+
+/* copy a file from the cache, decompressing it */
+static int copy_file_from_cache(const char *src, const char *dest) {
+ return _copy_file(src, dest, COPY_FROM_CACHE);
+}
+#endif /* ENABLE_ZLIB */
+
+/* test if a file is zlib compressed */
+int test_if_compressed(const char *filename) {
+ FILE *f;
+
+ f = fopen(filename, "rb");
+ if (!f) {
+ return 0;
+ }
+
+ /* test if file starts with 1F8B, which is zlib's
+ * magic number */
+ if ((fgetc(f) != 0x1f) || (fgetc(f) != 0x8b)) {
+ fclose(f);
+ return 0;
+ }
+
+ fclose(f);
+ return 1;
+}
+
+/* copy file to the cache with error checking taking into account compression and hard linking if desired */
+int commit_to_cache(const char *src, const char *dest, int hardlink)
+{
+ int ret = -1;
+ struct stat st;
+ if (stat(src, &st) == 0) {
+ unlink(dest);
+ if (hardlink) {
+#ifdef _WIN32
+ ret = CreateHardLinkA(dest, src, NULL) ? 0 : -1;
+#else
+ ret = link(src, dest);
+#endif
+ }
+ if (ret == -1) {
+ ret = copy_file_to_cache(src, dest);
+ if (ret == -1) {
+ cc_log("failed to commit %s -> %s (%s)\n", src, dest, strerror(errno));
+ stats_update(STATS_ERROR);
+ }
+ }
+ } else {
+ cc_log("failed to put %s in the cache (%s)\n", src, strerror(errno));
+ stats_update(STATS_ERROR);
+ }
+ return ret;
+}
+
+/* copy file out of the cache with error checking taking into account compression and hard linking if desired */
+int retrieve_from_cache(const char *src, const char *dest, int hardlink)
+{
+ int ret = 0;
+
+ x_utimes(src);
+
+ if (strcmp(dest, "/dev/null") == 0) {
+ ret = 0;
+ } else {
+ unlink(dest);
+ /* only make a hardlink if the cache file is uncompressed */
+ if (hardlink && test_if_compressed(src) == 0) {
+#ifdef _WIN32
+ ret = CreateHardLinkA(dest, src, NULL) ? 0 : -1;
+#else
+ ret = link(src, dest);
+#endif
+ } else {
+ ret = copy_file_from_cache(src, dest);
+ }
+ }
+
+ /* the cached file might have been deleted by some external process */
+ if (ret == -1 && errno == ENOENT) {
+ cc_log("hashfile missing for %s\n", dest);
+ stats_update(STATS_MISSING);
+ return -1;
+ }
+
+ if (ret == -1) {
+ ret = copy_file_from_cache(src, dest);
+ if (ret == -1) {
+ cc_log("failed to retrieve %s -> %s (%s)\n", src, dest, strerror(errno));
+ stats_update(STATS_ERROR);
+ return -1;
+ }
+ }
+ return ret;
+}
+
+/* make sure a directory exists */
+int create_dir(const char *dir)
+{
+ struct stat st;
+ if (stat(dir, &st) == 0) {
+ if (S_ISDIR(st.st_mode)) {
+ return 0;
+ }
+ errno = ENOTDIR;
+ return 1;
+ }
+#ifdef _WIN32
+ if (mkdir(dir) != 0 && errno != EEXIST) {
+ return 1;
+ }
+#else
+ if (mkdir(dir, 0777) != 0 && errno != EEXIST) {
+ return 1;
+ }
+#endif
+ return 0;
+}
+
+char const CACHEDIR_TAG[] =
+ "Signature: 8a477f597d28d172789f06886806bc55\n"
+ "# This file is a cache directory tag created by ccache.\n"
+ "# For information about cache directory tags, see:\n"
+ "# http://www.brynosaurus.com/cachedir/\n";
+
+int create_cachedirtag(const char *dir)
+{
+ char *filename;
+ struct stat st;
+ FILE *f;
+ x_asprintf(&filename, "%s/CACHEDIR.TAG", dir);
+ if (stat(filename, &st) == 0) {
+ if (S_ISREG(st.st_mode)) {
+ goto success;
+ }
+ errno = EEXIST;
+ goto error;
+ }
+ f = fopen(filename, "w");
+ if (!f) goto error;
+ if (fwrite(CACHEDIR_TAG, sizeof(CACHEDIR_TAG)-1, 1, f) != 1) {
+ goto error;
+ }
+ if (fclose(f)) goto error;
+success:
+ free(filename);
+ return 0;
+error:
+ free(filename);
+ return 1;
+}
+
+/*
+ this is like asprintf() but dies if the malloc fails
+ note that we use vsnprintf in a rather poor way to make this more portable
+*/
+void x_asprintf(char **ptr, const char *format, ...)
+{
+ va_list ap;
+
+ *ptr = NULL;
+ va_start(ap, format);
+ if (vasprintf(ptr, format, ap) == -1) {
+ fatal("out of memory in x_asprintf");
+ }
+ va_end(ap);
+
+ if (!ptr) fatal("out of memory in x_asprintf");
+}
+
+/*
+ this is like strdup() but dies if the malloc fails
+*/
+char *x_strdup(const char *s)
+{
+ char *ret;
+ ret = strdup(s);
+ if (!ret) {
+ fatal("out of memory in strdup\n");
+ }
+ return ret;
+}
+
+/*
+ this is like malloc() but dies if the malloc fails
+*/
+void *x_malloc(size_t size)
+{
+ void *ret;
+ ret = malloc(size);
+ if (!ret) {
+ fatal("out of memory in malloc\n");
+ }
+ return ret;
+}
+
+/*
+ this is like realloc() but dies if the malloc fails
+*/
+void *x_realloc(void *ptr, size_t size)
+{
+ void *p2;
+#if 1
+ /* Avoid invalid read in memcpy below */
+ p2 = realloc(ptr, size);
+ if (!p2) {
+ fatal("out of memory in x_realloc");
+ }
+#else
+ if (!ptr) return x_malloc(size);
+ p2 = malloc(size);
+ if (!p2) {
+ fatal("out of memory in x_realloc");
+ }
+ if (ptr) {
+ /* Note invalid read as the memcpy reads beyond the memory allocated by ptr */
+ memcpy(p2, ptr, size);
+ free(ptr);
+ }
+#endif
+ return p2;
+}
+
+
+/*
+ revsusive directory traversal - used for cleanup
+ fn() is called on all files/dirs in the tree
+ */
+void traverse(const char *dir, void (*fn)(const char *, struct stat *))
+{
+ DIR *d;
+ struct dirent *de;
+
+ d = opendir(dir);
+ if (!d) return;
+
+ while ((de = readdir(d))) {
+ char *fname;
+ struct stat st;
+
+ if (strcmp(de->d_name,".") == 0) continue;
+ if (strcmp(de->d_name,"..") == 0) continue;
+
+ if (strlen(de->d_name) == 0) continue;
+
+ x_asprintf(&fname, "%s/%s", dir, de->d_name);
+#ifdef _WIN32
+ if (stat(fname, &st))
+#else
+ if (lstat(fname, &st))
+#endif
+ {
+ if (errno != ENOENT) {
+ perror(fname);
+ }
+ free(fname);
+ continue;
+ }
+
+ if (S_ISDIR(st.st_mode)) {
+ traverse(fname, fn);
+ }
+
+ fn(fname, &st);
+ free(fname);
+ }
+
+ closedir(d);
+}
+
+
+/* return the base name of a file - caller frees */
+char *str_basename(const char *s)
+{
+ char *p = strrchr(s, '/');
+ if (p) {
+ s = (p+1);
+ }
+
+#ifdef _WIN32
+ p = strrchr(s, '\\');
+
+ if (p) {
+ s = (p+1);
+ }
+#endif
+
+ return x_strdup(s);
+}
+
+/* return the dir name of a file - caller frees */
+char *dirname(char *s)
+{
+ char *p;
+ s = x_strdup(s);
+ p = strrchr(s, '/');
+#ifdef _WIN32
+ p = strrchr(s, '\\');
+#endif
+ if (p) {
+ *p = 0;
+ }
+ return s;
+}
+
+/*
+ http://www.ecst.csuchico.edu/~beej/guide/ipc/flock.html
+ http://cvs.php.net/viewvc.cgi/php-src/win32/flock.c?revision=1.2&view=markup
+ Should return 0 for success, >0 otherwise
+ */
+int lock_fd(int fd)
+{
+#ifdef _WIN32
+# if 1
+ return _locking(fd, _LK_NBLCK, 1);
+# else
+ HANDLE fl = (HANDLE)_get_osfhandle(fd);
+ OVERLAPPED o;
+ memset(&o, 0, sizeof(o));
+ return (LockFileEx(fl, LOCKFILE_EXCLUSIVE_LOCK, 0, 1, 0, &o))
+ ? 0 : GetLastError();
+# endif
+#else
+ struct flock fl;
+ int ret;
+
+ fl.l_type = F_WRLCK;
+ fl.l_whence = SEEK_SET;
+ fl.l_start = 0;
+ fl.l_len = 1;
+ fl.l_pid = 0;
+
+ /* not sure why we would be getting a signal here,
+ but one user claimed it is possible */
+ do {
+ ret = fcntl(fd, F_SETLKW, &fl);
+ } while (ret == -1 && errno == EINTR);
+ return ret;
+#endif
+}
+
+/* return size on disk of a file */
+size_t file_size(struct stat *st)
+{
+#ifdef _WIN32
+ return (st->st_size + 1023) & ~1023;
+#else
+ size_t size = st->st_blocks * 512;
+ if ((size_t)st->st_size > size) {
+ /* probably a broken stat() call ... */
+ size = (st->st_size + 1023) & ~1023;
+ }
+ return size;
+#endif
+}
+
+
+/* a safe open/create for read-write */
+int safe_open(const char *fname)
+{
+ int fd = open(fname, O_RDWR|O_BINARY);
+ if (fd == -1 && errno == ENOENT) {
+ fd = open(fname, O_RDWR|O_CREAT|O_EXCL|O_BINARY, 0666);
+ if (fd == -1 && errno == EEXIST) {
+ fd = open(fname, O_RDWR|O_BINARY);
+ }
+ }
+ return fd;
+}
+
+/* display a kilobyte unsigned value in M, k or G */
+void display_size(unsigned v)
+{
+ if (v > 1024*1024) {
+ printf("%8.1f Gbytes", v/((double)(1024*1024)));
+ } else if (v > 1024) {
+ printf("%8.1f Mbytes", v/((double)(1024)));
+ } else {
+ printf("%8u Kbytes", v);
+ }
+}
+
+/* return a value in multiples of 1024 give a string that can end
+ in K, M or G
+*/
+size_t value_units(const char *s)
+{
+ char m;
+ double v = atof(s);
+ m = s[strlen(s)-1];
+ switch (m) {
+ case 'G':
+ case 'g':
+ default:
+ v *= 1024*1024;
+ break;
+ case 'M':
+ case 'm':
+ v *= 1024;
+ break;
+ case 'K':
+ case 'k':
+ v *= 1;
+ break;
+ }
+ return (size_t)v;
+}
+
+
+/*
+ a sane realpath() function, trying to cope with stupid path limits and
+ a broken API
+*/
+char *x_realpath(const char *path)
+{
+#ifdef _WIN32
+ char namebuf[MAX_PATH];
+ DWORD ret;
+
+ ret = GetFullPathNameA(path, sizeof(namebuf), namebuf, NULL);
+ if (ret == 0 || ret >= sizeof(namebuf)) {
+ return NULL;
+ }
+
+ return x_strdup(namebuf);
+#else
+ int maxlen;
+ char *ret, *p;
+#ifdef PATH_MAX
+ maxlen = PATH_MAX;
+#elif defined(MAXPATHLEN)
+ maxlen = MAXPATHLEN;
+#elif defined(_PC_PATH_MAX)
+ maxlen = pathconf(path, _PC_PATH_MAX);
+#endif
+ if (maxlen < 4096) maxlen = 4096;
+
+ ret = x_malloc(maxlen);
+
+#if HAVE_REALPATH
+ p = realpath(path, ret);
+#else
+ /* yes, there are such systems. This replacement relies on
+ the fact that when we call x_realpath we only care about symlinks */
+ {
+ int len = readlink(path, ret, maxlen-1);
+ if (len == -1) {
+ free(ret);
+ return NULL;
+ }
+ ret[len] = 0;
+ p = ret;
+ }
+#endif
+ if (p) {
+ p = x_strdup(p);
+ free(ret);
+ return p;
+ }
+ free(ret);
+ return NULL;
+#endif
+}
+
+/* a getcwd that will returns an allocated buffer */
+char *gnu_getcwd(void)
+{
+ unsigned size = 128;
+
+ while (1) {
+ char *buffer = (char *)x_malloc(size);
+ if (getcwd(buffer, size) == buffer) {
+ return buffer;
+ }
+ free(buffer);
+ if (errno != ERANGE) {
+ return 0;
+ }
+ size *= 2;
+ }
+}
+
+/* create an empty file */
+int create_empty_file(const char *fname)
+{
+ int fd;
+
+ fd = open(fname, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL|O_BINARY, 0666);
+ if (fd == -1) {
+ return -1;
+ }
+ close(fd);
+ return 0;
+}
+
+/*
+ return current users home directory or die
+*/
+const char *get_home_directory(void)
+{
+#ifdef _WIN32
+ static char home_path[MAX_PATH] = {0};
+ HRESULT ret;
+
+ /* we already have the path */
+ if (home_path[0] != 0) {
+ return home_path;
+ }
+
+ /* get the path to "Application Data" folder */
+ ret = SHGetFolderPathA(NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE, NULL, 0, home_path);
+ if (SUCCEEDED(ret)) {
+ return home_path;
+ }
+
+ fprintf(stderr, "ccache: Unable to determine home directory\n");
+ return NULL;
+#else
+ const char *p = getenv("HOME");
+ if (p) {
+ return p;
+ }
+#ifdef HAVE_GETPWUID
+ {
+ struct passwd *pwd = getpwuid(getuid());
+ if (pwd) {
+ return pwd->pw_dir;
+ }
+ }
+#endif
+ fatal("Unable to determine home directory");
+ return NULL;
+#endif
+}
+
+int x_utimes(const char *filename)
+{
+#ifdef HAVE_UTIMES
+ return utimes(filename, NULL);
+#else
+ return utime(filename, NULL);
+#endif
+}
+
+#ifdef _WIN32
+/* perror for Win32 API calls, using GetLastError() instead of errno */
+void perror_win32(LPTSTR pszFunction)
+{
+ LPTSTR pszMessage;
+ DWORD dwLastError = GetLastError();
+
+ FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ dwLastError,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPTSTR)&pszMessage,
+ 0, NULL );
+
+ fprintf(stderr, "%s: %s\n", pszFunction, pszMessage);
+ LocalFree(pszMessage);
+}
+#endif
diff --git a/CCache/web/index.html b/CCache/web/index.html
new file mode 100644
index 000000000..4af839135
--- /dev/null
+++ b/CCache/web/index.html
@@ -0,0 +1,158 @@
+
+
+
+ccache
+
+
+
ccache
+
+ccache is a compiler cache. It acts as a caching pre-processor to
+C/C++ compilers, using the -E compiler switch and a hash to detect
+when a compilation can be satisfied from cache. This often results in
+a 5 to 10 times speedup in common compilations.
+
+The idea came from Erik Thiele wrote the original compilercache program
+as a bourne shell script. ccache is a re-implementation of Erik's idea
+in C with more features and better performance.
+
+
Latest release
+
+The latest release is ccache 2.4.
+
+
+
Added CCACHE_READONLY option
+
Added CCACHE_TEMPDIR option
+
fixed handling of hard-linked compilers on AIX
+
added O_BINARY support, to try and support win32 compiles
+
show cache directory in stats output
+
fixed handling of HOME environment variable
+
+
+See the manual page for details
+on the new options.
NOTE! This release changes the hash input slighly, so you will
+probably find that you will not get any hits against your existing
+cache when you upgrade.
+
+
Why bother?
+
+Why bother with a compiler cache? If you ever run "make clean; make"
+then you can probably benefit from ccache. It is very common for
+developers to do a clean build of a project for a whole host of
+reasons, and this throws away all the information from your previous
+compiles.
+
+By using ccache you can get exactly the same effect as "make clean;
+make" but much faster. It also helps a lot when doing RPM builds,
+as RPM can make doing incremental builds tricky.
+
+I put the effort into writing ccache for 2 reasons. The first is the
+Samba build farm
+(http://build.samba.org/)
+which constantly does clean builds of Samba on about 30 machines after each
+CVS commit. On some of those machines the build took over an hour. By
+using ccache we get the same effect as clean builds but about 6 times
+faster.
+
+The second reason is the autobuild system I used to run for
+Quantum. That system builds our whole Linux based OS from scratch
+after every CVS commit to catch compilation problems quickly. Using
+ccache those builds are much faster.
+
+
Is it safe?
+
+Yes. The most important aspect of a compiler cache is to always
+produce exactly the same output that the real compiler would
+produce. The includes providing exactly the same object files and
+exactly the same compiler warnings that would be produced if you use
+the real compiler. The only way you should be able to tell that you
+are using ccache is the speed.
+
+I have coded ccache very carefully to try to provide these guarantees.
+
+
+
+Here are some results for compiling Samba on my Linux laptop. I have
+also included the results of using Erik's compilercache program
+(version 1.0.10) for comparison.
+
+
+
ccache
compilercache
+
normal
13m 4s
13m 4s
+
uncached
13m 15s
15m 41s
+
cached
2m 45s
4m 26s
+
+
+
How to use it
+
+You can use ccache in two ways. The first is just to prefix your
+compile commands with "ccache". For example, you could change the
+"CC=gcc" line in your Makefile to be "CC=ccache gcc".
+
+Alternatively, you can create symbolic links from your compilers name
+to ccache. This allows you to use ccache without any changes to your
+build system.
+
+
A mailing
+list is available for discussion of ccache.
+
+
+
+
+Andrew Tridgell
+bugs@ccache.samba.org
+
+
+
+
diff --git a/CHANGES b/CHANGES
index 782849c6f..d9426512b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,488 @@ SWIG (Simplified Wrapper and Interface Generator)
See CHANGES.current for current version.
+Version 1.3.39 (21 March 2009)
+==============================
+
+2009-03-19: bhy
+ [Python] Fix the memory leak related to Python 3 unicode and C char* conversion,
+ which can be shown in the following example before this fix:
+
+ from li_cstring import *
+ i=0
+ while True:
+ i += 1
+ n = str(i)*10
+ test3(n)
+
+ This fix affected SWIG_AsCharPtrAndSize() so you cannot call this function with
+ a null alloc and non-null cptr argument in Python 3, otherwise a runtime error
+ will be raised.
+
+2009-03-18: wsfulton
+ [C#] std::vector wrapper improvements for .NET 2 and also providing the
+ necessary machinery to use the std::vector wrappers with more advanced features such
+ as LINQ - the C# proxy class now derives from IEnumerable<>. The default is now to
+ generate code requiring .NET 2 as a minimum, although the C# code can be compiled
+ for .NET 1 by defining the SWIG_DOTNET_1 C# preprocessor constant. See the
+ std_vector.i file for more details.
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2009-03-12: wsfulton
+ [Ruby] Fix #2676738 SWIG generated symbol name clashes.
+
+2009-03-01: bhy
+ [Python] Some fixes for Python 3.0.1 and higher support. In 3.0.1, the C API function
+ PyObject_Compare is removed, so PyObject_RichCompareBool is used for replacement.
+ Struct initilization of SwigPyObject and SwigPyObject_as_number changed to reflect
+ the drop of tp_compare and nb_long.
+
+2009-03-01: bhy
+ [Python] Fix SF#2583160. Now the importer in Python shadow wrapper take care of the
+ case that module already imported at other place.
+
+2009-02-28: bhy
+ [Python] Fix SF#2637352. Move struct declaration of SWIG_module in pyinit.swg before
+ the method calls, since some C compiler don't allow declaration in middle of function
+ body.
+
+2009-02-21: wsfulton
+ [Allegrocl] Fix seg fault wrapping some constant variable (%constant) types.
+
+2009-02-20: wsfulton
+ [CFFI] Fix seg faults when for %extend and using statements.
+
+2009-02-20: wsfulton
+ Fix SF #2605955: -co option which broke in 1.3.37.
+
+2009-02-20: wsfulton
+ New %insert("begin") section added. Also can be used as %begin. This is a new
+ code section reserved entirely for users and the code within the section is generated
+ at the top of the C/C++ wrapper file and so provides a means to put custom code
+ into the wrapper file before anything else that SWIG generates.
+
+2009-02-17: wsfulton
+ 'make clean-test-suite' will now run clean on ALL languages. Previously it only
+ ran the correctly configured languages. This way it is now possible to clean up
+ properly after running 'make partialcheck-test-suite'.
+
+2009-02-14: wsfulton
+ Extend attribute library support for structs/classes and the accessor functions use
+ pass/return by value semantics. Two new macros are available and usage is identical
+ to %attribute. These are %attributeval for structs/classes and %attributestring for
+ string classes, like std::string. See attribute.swg for more details.
+
+2009-02-13: wsfulton
+ Add support for %extend and memberin typemaps. Previously the memberin typemaps were
+ ignored for member variables within a %extend block.
+
+2009-02-12: wsfulton
+ Remove unnecessary temporary variable when wrapping return values that are references.
+ Example of generated code for wrapping:
+
+ struct XYZ {
+ std::string& refReturn();
+ };
+
+ used to be:
+
+ std::string *result = 0 ;
+ ...
+ {
+ std::string &_result_ref = (arg1)->refReturn();
+ result = (std::string *) &_result_ref;
+ }
+
+ Now it is:
+
+ std::string *result = 0 ;
+ ...
+ result = (std::string *) &(arg1)->refReturn();
+
+2009-02-08: bhy
+ Change the SIZE mapped by %pybuffer_mutable_binary and %pybuffer_binary in pybuffer.i from
+ the length of the buffer to the number of items in the buffer.
+
+2009-02-08: wsfulton
+ Fix %feature not working for conversion operators, reported by Matt Sprague, for example:
+ %feature("cs:methodmodifiers") operator bool "protected";
+
+2009-02-07: wsfulton
+ [MzScheme] Apply #2081967 configure changes for examples to build with recent PLT versions.
+ Also fixes Makefile errors building SWIG executable when mzscheme package is installed
+ (version 3.72 approx and later).
+
+2009-02-04: talby
+ [Perl] Fix SF#2564192 reported by David Kolovratnk.
+ SWIG_AsCharPtrAndSize() now handles "get" magic.
+
+Version 1.3.38 (31 January 2009)
+================================
+
+2009-01-31: bhy
+ [Python] Fix SF#2552488 reported by Gaetan Lehmann. Now %pythonprepend
+ and %pythonappend have correct indentation.
+
+2009-01-31: bhy
+ [Python] Fix SF#2552048 reported by Gaetan Lehmann. The parameter list
+ of static member function in generated proxy code should not have the
+ 'self' parameter.
+
+2009-01-29: wsfulton
+ Fix regression introduced in 1.3.37 where the default output directory
+ for target language specific files (in the absence of -outdir) was no
+ longer the same directory as the generated c/c++ file.
+
+2009-01-28: wsfulton
+ [Java, C#] Fix proxy class not being used when the global scope operator
+ was used for parameters passed by value. Reported by David Piepgrass.
+
+2009-01-15: wsfulton
+ [Perl] Fix seg fault when running with -v option, reported by John Ky.
+
+Version 1.3.37 (13 January 2009)
+================================
+
+2009-01-13: mgossage
+ [Lua] Added contract support for requiring that unsigned numbers are >=0
+ Rewrote much of Examples/Lua/embed3.
+ Added a lot to the Lua documentation.
+
+2009-01-13: wsfulton
+ Fix compilation error when using directors on protected virtual overloaded
+ methods reported by Sam Hendley.
+
+2009-01-12: drjoe
+ [R] Fixed handling of integer arrays
+
+2009-01-10: drjoe
+ [R] Fix integer handling in r to deal correctly with signed
+ and unsigned issues
+
+2009-01-10: wsfulton
+ Patch #1992756 from Colin McDonald - %contract not working for classes
+ in namespace
+
+2009-01-05: olly
+ Mark SWIGPERL5, SWIGPHP5, and SWIGTCL8 as deprecated in the source
+ code and remove documentation of them.
+
+2008-12-30: wsfulton
+ Bug #2430756. All the languages now define a macro in the generated C/C++
+ wrapper file indicating which language is being wrapped. The macro name is the
+ same as those defined when SWIG is run, eg SWIGJAVA, SWIGOCTAVE, SWIGCSHARP etc
+ and are listed in the "Conditional Compilation" section in the documentation.
+
+2008-12-23: wsfulton
+ [Java] Fix #2153773 - %nojavaexception was clearing the exception feature
+ instead of disabling it. Clearing checked Java exceptions also didn't work.
+ The new %clearjavaexception can be used for clearing the exception feature.
+
+2008-12-22: wsfulton
+ Fix #2432801 - Make SwigValueWrapper exception safe for when copy constructors
+ throw exceptions.
+
+2008-12-21: wsfulton
+ Apply patch #2440046 which fixes possible seg faults for member and global
+ variable char arrays when the strings are larger than the string array size.
+
+2008-12-20: wsfulton
+ The ccache compiler cache has been adapted to work with SWIG and
+ named ccache-swig. It now works with C/C++ compilers as well as SWIG
+ and can result in impressive speedups when used to recompile unchanged
+ code with either a C/C++ compiler or SWIG. Documentation is in CCache.html
+ or the installed ccache-swig man page.
+
+2008-12-12: wsfulton
+ Apply patch from Kalyanov Dmitry which fixes parsing of nested structs
+ containing comments.
+
+2008-12-12: wsfulton
+ Fix error message in some nested struct and %inline parsing error situations
+ such as unterminated strings and comments.
+
+2008-12-07: olly
+ [PHP] Fix warnings when compiling generated wrapper with GCC 4.3.
+
+2008-12-06: wsfulton
+ [PHP] Deprecate %pragma(php4). Please use %pragma(php) instead.
+ The following two warnings have been renamed:
+ WARN_PHP4_MULTIPLE_INHERITANCE -> WARN_PHP_MULTIPLE_INHERITANCE
+ WARN_PHP4_UNKNOWN_PRAGMA -> WARN_PHP_UNKNOWN_PRAGMA
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2008-12-04: bhy
+ [Python] Applied patch SF#2158938: all the SWIG symbol names started with Py
+ are changed, since they are inappropriate and discouraged in Python
+ documentation (from http://www.python.org/doc/2.5.2/api/includes.html):
+
+ "All user visible names defined by Python.h (except those defined by
+ the included standard headers) have one of the prefixes "Py" or "_Py".
+ Names beginning with "_Py" are for internal use by the Python implementation
+ and should not be used by extension writers. Structure member names do
+ not have a reserved prefix.
+
+ Important: user code should never define names that begin with "Py" or "_Py".
+ This confuses the reader, and jeopardizes the portability of the user
+ code to future Python versions, which may define additional names beginning
+ with one of these prefixes."
+
+ Here is a brief list of what changed:
+
+ PySwig* -> SwigPy*
+ PyObject_ptr -> SwigPtr_PyObject
+ PyObject_var -> SwigVar_PyObject
+ PySequence_Base, PySequence_Cont, PySequence_Ref ->
+ SwigPySequence_Base, SwigPySequence_Cont, SwigPySequence_Ref
+ PyMap* -> SwigPyMap*
+
+ We provided a pyname_compat.i for backward compatibility. Users whose code having
+ these symbols and do not want to change it could simply include this file
+ at front of your code. A better solution is to run the converting tool on
+ your code, which has been put in SWIG's SVN trunk (Tools/pyname_patch.py) and
+ you can download it here:
+ https://swig.svn.sourceforge.net/svnroot/swig/trunk/Tools/pyname_patch.py
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2008-12-02: wsfulton
+ [Python] Apply patch #2143727 from Serge Monkewitz to fix importing base classes
+ when the package option is specified in %module and that module is %import'ed.
+
+2008-11-28: wsfulton
+ [UTL] Fix #2080497. Some incorrect acceptance of types in the STL, eg a double * element
+ passed into a vector constructor would be accepted, but the ensuing behaviour
+ was undefined. Now the type conversion correctly raises an exception.
+
+2008-11-24: wsfulton
+ Add -outcurrentdir option. This sets the default output directory to the current
+ directory instead of the path specified by the input file. This option enables
+ behaviour similar to c/c++ compilers. Note that this controls the output directory,
+ but only in the absence of the -o and/or -outdir options.
+
+2008-11-23: wsfulton
+ [ruby] Apply patch #2263850 to fix ruby/file.i ... rubyio.h filename change in
+ ruby 1.9.
+
+2008-11-23: wsfulton
+ Apply patch #2319790 from Johan Hake to fix shared_ptr usage in std::tr1 namespace.
+
+2008-11-21: wsfulton
+ The use of the include path to find the input file is now deprecated.
+ This makes the behaviour of SWIG the same as C/C++ compilers in preparation
+ for use with ccache.
+
+2008-11-16: wsfulton
+ Fix -nopreprocess option to:
+ - correctly report file names in warning and error messages.
+ - use the original input filename that created the preprocessed output when
+ determining the C++ wrapper file name (in the absence of -o). Previously
+ the name of the input file containing the preprocessed output was used.
+
+2008-11-11: wsfulton
+ [Java] Add patch #2152691 from MATSUURA Takanori which fixes compiles using the
+ Intel compiler
+
+2008-11-01: wsfulton
+ Add patch #2128249 from Anatoly Techtonik which corrects the C/C++ proxy
+ class being reported for Python docstrings when %rename is used.
+
+2008-11-01: wsfulton
+ Add the strip encoder patch from Anatoly Techtonik #2130016. This enables an
+ easy way to rename symbols by stripping a commonly used prefix in all the
+ function/struct names. It works in the same way as the other encoders, such as
+ title, lower, command etc outlined in CHANGES file dated 12/30/2005. Example
+ below will rename wxAnotherWidget to AnotherWidget and wxDoSomething to
+ DoSomething:
+
+ %rename("%(strip:[wx])s") "";
+
+ struct wxAnotherWidget {
+ void wxDoSomething();
+ };
+
+2008-09-26: mutandiz
+ [allegrocl]
+ Lots of test-suite work.
+ - Fix ordering of wrapper output and %{ %} header output.
+ - Fix declarations of local vars in C wrappers.
+ - Fix declaration of defined constants in C wrappers.
+ - Fix declaration of EnumValues in C wrappers.
+ - add some const typemaps to allegrocl.swg
+ - add rename for operator bool() overloads.
+
+2008-09-25: olly
+ [PHP5] Fill in typemaps for SWIGTYPE and void * (SF#2095186).
+
+2008-09-22: mutandiz (Mikel Bancroft)
+ [allegrocl]
+ - Support wrapping of types whose definitions are not seen by
+ SWIG. They are treated as forward-referenced classes and if a
+ definition is not seen are treated as (* :void).
+ - Don't wrap the contents of unnamed namespaces.
+ - More code cleanup. Removed some extraneous warnings.
+ - start work on having the allegrocl mod pass the cpp test-suite.
+
+2008-09-19: olly
+ [PHP5] Add typemaps for long long and unsigned long long.
+
+2008-09-18: wsfulton
+ [C#] Added C# array typemaps provided by Antti Karanta.
+ The arrays provide a way to use MarshalAs(UnmanagedType.LPArray)
+ and pinning the array using 'fixed'. See arrays_csharp.i library file
+ for details.
+
+2008-09-18: wsfulton
+ Document the optional module attribute in the %import directive,
+ see Modules.html. Add a warning for Python wrappers when the
+ module name for an imported base class is missing, requiring the
+ module attribute to be added to %import, eg
+
+ %import(module="FooModule") foo.h
+
+2008-09-18: olly
+ [PHP5] Change the default input typemap for char * to turn PHP
+ Null into C NULL (previously it was converted to an empty string).
+ The new behaviour is consistent with how the corresponding output
+ typemap works (SF#2025719).
+
+ If you want to keep the old behaviour, add the following typemap
+ to your interface file (PHP's convert_to_string_ex() function does
+ the converting from PHP Null to an empty string):
+
+ %typemap(in) char * {
+ convert_to_string_ex($input);
+ $1 = Z_STRVAL_PP($input);
+ }
+
+2008-09-18: olly
+ [PHP5] Fix extra code added to proxy class constructors in the case
+ where the only constructor takes no arguments.
+
+2008-09-18: olly
+ [PHP5] Fix wrapping of a renamed enumerated value of an enum class
+ member (SF#2095273).
+
+2008-09-17: mutandiz (Mikel Bancroft)
+ [allegrocl]
+ - Fix how forward reference typedefs are handled, so as not to conflict
+ with other legit typedefs.
+ - Don't (for now) perform an ffitype typemap lookup when trying to
+ when calling compose_foreign_type(). This is actually a useful thing
+ to do in certain cases, the test cases for which I can't currently
+ locate :/. It's breaking some wrapping behavior that is more commonly
+ seen, however. I'll readd in a more appropriate way when I can
+ recreate the needed test case, or a user complains (which means
+ they probably have a test case).
+ - document the -isolate command-line arg in the 'swig -help' output.
+ It was in the html docs, but not there.
+ - small amount of code cleanup, removed some unused code.
+ - some minor aesthetic changes.
+
+2008-09-12: bhy
+ [Python] Python 3.0 support branch merged into SWIG trunk. Thanks to
+ Google Summer of Code 2008 for supporting this project! By default
+ SWIG will generate interface files compatible with both Python 2.x
+ and 3.0. And there's also some Python 3 new features that can be
+ enabled by passing a "-py3" command line option to SWIG. These
+ features are:
+
+ - Function annotation support
+ Also, the parameter list of proxy function will be generated,
+ even without the "-py3" option. However, the parameter list
+ will fallback to *args if the function (or method) is overloaded.
+ - Buffer interface support
+ - Abstract base class support
+
+ For details of Python 3 support and these features, please see the
+ "Python 3 Support" section in the "SWIG and Python" chapter of the SWIG
+ documentation.
+
+ The "-apply" command line option and support of generating codes
+ using apply() is removed. Since this is only required by very old
+ Python.
+
+ This merge also patched SWIG's parser to solve a bug. By this patch,
+ SWIG features able to be correctly applied on C++ conversion operator,
+ such like this:
+
+ %feature("shadow") *::operator bool %{ ... %}
+
+2008-09-02: richardb
+ [Python] Commit patch #2089149: Director exception handling mangles
+ returned exception. Exceptions raised by Python code in directors
+ are now passed through to the caller without change. Also, remove
+ the ": " prefix which used to be added to other director exceptions
+ (eg, those due to incorrect return types).
+
+2008-09-02: wsfulton
+ [Python] Commit patch #1988296 GCItem multiple module linking issue when using
+ directors.
+
+2008-09-02: wsfulton
+ [C#] Support for 'using' and 'fixed' blocks in the 'csin' typemap is now
+ possible through the use of the pre attribute and the new terminator attribute, eg
+
+ %typemap(csin,
+ pre=" using (CDate temp$csinput = new CDate($csinput)) {",
+ terminator=" } // terminate temp$csinput using block",
+ ) const CDate &
+ "$csclassname.getCPtr(temp$csinput)"
+
+ See CSharp.html for more info.
+
+2008-09-01: wsfulton
+ [CFFI] Commit patch #2079381 submitted by Boris Smilga - constant exprs put into
+ no-eval context in DEFCENUM
+
+2008-08-02: wuzzeb
+ [Chicken,Allegro] Commit Patch 2019314
+ Fixes a build error in chicken, and several build errors and other errors
+ in Allegro CL
+
+2008-07-19: wsfulton
+ Fix building of Tcl examples/test-suite on Mac OSX reported by Gideon Simpson.
+
+2008-07-17: wsfulton
+ Fix SF #2019156 Configuring with --without-octave or --without-alllang
+ did not disable octave.
+
+2008-07-14: wsfulton
+ [Java, C#] Fix director typemaps for pointers so that NULL pointers are correctly
+ marshalled to C#/Java null in director methods.
+
+2008-07-04: olly
+ [PHP] For std_vector.i and std_map.i, rename empty() to is_empty()
+ since "empty" is a PHP reserved word. Based on patch from Mark Klein
+ in SF#1943417.
+
+2008-07-04: olly
+ [PHP] The deprecated command line option "-make" has been removed.
+ Searches on Google codesearch suggest that nobody is using it now
+ anyway.
+
+2008-07-04: olly
+ [PHP] The SWIG cdata.i library module is now supported.
+
+2008-07-03: olly
+ [PHP] The deprecated command line option "-phpfull" has been
+ removed. We recommend building your extension as a dynamically
+ loadable module.
+
+2008-07-02: olly
+ [PHP4] Support for PHP4 has been removed. The PHP developers are
+ no longer making new PHP4 releases, and won't even be providing
+ patches for critical security issues after 2008-08-08.
+
+2008-07-02: olly
+ [Python] Import the C extension differently for Python 2.6 and
+ later so that an implicit relative import doesn't produce a
+ deprecation warning for 2.6 and a failure for 2.7 and later.
+ Patch from Richard Boulton in SF#2008229, plus follow-up patches
+ from Richard and Haoyu Bai.
+
Version 1.3.36 (24 June 2008)
=============================
@@ -477,7 +959,7 @@ Version 1.3.34 (27 February 2008)
};
Version 1.3.33 (November 23, 2007)
-=================================
+==================================
11/21/2007: mikel
[allegrocl] omit private slot type info in the classes/types
@@ -1409,7 +1891,7 @@ Version 1.3.31 (November 20, 2006)
[lua] update to typemap for object by value, to make it c89 compliant
Version 1.3.30 (November 13, 2006)
-=================================
+==================================
11/12/2006: wsfulton
[java] Remove DetachCurrentThread patch from 08/11/2006 - it causes segfaults
@@ -5732,7 +6214,7 @@ Version 1.3.24 (December 14, 2004)
compile with no errors, java shows some problems.
Version 1.3.23 (November 11, 2004)
-=================================
+==================================
11/05/2004: wsfulton
Patch #982753 from Fabrice Salvaire: Adds dependencies generation for
@@ -7983,7 +8465,8 @@ Version 1.3.22 (September 4, 2004)
exception instead.
Version 1.3.21 (January 11, 2004)
-==================================
+=================================
+
01/10/2004: cheetah (William Fulton)
The output format for both warnings and errors can be selected for
integration with your favourite IDE/editor. Editors and IDEs can usually
@@ -9757,6 +10240,7 @@ Version 1.3.20 (December 17, 2003)
Version 1.3.19 (March 28, 2003)
===============================
+
03/28/2003: beazley
Variety of minor bug fixes to the 1.3.18 release including:
@@ -10343,6 +10827,7 @@ Version 1.3.18 (March 23, 2003)
Version 1.3.17 (November 22, 2002)
==================================
+
11/19/2002: beazley
Fixed [ 613922 ] preprocessor errors with HAVE_LONG_LONG.
@@ -10698,6 +11183,7 @@ Version 1.3.16 (October 14, 2002)
Version 1.3.15 (September 9, 2002)
==================================
+
09/09/2002: beazley
Fixed nasty runtime type checking bug with subtypes and inheritance
and templates.
@@ -12390,6 +12876,7 @@ Version 1.3.14 (August 12, 2002)
Version 1.3.13 (June 17, 2002)
==============================
+
06/16/2002: beazley
Fixed a bug with __FILE__ expansion in the preprocessor. On Windows,
the backslash (\) is now converted to (\\) in the string literal
@@ -15521,6 +16008,7 @@ Version 1.3.10 (December 10, 2001)
Version 1.3.9 (September 25, 2001)
==================================
+
9/25/2001: beazley
Fixed parsing problem with type declarations like
'char ** const'. SWIG parsed this correctly, but the
@@ -15533,6 +16021,7 @@ Version 1.3.9 (September 25, 2001)
Version 1.3.8 (September 23, 2001)
==================================
+
9/23/2001: beazley
Included improved distutils setup.py file in the Tools
directory (look for the setup.py.tmpl file). Contributed by
@@ -16905,7 +17394,7 @@ Version 1.3 Alpha 5
and function bodies. Preprocessor bug.
Version 1.3 Alpha 4 (September 4, 2000)
-======================================
+=======================================
9/3/00 : ttn
Added instructions for maintainers in Examples/README on how
@@ -17991,6 +18480,7 @@ Version 1.3 Alpha 1 (February 11, 2000)
Version 1.1 Patch 5 (February 5, 1998)
======================================
+
2/4/98 : Fixed a bug in the configure script when different package
locations are specified (--with-tclincl, etc...).
@@ -18243,6 +18733,7 @@ Version 1.1 Patch 3 (November 24, 1997)
Version 1.1 Patch 2 (September 4, 1997)
=======================================
+
9/4/97 : Fixed problem with handling of virtual functions that
was introduced by some changes in the C++ module.
@@ -19378,7 +19869,7 @@ This release should fix most, if not all, of those problems.
it generated alot of unnecessary code).
Version 1.1 Beta3 (January 9, 1997)
-====================================
+===================================
Note : A *huge* number of changes related to ongoing modifications.
@@ -19501,6 +19992,7 @@ Version 1.1 Beta1 (October 30, 1996)
Version 1.0 Final (August 31, 1996)
===================================
+
1. Fixed minor bug in C++ module
2. Fixed minor bug in pointer type-checker when using
@@ -19584,7 +20076,7 @@ number of immediate problems :
3. A few minor fixes were made in the Makefile
Version 1.0 Beta 3 (June 14, 1996)
-===================================
+==================================
There are lots of changes in this release :
@@ -19674,6 +20166,7 @@ let me know.
Version 1.0 Beta 2 (April 26, 1996)
===================================
+
This release is identical to Beta1 except a few minor bugs are
fixed and the SWIG library has been updated to work with Tcl 7.5/Tk 4.1.
A tcl7.5 examples directory is now included.
@@ -19688,6 +20181,7 @@ A tcl7.5 examples directory is now included.
Version 1.0 Beta 1 (April 10, 1996).
=====================================
+
This is the first "semi-official" release of SWIG. It has a
number of substantial improvements over the Alpha release. These
notes are in no particular order--hope I remembered everything....
diff --git a/CHANGES.current b/CHANGES.current
index 7d1b70ca7..822d2feed 100644
--- a/CHANGES.current
+++ b/CHANGES.current
@@ -1,52 +1,72 @@
-Version 1.3.37 (in progress)
-=============================
-
-2008-08-09: talby
- [Perl5] Unify Perl and C portions of constructor wrappers.
-
-2008-08-02: wuzzeb
- [Chicken,Allegro] Commit Patch 2019314
- Fixes a build error in chicken, and several build errors and other errors
- in Allegro CL
-
-2008-07-19: wsfulton
- Fix building of Tcl examples/test-suite on Mac OSX reported by Gideon Simpson.
-
-2008-07-17: wsfulton
- Fix SF #2019156 Configuring with --without-octave or --without-alllang
- did not disable octave.
-
-2008-07-14: wsfultonn
- [Java, C#] Fix director typemaps for pointers so that NULL pointers are correctly
- marshalled to C#/Java null in director methods.
-
-2008-07-04: olly
- [PHP] For std_vector.i and std_map.i, rename empty() to is_empty()
- since "empty" is a PHP reserved word. Based on patch from Mark Klein
- in SF#1943417.
-
-2008-07-04: olly
- [PHP] The deprecated command line option "-make" has been removed.
- Searches on Google codesearch suggest that nobody is using it now
- anyway.
-
-2008-07-04: olly
- [PHP] The SWIG cdata.i library module is now supported.
-
-2008-07-03: olly
- [PHP] The deprecated command line option "-phpfull" has been
- removed. We recommend building your extension as a dynamically
- loadable module.
-
-2008-07-02: olly
- [PHP4] Support for PHP4 has been removed. The PHP developers are
- no longer making new PHP4 releases, and won't even be providing
- patches for critical security issues after 2008-08-08.
-
-2008-07-02: olly
- [Python] Import the C extension differently for Python 2.6 and
- later so that an implicit relative import doesn't produce a
- deprecation warning for 2.6 and a failure for 2.7 and later.
- Patch from Richard Boulton in SF#2008229, plus follow-up patches
- from Richard and Haoyu Bai.
+Version 1.3.40 (in progress)
+============================
+2009-06-16: wsfulton
+ [Java,C#] Fix enum marshalling when %ignore is used on one of the enum items.
+ Incorrect enum values were being passed to the C++ layer or compilation errors resulted.
+
+2009-06-02: talby
+ [Perl] Resolved reference.i overload support problem
+ identfied by John Potowsky.
+
+2009-05-26: wsfulton
+ [C#] Improved std::map wrappers based on patch from Yuval Baror. The C# proxy
+ now implements System.Collections.Generic.IDictionary<>.
+
+ These std:map wrappers have a non-backwards compatible overhaul to make them
+ like a .NET IDictionary. Some method names have changed as following:
+ set -> setitem (use this[] property now)
+ get -> getitem (use this[] property now)
+ has_key -> ContainsKey
+ del -> Remove
+ clear -> Clear
+
+ The following macros used for std::map wrappers are deprecated and will no longer work:
+ specialize_std_map_on_key
+ specialize_std_map_on_value
+ specialize_std_map_on_both
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2009-05-14: bhy
+ [Python] Fix the wrong pointer value returned by SwigPyObject_repr().
+
+2009-05-13: mutandiz (Mikel Bancroft)
+ [allegrocl] Minor tweak when wrapping in -nocwrap mode.
+
+2009-05-11: wsfulton
+ [C#] Improved std::vector wrappers on the C# proxy side from Yuval Baror. These
+ implement IList<> instead of IEnumerable<> where possible.
+
+2009-04-29: wsfulton
+ [Java, C#] Add the 'notderived' attribute to the javabase and csbase typemaps.
+ When this attribute is set, the typemap will not apply to classes that are derived
+ from a C++ base class, eg
+ %typemap(csbase, notderived="1") SWIGTYPE "CommonBase"
+
+2009-04-29: olly
+ [Python] Don't attempt to acquire the GIL in situations where we
+ know that it will already be locked. This avoids some dead-locks
+ with mod_python (due to mod_python bugs which are apparently
+ unlikely to ever be fixed), and results in smaller wrappers which
+ run a little faster (in tests with Xapian on x86-64 Ubuntu 9.04,
+ the stripped wrapper library was 11% smaller and ran 2.7% faster).
+
+2009-04-21: wsfulton
+ [C#] Fix #2753469 - bool &OUTPUT and bool *OUTPUT typemaps initialisation.
+
+2009-04-09: wsfulton
+ Fix #2746858 - C macro expression using floating point numbers
+
+2009-03-30: olly
+ [PHP] The default out typemap for char[ANY] now returns the string up to a
+ zero byte, or the end of the array if there is no zero byte. This
+ is the same as Python does, and seems more generally useful than
+ the previous behaviour of returning the whole contents of the array
+ including any zero bytes. If you want the old behaviour, you can provide
+ your own typemap to do this:
+
+ %typemap(out) char [ANY]
+ %{
+ RETVAL_STRINGL($1, $1_dim0, 1);
+ %}
diff --git a/Doc/Manual/Allegrocl.html b/Doc/Manual/Allegrocl.html
old mode 100755
new mode 100644
index 8981f52b5..cc950db7c
--- a/Doc/Manual/Allegrocl.html
+++ b/Doc/Manual/Allegrocl.html
@@ -8,7 +8,7 @@
-
16 SWIG and Allegro Common Lisp
+
17 SWIG and Allegro Common Lisp
@@ -135,10 +135,10 @@ be unhappy to see some enterprising folk use this work to add
to it.
-
16.1 Basics
+
17.1 Basics
-
16.1.1 Running Swig
+
17.1.1 Running Swig
@@ -360,7 +360,7 @@ need to link in the Allegro shared library. The library you create from
the C++ wrapper will be what you then load into Allegro CL.
@@ -2128,7 +2128,7 @@ indicating the number of arguments passed to the routine indicated by
this identifier.
-
16.5.4 Instructing SWIG to use a particular identifier-converter
+
17.5.4 Instructing SWIG to use a particular identifier-converter
diff --git a/Doc/Manual/Arguments.html b/Doc/Manual/Arguments.html
index af8780452..911e8548e 100644
--- a/Doc/Manual/Arguments.html
+++ b/Doc/Manual/Arguments.html
@@ -351,7 +351,7 @@ function like this in an interface file :
+Note that by default, the generated C# classes have no namespace and the module name is unrelated to namespaces. The module name is just like in Java and is merely used to name some of the generated classes.
@@ -125,7 +132,7 @@ If it was used, it would generate an illegal runtime initialisation via a PInvok
C# doesn't support the notion of throws clauses.
Therefore there is no 'throws' typemap attribute support for adding exception classes to a throws clause.
Likewise there is no need for an equivalent to %javaexception.
-In fact, throwing C# exceptions works quite differently, see C# Exceptions> below.
+In fact, throwing C# exceptions works quite differently, see C# Exceptions below.
@@ -201,7 +208,12 @@ $jnicall -> $imcall
-Unlike the "javain" typemap, the "csin" typemap does not support the 'pgcpp' attribute as the C# module does not have a premature garbage collection prevention parameter. The "csin" typemap supports an additional optional attribute called 'cshin'. It should contain the parameter type and name whenever a constructor helper function is generated due to the 'pre' or 'post' attributes. Note that 'pre', 'post' and 'cshin' attributes are not used for marshalling the property set. Please see the Date marshalling example and Date marshalling of properties example for further understanding.
+Unlike the "javain" typemap, the "csin" typemap does not support the 'pgcpp' attribute as the C# module does not have a premature garbage collection prevention parameter.
+The "csin" typemap supports additional optional attributes called 'cshin' and 'terminator'.
+The 'cshin' attribute should contain the parameter type and name whenever a constructor helper function is generated due to the 'pre' or 'post' attributes.
+The 'terminator' attribute normally just contains a closing brace for when the 'pre' attribute contains an opening brace, such as when a C# using or fixed block is started.
+Note that 'pre', 'post', 'terminator' and 'cshin' attributes are not used for marshalling the property set.
+Please see the Date marshalling example and Date marshalling of properties example for further understanding of these "csin" applicable attributes.
@@ -397,7 +409,275 @@ Windows users can also get the examples working using a
Cygwin or MinGW environment for automatic configuration of the example makefiles.
Any one of the three C# compilers (Portable.NET, Mono or Microsoft) can be detected from within a Cygwin or Mingw environment if installed in your path.
-
18.3 C# Exceptions
+
18.3 C# Arrays
+
+
+
+There are various ways to pass arrays from C# to C/C++.
+The default wrapping treats arrays as pointers and as such simple type wrapper classes are generated,
+eg SWIGTYPE_p_int when wrapping the C type int [] or int *.
+This gives a rather restricted use of the underlying unmanaged code and the most practical way to use arrays is to enhance or customise
+with one of the following three approaches; namely the SWIG C arrays library, P/Invoke default array marshalling or
+pinned arrays.
+
+
+
18.3.1 The SWIG C arrays library
+
+
+
+The C arrays library keeps all the array memory in the unmanaged layer.
+The library is available to all language modules and is documented in the carrays.i library section.
+Please refer to this section for details, but for convenience, the C# usage for the two examples outlined there is shown below.
+
+
+
+For the %array_functions example, the equivalent usage would be:
+
+
+
+
+SWIGTYPE_p_double a = example.new_doubleArray(10); // Create an array
+for (int i=0; i<10; i++)
+ example.doubleArray_setitem(a,i,2*i); // Set a value
+example.print_array(a); // Pass to C
+example.delete_doubleArray(a); // Destroy array
+
+
+
+
+and for the %array_class example, the equivalent usage would be:
+
+
+
+
+doubleArray c = new doubleArray(10); // Create double[10]
+for (int i=0; i<10; i++)
+ c.setitem(i, 2*i); // Assign values
+example.print_array(c.cast()); // Pass to C
+
+
+
+
+
18.3.2 Managed arrays using P/Invoke default array marshalling
+
+
+
+In the P/Invoke default marshalling scheme, one needs to designate whether the invoked function will treat a managed
+array parameter as input, output, or both. When the function is invoked, the CLR allocates a separate chunk of memory as big as the given managed array,
+which is automatically released at the end of the function call. If the array parameter is marked as being input, the content of the managed array is copied
+into this buffer when the call is made. Correspondingly, if the array parameter is marked as being output, the contents of the reserved buffer are copied
+back into the managed array after the call returns. A pointer to to this buffer
+is passed to the native function.
+
+
+
+The reason for allocating a separate buffer is to leave the CLR free to relocate the managed array object
+during garbage collection. If the overhead caused by the copying is causing a significant performance penalty, consider pinning the managed array and
+passing a direct reference as described in the next section.
+
+The P/Invoke default marshalling is supported by the arrays_csharp.i library via the INPUT, OUTPUT and INOUT typemaps.
+Let's look at some example usage. Consider the following C function:
+
+
+
+void myArrayCopy(int *sourceArray, int *targetArray, int nitems);
+
+
+
+
+We can now instruct SWIG to use the default marshalling typemaps by
+
+
+
+
+%include "arrays_csharp.i"
+
+%apply int INPUT[] {int *sourceArray}
+%apply int OUTPUT[] {int *targetArray}
+
+
+
+
+As a result, we get the following method in the module class:
+
+If we look beneath the surface at the corresponding intermediary class code, we see
+that SWIG has generated code that uses attributes
+(from the System.Runtime.InteropServices namespace) to tell the CLR to use default
+marshalling for the arrays:
+
+As an example of passing an inout array (i.e. the target function will both read from and
+write to the array), consider this C function that swaps a given number of elements
+in the given arrays:
+
+
+
+
+void myArraySwap(int *array1, int *array2, int nitems);
+
+
+
+
+Now, we can instruct SWIG to wrap this by
+
+
+
+
+%include "arrays_csharp.i"
+
+%apply int INOUT[] {int *array1}
+%apply int INOUT[] {int *array2}
+
+
+
+
+This results in the module class method
+
+
+
+
+ public static void myArraySwap(int[] array1, int[] array2, int nitems) {
+ examplePINVOKE.myArraySwap(array1, array2, nitems);
+ }
+
+
+
+
+and intermediate class method
+
+
+
+
+ [DllImport("example", EntryPoint="CSharp_myArraySwap")]
+ public static extern void myArraySwap([In, Out, MarshalAs(UnmanagedType.LPArray)]int[] jarg1,
+ [In, Out, MarshalAs(UnmanagedType.LPArray)]int[] jarg2, int jarg3);
+
+
+
+
+
18.3.3 Managed arrays using pinning
+
+
+
+It is also possible to pin a given array in memory (i.e. fix its location in memory), obtain a
+direct pointer to it, and then pass this pointer to the wrapped C/C++ function. This approach
+involves no copying, but it makes the work of the garbage collector harder as
+the managed array object can not be relocated before the fix on the array is released. You should avoid
+fixing arrays in memory in cases where the control may re-enter the managed side via a callback and/or
+another thread may produce enough garbage to trigger garbage collection.
+
+
+
+For more information, see the fixed statement in the C# language reference.
+
+
+
+
+Now let's look at an example using pinning, thus avoiding the CLR making copies
+of the arrays passed as parameters. The arrays_csharp.i library file again provides the required support via the FIXED typemaps.
+Let's use the same function from the previous section:
+
+
+
+
+void myArrayCopy(int *sourceArray, int *targetArray, int nitems);
+
+
+
+
+We now need to declare the module class method unsafe, as we are using pointers:
+
+On the method signature level the only difference to the version using P/Invoke default
+marshalling is the "unsafe" quantifier, which is required because we are handling pointers.
+
+
+
+Also the intermediate class method looks a little different from the default marshalling
+example - the method is expecting an IntPtr as the parameter type.
+
@@ -494,7 +774,7 @@ set so should only be used when a C# exception is not created.
-
18.3.1 C# exception example using "check" typemap
+
18.4.1 C# exception example using "check" typemap
@@ -676,7 +956,7 @@ method and C# code does not handle pending exceptions via the canthrow attribute
Actually it will issue this warning for any function beginning with SWIG_CSharpSetPendingException.
-
18.3.2 C# exception example using %exception
+
18.4.2 C# exception example using %exception
@@ -741,7 +1021,7 @@ The managed code generated does check for the pending exception as mentioned ear
-
18.3.3 C# exception example using exception specifications
+
18.4.3 C# exception example using exception specifications
@@ -798,7 +1078,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_evensonly(int jarg1) {
Multiple catch handlers are generated should there be more than one exception specifications declared.
-
18.3.4 Custom C# ApplicationException example
+
18.4.4 Custom C# ApplicationException example
@@ -932,7 +1212,7 @@ try {
-
18.4 C# Directors
+
18.5 C# Directors
@@ -945,7 +1225,7 @@ The following sections provide information on the C# director implementation and
However, the Java directors section should also be read in order to gain more insight into directors.
@@ -1300,7 +1580,7 @@ However, a call from C# to CSharpDefaults.DefaultMethod() will of cours
should pass the call on to CSharpDefaults.DefaultMethod(int)using the C++ default value, as shown above.
-
18.5 C# Typemap examples
+
18.6 C# Typemap examples
This section includes a few examples of typemaps. For more examples, you
@@ -1308,7 +1588,7 @@ might look at the files "csharp.swg" and "typemaps.i" in
the SWIG library.
-
18.5.1 Memory management when returning references to member variables
+
18.6.1 Memory management when returning references to member variables
@@ -1432,7 +1712,7 @@ public class Bike : IDisposable {
Note the addReference call.
-
18.5.2 Memory management for objects passed to the C++ layer
+
18.6.2 Memory management for objects passed to the C++ layer
@@ -1551,7 +1831,7 @@ The 'cscode' typemap simply adds in the specified code into the C# proxy class.
-
18.5.3 Date marshalling using the csin typemap and associated attributes
+
18.6.3 Date marshalling using the csin typemap and associated attributes
@@ -1567,6 +1847,7 @@ Let's assume the code being wrapped is as follows:
class CDate {
public:
+ CDate();
CDate(int year, int month, int day);
int getYear();
int getMonth();
@@ -1649,8 +1930,8 @@ The typemaps to achieve this are shown below.
%typemap(cstype) const CDate& "System.DateTime"
%typemap(csin,
- pre=" CDate temp$csinput = new CDate($csinput.Year, $csinput.Month, $csinput.Day);")
- const CDate &
+ pre=" CDate temp$csinput = new CDate($csinput.Year, $csinput.Month, $csinput.Day);"
+ ) const CDate &
"$csclassname.getCPtr(temp$csinput)"
%typemap(cstype) CDate& "out System.DateTime"
@@ -1658,7 +1939,8 @@ The typemaps to achieve this are shown below.
pre=" CDate temp$csinput = new CDate();",
post=" $csinput = new System.DateTime(temp$csinput.getYear(),"
" temp$csinput.getMonth(), temp$csinput.getDay(), 0, 0, 0);",
- cshin="out $csinput") CDate &
+ cshin="out $csinput"
+ ) CDate &
"$csclassname.getCPtr(temp$csinput)"
@@ -1763,7 +2045,8 @@ will be possible with the following CDate * typemaps
pre=" CDate temp$csinput = new CDate($csinput.Year, $csinput.Month, $csinput.Day);",
post=" $csinput = new System.DateTime(temp$csinput.getYear(),"
" temp$csinput.getMonth(), temp$csinput.getDay(), 0, 0, 0);",
- cshin="ref $csinput") CDate *
+ cshin="ref $csinput"
+ ) CDate *
"$csclassname.getCPtr(temp$csinput)"
@@ -1788,7 +2071,51 @@ public class example {
-
18.5.4 A date example demonstrating marshalling of C# properties
+
+The following typemap is the same as the previous but demonstrates how a using block can be used for the temporary variable.
+The only change to the previous typemap is the introduction of the 'terminator' attribute to terminate the using block.
+The subtractYears method is nearly identical to the above addYears method.
+
+
+
+
+%typemap(csin,
+ pre=" using (CDate temp$csinput = new CDate($csinput.Year, $csinput.Month, $csinput.Day)) {",
+ post=" $csinput = new System.DateTime(temp$csinput.getYear(),"
+ " temp$csinput.getMonth(), temp$csinput.getDay(), 0, 0, 0);",
+ terminator=" } // terminate temp$csinput using block",
+ cshin="ref $csinput"
+ ) CDate *
+ "$csclassname.getCPtr(temp$csinput)"
+
+void subtractYears(CDate *pDate, int years) {
+ *pDate = CDate(pDate->getYear() - years, pDate->getMonth(), pDate->getDay());
+}
+
+
+
+
+The resulting generated code shows the termination of the using block:
+
+
+
+
+public class example {
+ public static void subtractYears(ref System.DateTime pDate, int years) {
+ using (CDate temppDate = new CDate(pDate.Year, pDate.Month, pDate.Day)) {
+ try {
+ examplePINVOKE.subtractYears(CDate.getCPtr(temppDate), years);
+ } finally {
+ pDate = new System.DateTime(temppDate.getYear(), temppDate.getMonth(), temppDate.getDay(), 0, 0, 0);
+ }
+ } // terminate temppDate using block
+ }
+ ...
+}
+
+
+
+
18.6.4 A date example demonstrating marshalling of C# properties
@@ -1827,7 +2154,8 @@ The typemap type required is thus CDate *. Given that the previous sect
pre=" CDate temp$csinput = new CDate($csinput.Year, $csinput.Month, $csinput.Day);",
post=" $csinput = new System.DateTime(temp$csinput.getYear(),"
" temp$csinput.getMonth(), temp$csinput.getDay(), 0, 0, 0);",
- cshin="ref $csinput") CDate *
+ cshin="ref $csinput"
+ ) CDate *
"$csclassname.getCPtr(temp$csinput)"
%typemap(csvarin, excode=SWIGEXCODE2) CDate * %{
@@ -1888,7 +2216,7 @@ Some points to note:
-
18.5.5 Turning wrapped classes into partial classes
+
18.6.5 Turning wrapped classes into partial classes
@@ -1988,7 +2316,7 @@ demonstrating that the class contains methods calling both unmanaged code -
The following example is an alternative approach to adding managed code to the generated proxy class.
-
18.5.6 Extending proxy classes with additional C# code
+
18.6.6 Extending proxy classes with additional C# code
diff --git a/Doc/Manual/Customization.html b/Doc/Manual/Customization.html
index e9d70e39a..ec73e5460 100644
--- a/Doc/Manual/Customization.html
+++ b/Doc/Manual/Customization.html
@@ -1019,6 +1019,20 @@ but this will:
+
+SWIG provides macros for disabling and clearing features. Many of these can be found in the swig.swg library file.
+The typical pattern is to define three macros; one to define the feature itself, one to disable the feature and one to clear the feature.
+The three macros below show this for the "except" feature:
+
At the end of the new section is the place to put the aforementioned
-nickname kludges (should they be needed). See Perl5 and Php4 for
+nickname kludges (should they be needed). See Perl5 for
examples of what to do. [If this is still unclear after you've read
the code, ping me and I'll expand on this further. --ttn]
The above example will generate native build files such as makefiles, nmake files and Visual Studio projects
-which will invoke SWIG and compile the generated C++ files into _example.so (UNIX) or _example.dll (Windows).
+which will invoke SWIG and compile the generated C++ files into _example.so (UNIX) or _example.pyd (Windows).
+For other target languages on Windows a dll, instead of a .pyd file, is usually generated.
2.7 Hands off code generation
diff --git a/Doc/Manual/Java.html b/Doc/Manual/Java.html
index 21085c803..2cde5ddab 100644
--- a/Doc/Manual/Java.html
+++ b/Doc/Manual/Java.html
@@ -253,6 +253,12 @@ To change this, you can use the -o option.
It is also possible to change the output directory that the Java files are generated into using -outdir.
+
+The module name, specified with %module, determines the name of various generated classes as discussed later.
+Note that the module name does not define a Java package and by default, the generated Java classes do not have a Java package.
+The -package option described below can specify a Java package name to use.
+
+
The following sections have further practical examples and details on how you might go about
compiling and using the generated files.
@@ -353,9 +359,9 @@ The name of the module is specified using the %module directive or
To load your shared native library module in Java, simply use Java's System.loadLibrary method in a Java class:
-// main.java
+// runme.java
-public class main {
+public class runme {
static {
System.loadLibrary("example");
}
@@ -372,7 +378,7 @@ Compile all the Java files and run:
$ javac *.java
-$ java main
+$ java runme
24
$
@@ -394,12 +400,12 @@ You may get an exception similar to this:
-$ java main
+$ java runme
Exception in thread "main" java.lang.UnsatisfiedLinkError: no example in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1312)
at java.lang.Runtime.loadLibrary0(Runtime.java:749)
at java.lang.System.loadLibrary(System.java:820)
- at main.<clinit>(main.java:5)
+ at runme.<clinit>(runme.java:5)
@@ -426,7 +432,7 @@ The following exception is indicative of this:
-$ java main
+$ java runme
Exception in thread "main" java.lang.UnsatisfiedLinkError: libexample.so: undefined
symbol: fact
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
@@ -434,7 +440,7 @@ symbol: fact
at java.lang.ClassLoader.loadLibrary(ClassLoader.java, Compiled Code)
at java.lang.Runtime.loadLibrary0(Runtime.java, Compiled Code)
at java.lang.System.loadLibrary(System.java, Compiled Code)
- at main.<clinit>(main.java:5)
+ at runme.<clinit>(runme.java:5)
$
@@ -2858,7 +2864,7 @@ and therefore there is no possibility of premature garbage collection. In practi
The premature garbage collection prevention parameter for proxy classes is generated by default whenever proxy classes are passed by value, reference or with a pointer.
The implementation for this extra parameter generation requires the "jtype" typemap to contain long and the "jstype" typemap to contain the name of a proxy class.
-
+
The additional parameter does impose a slight performance overhead and the parameter generation can be suppressed globally with the -nopgcpp commandline option.
@@ -3760,7 +3766,7 @@ will produce a familiar looking Java exception:
Exception in thread "main" java.lang.OutOfMemoryError: Not enough memory
at exampleJNI.malloc(Native Method)
at example.malloc(example.java:16)
- at main.main(main.java:112)
+ at runme.main(runme.java:112)
@@ -3820,7 +3826,9 @@ public:
In the example above, java.lang.Exception is a checked exception class and so ought to be declared in the throws clause of getitem.
Classes can be specified for adding to the throws clause using %javaexception(classes) instead of %exception,
where classes is a string containing one or more comma separated Java classes.
-The %nojavaexception feature is the equivalent to %noexception and clears previously declared exception handlers.
+The %clearjavaexception feature is the equivalent to %clearexception and clears previously declared exception handlers.
+The %nojavaexception feature is the equivalent to %noexception and disables the exception handler.
+See Clearing features for the difference on disabling and clearing features.
@@ -5300,6 +5308,9 @@ base (extends) for Java class: empty default
Note that this typemap accepts a replace attribute as an optional flag. When set to "1", it will replace/override any C++ base classes
that might have been parsed. If this flag is not specified and there are C++ base classes, then a multiple inheritance warning
is issued and the code in the typemap is ignored.
+The typemap also accepts a notderived attribute as an optional flag. When set to "1", it will not apply to classes that
+are derived from a C++ base.
+When used with the SWIGTYPE type, it is useful for giving a common base for all proxy classes, that is, providing a base class that sits in between all proxy classes and the Java base class Object for example: %typemap(javabase, notderived="1") SWIGTYPE "CommonBase".
%typemap(javabody)
@@ -6168,9 +6179,9 @@ When this module is compiled, our wrapped C functions can be used by the followi
-// File main.java
+// File runme.java
-public class main {
+public class runme {
static {
try {
@@ -6196,7 +6207,7 @@ When compiled and run we get:
-$ java main
+$ java runme
argv[0] = Cat
argv[1] = Dog
argv[2] = Cow
@@ -6387,9 +6398,9 @@ The following Java program demonstrates this:
-// File: main.java
+// File: runme.java
-public class main {
+public class runme {
static {
try {
@@ -6414,7 +6425,7 @@ When compiled and run we get:
-$ java main
+$ java runme
1 12.0 340.0
@@ -6474,7 +6485,7 @@ We get:
Ambulance started
java.lang.ClassCastException
- at main.main(main.java:16)
+ at runme.main(runme.java:16)
@@ -316,7 +316,7 @@ In this example, the function int_to_uint() would be used to cast type
Note: When working with simple pointers, typemaps can often be used to provide more seamless operation.
-
-SWIG is able to throw numeric types, enums, chars, char*'s and std::string's without problem.
-However its not so simple for to throw objects.
+SWIG is able to throw numeric types, enums, chars, char*'s and std::string's without problem. It has also written typemaps for std::exception and its derived classes, which convert the exception into and error string.
+
+However its not so simple for to throw other types of objects.
Thrown objects are not valid outside the 'catch' block. Therefore they cannot be
returned to the interpreter.
The obvious ways to overcome this would be to either return a copy of the object, or so convert the object to a string and
@@ -1038,10 +1054,6 @@ To get a more useful behaviour out of SWIG you must either: provide a way to con
throw objects which can be copied.
-SWIG has typemaps for std::exception and its children already written, so a function which throws any of these will
-automatically have its exception converted into an error string.
-
-
If you have your own class which you want output as a string you will need to add a typemap something like this:
@@ -1098,7 +1110,271 @@ add exception specification to functions or globally (respectively).
-
23.3.16 Writing your own custom wrappers
+
23.4 Typemaps
+
+
+
This section explains what typemaps are and the usage of them. The default wrappering behaviour of SWIG is enough in most cases. However sometimes SWIG may need a little additional assistance to know which typemap to apply to provide the best wrappering. This section will be explaining how to use typemaps to best effect
+
+
23.4.1 What is a typemap?
+
+
+
A typemap is nothing more than a code generation rule that is attached to a specific C datatype. For example, to convert integers from Lua to C, you might define a typemap like this:
+
+
%module example
+
+%typemap(in) int {
+ $1 = (int) lua_tonumber(L,$input);
+ printf("Received an integer : %d\n",$1);
+}
+%inline %{
+extern int fact(int n);
+%}
+
+
+
Note: you shouldn't use this typemap, as SWIG already has a typemap for this task. This is purely for example.
+
+
Typemaps are always associated with some specific aspect of code generation. In this case, the "in" method refers to the conversion of input arguments to C/C++. The datatype int is the datatype to which the typemap will be applied. The supplied C code is used to convert values. In this code a number of special variable prefaced by a $ are used. The $1 variable is placeholder for a local variable of type int. The $input is the index on the Lua stack for the value to be used.
+
+
When this example is compiled into a Lua module, it operates as follows:
There are many ready written typemaps built into SWIG for all common types (int, float, short, long, char*, enum and more), which SWIG uses automatically, with no effort required on your part.
+
+
However for more complex functions which use input/output parameters or arrays, you will need to make use of <typemaps.i>, which contains typemaps for these situations. For example, consider these functions:
+
+
void add(int x, int y, int *result) {
+ *result = x + y;
+}
+
+int sub(int *x1, int *y1) {
+ return *x1-*y1;
+}
+
+void swap(int *sx, int *sy) {
+ int t=*sx;
+ *sx=*sy;
+ *sy=t;
+}
+
+
+
It is clear to the programmer, that 'result' is an output parameter, 'x1' and 'y1' are input parameters and 'sx' and 'sy' are input/output parameters. However is not apparent to SWIG, so SWIG must to informed about which kind they are, so it can wrapper accordingly.
+
+
One means would be to rename the argument name to help SWIG, eg void add(int x, int y, int *OUTPUT), however it is easier to use the %apply to achieve the same result, as shown below.
+
+
%include <typemaps.i>
+%apply int* OUTPUT {int *result}; // int *result is output
+%apply int* INPUT {int *x1, int *y1}; // int *x1 and int *y1 are input
+%apply int* INOUT {int *sx, int *sy}; // int *sx and int *sy are input and output
+
+void add(int x, int y, int *result);
+int sub(int *x1, int *y1);
+void swap(int *sx, int *sy);
+
Notice, that 'result' is not required in the arguments to call the function, as it an output parameter only. For 'sx' and 'sy' they must be passed in (as they are input), but the original value is not modified (Lua does not have a pass by reference feature). The modified results are then returned as two return values. All INPUT/OUTPUT/INOUT arguments will behave in a similar manner.
+
+
Note: C++ references must be handled exactly the same way. However SWIG will automatically wrap a const int& as an input parameter (since that it obviously input).
+
+
23.4.3 Typemaps and arrays
+
+
+
Arrays present a challenge for SWIG, because like pointers SWIG does not know whether these are input or output values, nor
+does SWIG have any indication of how large an array should be. However with the proper guidance SWIG can easily wrapper
+arrays for convenient usage.
+
+
Given the functions:
+
extern void sort_int(int* arr, int len);
+extern void sort_double(double* arr, int len);
+
+
+
There are basically two ways that SWIG can deal with this. The first way, uses the <carrays.i> library
+to create an array in C/C++ then this can be filled within Lua and passed into the function. It works, but its a bit tedious.
+More details can be found in the carrays.i documention.
+
+
The second and more intuitive way, would be to pass a Lua table directly into the function, and have SWIG automatically convert between Lua-table and C-array. Within the <typemaps.i> file there are typemaps ready written to perform this task. To use them is again a matter of using %appy in the correct manner.
+
+
The wrapper file below, shows both the use of carrays as well as the use of the typemap to wrap arrays.
+
+
// using the C-array
+%include <carrays.i>
+// this declares a batch of function for manipulating C integer arrays
+%array_functions(int,int)
+
+extern void sort_int(int* arr, int len); // the function to wrap
+
+// using typemaps
+%include <typemaps.i>
+%apply (double *INOUT,int) {(double* arr,int len)};
+
+extern void sort_double(double* arr, int len); // the function to wrap
+
+
+
Once wrappered, the functions can both be called, though with different ease of use:
+
+
require "example"
+ARRAY_SIZE=10
+
+-- passing a C array to the sort_int()
+arr=example.new_int(ARRAY_SIZE) -- create the array
+for i=0,ARRAY_SIZE-1 do -- index 0..9 (just like C)
+ example.int_setitem(arr,i,math.random(1000))
+end
+example.sort_int(arr,ARRAY_SIZE) -- call the function
+example.delete_int(arr) -- must delete the allocated memory
+
+-- use a typemap to call with a Lua-table
+-- one item of note: the typemap creates a copy, rather than edit-in-place
+t={} -- a Lua table
+for i=1,ARRAY_SIZE do -- index 1..10 (Lua style)
+ t[i]=math.random(1000)/10
+end
+t=example.sort_double(t) -- replace t with the result
+
+
+
Obviously the first version could be made less tedious by writing a Lua function to perform the conversion from a table
+to a C-array. The %luacode directive is good for this. See SWIG\Examples\lua\arrays for an example of this.
+
+
Warning: in C indexes start at ZERO, in Lua indexes start at ONE. SWIG expects C-arrays to be filled for 0..N-1
+and Lua tables to be 1..N, (the indexing follows the norm for the language). In the typemap when it converts the table to an array it quietly changes the indexing accordingly. Take note of this behaviour if you have a C function which returns indexes.
+
+
Note: SWIG also can support arrays of pointers in a similar manner.
+
+
23.4.4 Typemaps and pointer-pointer functions
+
+
+
Several C++ libraries use a pointer-pointer functions to create its objects. These functions require a pointer to a pointer which is then filled with the pointer to the new object. Microsoft's COM and DirectX as well as many other libraries have this kind of function. An example is given below:
+
+
struct iMath; // some structure
+int Create_Math(iMath** pptr); // its creator (assume it mallocs)
+
+
+
Which would be used with the following C code:
+
+
iMath* ptr;
+int ok;
+ok=Create_Math(&ptr);
+// do things with ptr
+//...
+free(ptr); // dispose of iMath
+
+
+
SWIG has a ready written typemap to deal with such a kind of function in <typemaps.i>. It provides the correct wrappering as well as setting the flag to inform Lua that the object in question should be garbage collected. Therefore the code is simply:
+
+
%include <typemaps.i>
+%apply SWIGTYPE** OUTPUT{iMath **pptr }; // tell SWIG its an output
+
+struct iMath; // some structure
+int Create_Math(iMath** pptr); // its creator (assume it mallocs)
+
+
+
The usage is as follows:
+
+
ok,ptr=Create_Math() -- ptr is a iMath* which is returned with the int (ok)
+ptr=nil -- the iMath* will be GC'ed as normal
+
+
+
23.5 Writing typemaps
+
+
+
This section describes how you can modify SWIG's default wrapping behavior for various C/C++ datatypes using the %typemap directive. This is an advanced topic that assumes familiarity with the Lua C API as well as the material in the "Typemaps" chapter.
+
+
Before proceeding, it should be stressed that writing typemaps is rarely needed unless you want to change some aspect of the wrappering, or to achieve an effect which in not available with the default bindings.
+
+
Before proceeding, you should read the previous section on using typemaps, as well as read the ready written typemaps found in luatypemaps.swg and typemaps.i. These are both well documented and fairly easy to read. You should not attempt to write your own typemaps until you have read and can understand both of these files (they may well also give you a idea to base your worn on).
+
+
23.5.1 Typemaps you can write
+
+
+
There are many different types of typemap that can be written, the full list can be found in the "Typemaps" chapter. However the following are the most commonly used ones.
+
+
+
in this is for input arguments to functions
+
out this is for return types from functions
+
argout this is for a function argument which is actually returning something
+
typecheck this is used to determine which overloaded function should be called
+(the syntax for the typecheck is different from the typemap, see typemaps for details).
+
+
+
23.5.2 SWIG's Lua-C API
+
+
+
This section explains the SWIG specific Lua-C API. It does not cover the main Lua-C api, as this is well documented and not worth covering.
+
+
int SWIG_ConvertPtr(lua_State* L,int index,void** ptr,swig_type_info *type,int flags);
+
+
+This is the standard function used for converting a Lua userdata to a void*. It takes the value at the given index in the Lua state and converts it to a userdata. It will then provide the neccesary type checks, confirming that the pointer is compatible with the type given in 'type'. Then finally setting '*ptr' to the pointer.
+If flags is set to SWIG_POINTER_DISOWN, this is will clear any ownership flag set on the object.
+The returns a value which can be checked with the macro SWIG_IsOK()
+
+This is the opposite of SWIG_ConvertPtr, as it pushes a new userdata which wrappers the pointer 'ptr' of type 'type'.
+The parameter 'own' specifies if the object is owned be Lua and if it is 1 then Lua will GC the object when the userdata is disposed of.
+
+This function is a version of SWIG_ConvertPtr(), except that it will either work, or it will trigger a lua_error() with a text error message. This function is rarely used, and may be deprecated in the future.
+
+
+
SWIG_fail
+
+
+This macro, when called within the context of a SWIG wrappered function, will jump to the error handler code. This will call any cleanup code (freeing any temp variables) and then triggers a lua_error.
+A common use for this code is:
+if (!SWIG_IsOK(SWIG_ConvertPtr( .....)){
+ lua_pushstring(L,"something bad happened");
+ SWIG_fail;
+}
+This macro, when called within the context of a SWIG wrappered function, will display the error message and jump to the error handler code. The error message is of the form
+
+"Error in func_name (arg argnum), expected 'type' got 'whatever the type was'"
+
+Similar to SWIG_fail_arg, except that it will display the swig_type_info information instead.
+
+
23.6 Customization of your Bindings
+
+
+
+This section covers adding of some small extra bits to your module to add the last finishing touches.
+
+
+
+
+
23.6.1 Writing your own custom wrappers
@@ -1117,7 +1393,7 @@ int native_function(lua_State*L) // my native code
The %native directive in the above example, tells SWIG that there is a function int native_function(lua_State*L); which is to be added into the module under the name 'my_func'. SWIG will not add any wrappering for this function, beyond adding it into the function table. How you write your code is entirely up to you.
-
23.3.17 Adding additional Lua code
+
23.6.2 Adding additional Lua code
@@ -1155,7 +1431,7 @@ Good uses for this feature is adding of new code, or writing helper functions to
See Examples/lua/arrays for an example of this code.
-
23.4 Details on the Lua binding
+
23.7 Details on the Lua binding
@@ -1166,7 +1442,7 @@ See Examples/lua/arrays for an example of this code.
-
23.4.1 Binding global data into the module.
+
23.7.1 Binding global data into the module.
@@ -1226,7 +1502,7 @@ end
That way when you call 'a=example.Foo', the interpreter looks at the table 'example' sees that there is no field 'Foo' and calls __index. This will in turn check in '.get' table and find the existence of 'Foo' and then return the value of the C function call 'Foo_get()'. Similarly for the code 'example.Foo=10', the interpreter will check the table, then call the __newindex which will then check the '.set' table and call the C function 'Foo_set(10)'.
-
23.4.2 Userdata and Metatables
+
23.7.2 Userdata and Metatables
@@ -1306,7 +1582,7 @@ Note: Both the opaque structures (like the FILE*) and normal wrappered classes/s
Note: Operator overloads are basically done in the same way, by adding functions such as '__add' & '__call' to the classes metatable. The current implementation is a bit rough as it will add any member function beginning with '__' into the metatable too, assuming its an operator overload.
-
23.4.3 Memory management
+
23.7.3 Memory management
diff --git a/Doc/Manual/Makefile b/Doc/Manual/Makefile
index 1923c2c48..4c907791b 100644
--- a/Doc/Manual/Makefile
+++ b/Doc/Manual/Makefile
@@ -18,15 +18,19 @@ HTMLDOC_OPTIONS = "--book --toclevels 4 --no-numbered --toctitle \"Table of Cont
all: maketoc check generate
-maketoc:
+maketoc: CCache.html
python maketoc.py
+CCache.html: ../../CCache/ccache.yo
+ yodl2html -o CCache.html ../../CCache/ccache.yo
+
# Use htmltidy to warn about some HTML errors. Note that it is not used to clean/tidy the HTML,
# it is just used as a primitive HTML checker.
+# CCache.html is generated by yodl2html and has a few insignificant problems, so we don't put it through tidy
check:
tidy -errors --gnu-emacs yes -quiet index.html
tidy -errors --gnu-emacs yes -quiet Sections.html
- all=`sed '/^#/d' chapters`; for a in $$all; do tidy -errors --gnu-emacs yes -quiet $$a; done;
+ all=`sed '/^#/d' chapters | grep -v CCache.html`; for a in $$all; do tidy -errors --gnu-emacs yes -quiet $$a; done;
generate: swightml.book swigpdf.book
htmldoc --batch swightml.book || true
@@ -45,11 +49,14 @@ swightml.book:
echo "Sections.html" >> swightml.book
cat chapters >> swightml.book
-clean:
+clean: clean-baks
rm -f swightml.book
rm -f swigpdf.book
+ rm -f CCache.html
rm -f SWIGDocumentation.html
rm -f SWIGDocumentation.pdf
+
+clean-baks:
rm -f *.bak
test:
diff --git a/Doc/Manual/Modula3.html b/Doc/Manual/Modula3.html
index 7a6bacd34..c4e485202 100644
--- a/Doc/Manual/Modula3.html
+++ b/Doc/Manual/Modula3.html
@@ -860,8 +860,8 @@ that split the task up into converting
the C bit patterns (integer or bit set)
into Modula-3 bit patterns (integer or bit set)
and change the type as requested.
-See the corresponding
-example.
+See the corresponding example in the
+Examples/modula3/enum/example.i file.
This is quite messy and not satisfying.
So the best what you can currently do is
to rewrite constant definitions manually.
@@ -877,8 +877,8 @@ that I'd like to automate.
Declarations of C++ classes are mapped to OBJECT types
while it is tried to retain the access hierarchy
"public - protected - private" using partial revelation.
-Though the
-implementation
+Though the example in
+Examples/modula3/class/example.i
is not really useful, yet.
+Each invocation of SWIG requires a module name to be specified.
+The module name is used to name the resulting target language extension module.
+Exactly what this means and and what the name is used for
+depends on the target language, for example the name can define
+a target language namespace or merely be a useful name for naming files or helper classes.
+Essentially, a module comprises target language wrappers for a chosen collection of global variables/functions, structs/classes and other C/C++ types.
+
+
+
+The module name can be supplied in one of two ways.
+The first is to specify it with the special %module
+directive. This directive must appear at the beginning of the interface file.
+The general form of this directive is:
+
+where the modulename is mandatory and the options add one or more optional additional features.
+Typically no options are specified, for example:
+
+
+
+%module mymodule
+
+
+
+The second way to specify the module name is with the -module command line option, for example -module mymodule.
+If the module name is supplied on the command line, it overrides the name specified by the
+%module directive.
+
+
When first working with SWIG, users commonly start by creating a
single module. That is, you might define a single SWIG interface that
wraps some set of C/C++ code. You then compile all of the generated
-wrapper code into a module and use it. For large applications, however,
+wrapper code together and use it. For large applications, however,
this approach is problematic---the size of the generated wrapper code
can be rather large. Moreover, it is probably easier to manage the
target language interface when it is broken up into smaller pieces.
@@ -34,10 +73,11 @@ target language interface when it is broken up into smaller pieces.
This chapter describes the problem of using SWIG in programs
-where you want to create a collection of modules.
+where you want to create a collection of modules.
+Each module in the collection is created via separate invocations of SWIG.
-
15.1 Basics
+
15.2 Basics
@@ -50,43 +90,92 @@ scripting language runtime as you would do for the single module case.
A bit more complex is the case in which modules need to share information.
-For example, when one module extends the class of the another by deriving from
+For example, when one module extends the class of another by deriving from
it:
-%module base
-
-%inline %{
+// File: base.h
class base {
public:
- int foo(void);
+ int foo();
};
+
-%module derived
+// File: derived_module.i
+%module derived_module
-%import "base.i"
+%import "base_module.i"
%inline %{
class derived : public base {
public:
- int bar(void);
+ int bar();
};
%}
-
To create the wrapper properly, module derived needs to know the
-base class and that it's interface is covered in another module. The
-line %import "base.i" lets SWIG know exactly that. The common mistake here is
-to %import the .h file instead of the .i, which sadly won't do the trick. Another issue
-to take care of is that multiple dependent wrappers should not be linked/loaded
+
To create the wrapper properly, module derived_module needs to know about the
+base class and that its interface is covered in another module. The
+line %import "base_module.i" lets SWIG know exactly that. Oftentimes
+the .h file is passed to %import instead of the .i,
+which unfortunately doesn't work for all language modules. For example, Python requires the
+name of module that the base class exists in so that the proxy classes can fully inherit the
+base class's methods. Typically you will get a warning when the module name is missing, eg:
+
+
+
+derived_module.i:8: Warning(401): Base class 'base' ignored - unknown module name for base. Either import
+the appropriate module interface file or specify the name of the module in the %import directive.
+
+
+
+It is sometimes desirable to import the header file rather than the interface file and overcome
+the above warning.
+For example in the case of the imported interface being quite large, it may be desirable to
+simplify matters and just import a small header file of dependent types.
+This can be done by specifying the optional module attribute in the %import directive.
+The derived_module.i file shown above could be replaced with the following:
+
+
+// File: derived_module.i
+%module derived_module
+
+%import(module="base_module") "base.h"
+
+%inline %{
+class derived : public base {
+public:
+ int bar();
+};
+
+
+
+Note that "base_module" is the module name and is the same as that specified in %module
+in base_module.i as well as the %import in derived_module.i.
+
+
+
+Another issue
+to beware of is that multiple dependent wrappers should not be linked/loaded
in parallel from multiple threads as SWIG provides no locking - for more on that
-issue, read on.
+issue, read on.
+
-
15.2 The SWIG runtime code
+
15.3 The SWIG runtime code
@@ -152,7 +241,7 @@ can peacefully coexist. So the type structures are separated by the
is empty. Only modules compiled with the same pair will share type information.
-
15.3 External access to the runtime
+
15.4 External access to the runtime
As described in The run-time type checker,
@@ -189,7 +278,7 @@ SWIG_TYPE_TABLE to be the same as the module whose types you are trying to
access.
-
15.4 A word of caution about static libraries
+
15.5 A word of caution about static libraries
@@ -200,7 +289,7 @@ into it. This is very often NOT what you want and it can lead to unexpect
behavior. When working with dynamically loadable modules, you should try to work exclusively with shared libraries.
-
15.5 References
+
15.6 References
@@ -208,7 +297,7 @@ Due to the complexity of working with shared libraries and multiple modules, it
an outside reference. John Levine's "Linkers and Loaders" is highly recommended.
-
15.6 Reducing the wrapper file size
+
15.7 Reducing the wrapper file size
diff --git a/Doc/Manual/Ocaml.html b/Doc/Manual/Ocaml.html
index 6dbf24c11..b65831192 100644
--- a/Doc/Manual/Ocaml.html
+++ b/Doc/Manual/Ocaml.html
@@ -634,13 +634,13 @@ length. Instead, use multiple returns, as in the argout_ref example.
#include "example.h"
%}
-%include stl.i
+%include <stl.i>
namespace std {
%template(StringVector) std::vector < string >;
};
-%include example.h
+%include "example.h"
This example is in Examples/ocaml/stl
diff --git a/Doc/Manual/Perl5.html b/Doc/Manual/Perl5.html
index 1dc8e7d2f..f77dc2f01 100644
--- a/Doc/Manual/Perl5.html
+++ b/Doc/Manual/Perl5.html
@@ -264,7 +264,7 @@ extern int fact(int);
%}
// Include code for rebuilding Perl
-%include perlmain.i
+%include <perlmain.i>
@@ -1543,7 +1543,7 @@ example:
%module example
-%include typemaps.i
+%include "typemaps.i"
void add(int x, int y, int *REFERENCE);
This chapter describes SWIG's support of Python. SWIG is compatible
-with most recent Python versions including Python 2.2 as well as older
-versions dating back to Python 1.5.2. For the best results, consider using Python
-2.0 or newer.
+with most recent Python versions including Python 3.0 and Python 2.6,
+as well as older versions dating back to Python 2.0. For the best results,
+consider using Python 2.3 or newer.
@@ -427,7 +433,7 @@ extern int mod(int, int);
extern double My_variable;
%}
-%include embed.i // Include code for a static version of Python
+%include "embed.i" // Include code for a static version of Python
@@ -2544,7 +2550,7 @@ class itself. In Python-2.1 and earlier, they have to be accessed as a global
function or through an instance (see the earlier section).
-
31.5 Cross language polymorphism
+
31.5 Cross language polymorphism
@@ -4929,7 +4935,7 @@ with more than one line.
Using the package option of the %module directive
allows you to specify what Python package that the module will be
-living in when installed.
+living in when installed.
@@ -4950,6 +4956,256 @@ and also in base class declarations, etc. if the package name is
different than its own.
+
31.12 Python 3 Support
+
+
+
+SWIG is able to support Python 3.0. The wrapper code generated by
+SWIG can be compiled with both Python 2.x or 3.0. Further more, by
+passing the -py3 command line option to SWIG, wrapper code
+with some Python 3 specific features can be generated (see below
+subsections for details of these features). The -py3 option also
+disables some incompatible features for Python 3, such as
+-classic.
+
+
+There is a list of known-to-be-broken features in Python 3:
+
+
+
No more support for FILE* typemaps, because PyFile_AsFile has been dropped
+ in Python 3.
+
The -apply command line option is removed and generating
+ code using apply() is no longer supported.
+
+
+
+The following are Python 3.0 new features that are currently supported by
+SWIG.
+
+
+
31.12.1 Function annotation
+
+
+
+The -py3 option will enable function annotation support. When used
+SWIG is able to generate proxy method definitions like this:
+
+Also, even if without passing SWIG the -py3 option, the parameter list
+still could be generated:
+
+
+
+ def foo(self, bar = 0): ...
+
+
+
+But for overloaded function or method, the parameter list would fallback to
+*args or self, *args, and **kwargs may be append
+depend on whether you enabled the keyword argument. This fallback is due to
+all overloaded functions share the same function in SWIG generated proxy class.
+
+
+
+For detailed usage of function annotation, see PEP 3107.
+
+
+
31.12.2 Buffer interface
+
+
+
+Buffer protocols were revised in Python 3. SWIG also gains a series of
+new typemaps to support buffer interfaces. These typemap macros are
+defined in pybuffer.i, which must be included in order to use them.
+By using these typemaps, your wrapped function will be able to
+accept any Python object that exposes a suitable buffer interface.
+
+
+
+For example, the get_path() function puts the path string
+into the memory pointed to by its argument:
+
+
+
+void get_path(char *s);
+
+
+
+Then you can write a typemap like this: (the following example is
+applied to both Python 3.0 and 2.6, since the bytearray type
+is backported to 2.6.
+
+And then on the Python side the wrapped get_path could be used in this
+way:
+
+
+
+>>> p = bytearray(10)
+>>> get_path(p)
+>>> print(p)
+bytearray(b'/Foo/Bar/\x00')
+
+
+
+The macros defined in pybuffer.i are similar to those in
+cstring.i:
+
+
+
+%pybuffer_mutable_binary(parm, size_parm)
+
+
+
+
+
+The macro can be used to generate a typemap which maps a buffer of an
+object to a pointer provided by parm and a size argument
+provided by size_parm. For example:
+
+Both %pybuffer_mutable_binary and %pybuffer_mutable_string
+require the provided buffer to be mutable, eg. they can accept a
+bytearray type but can't accept an immutable byte
+type.
+
+
+
+
+
+%pybuffer_binary(parm, size_parm)
+
+
+
+
+
+This macro maps an object's buffer to a pointer parm and a
+size size_parm. It is similar to
+%pybuffer_mutable_binary, except the
+%pybuffer_binary an accept both mutable and immutable
+buffers. As a result, the wrapped function should not modify the buffer.
+
+
+
+
+
+%pybuffer_string(parm)
+
+
+
+
+
+This macro maps an object's buffer as a string pointer parm.
+It is similar to %pybuffer_mutable_string but the buffer
+could be both mutable and immutable. And your function should not
+modify the buffer.
+
+
+
+
+
+
31.12.3 Abstract base classes
+
+
+
+By including pyabc.i and using the -py3 command
+line option when calling SWIG, the proxy classes of the STL containers
+will automatically gain an appropriate abstract base class. For
+example, the following SWIG interface:
+
+will generate a Python proxy class Mapii inheriting from
+collections.MutableMap and a proxy class IntList
+inheriting from collections.MutableSequence.
+
+
+
+pyabc.i also provides a macro %pythonabc that could be
+used to define an abstract base class for your own C++ class:
+
+
+
+%pythonabc(MySet, collections.MutableSet);
+
+
+
+For details of abstract base class, please see PEP 3119.
+