Completely new type implementation. Almost everything broken. Typemaps sort of work. Tcl is the only working language module. More changes to follow over the next few days.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@651 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2000-08-14 22:09:56 +00:00
commit fa2942e77c
31 changed files with 2165 additions and 2095 deletions

View file

@ -37,7 +37,7 @@ Swig_copy_string(const char *s) {
* ----------------------------------------------------------------------------- */
void
Swig_banner(DOHFile *f) {
Swig_banner(File *f) {
Printf(f,
"/* ----------------------------------------------------------------------------\n\
* This file was automatically generated by SWIG (http://www.swig.org).\n\
@ -56,6 +56,48 @@ Swig_banner(DOHFile *f) {
}
/* -----------------------------------------------------------------------------
* Swig_temp_result()
*
* This function is used to return a "temporary" result--a result that is only
* guaranteed to exist for a short period of time. Typically this is used by
* functions that return strings and other intermediate results that are
* used in print statements.
*
* Note: this is really a bit of a kludge to make it easier to work with
* temporary variables (so that the caller doesn't have to worry about
* memory management). In theory, it is possible to break this if an
* operation produces so many temporaries that it overflows the internal
* array before they are used. However, in practice, this would only
* occur for very deep levels of recursion or functions taking lots of
* parameters---neither of which occur very often in SWIG (if at all).
* Also, a user can prevent destruction of a temporary object by increasing
* it's reference count using DohIncref().
*
* It is an error to place two identical results onto this list. It is also
* an error for a caller to free anything returned by this function.
*
* Note: SWIG1.1 did something similar to this in a less-organized manner.
* ----------------------------------------------------------------------------- */
#define MAX_RESULT 512
static DOH *results[MAX_RESULT];
static int results_index = 0;
static int results_init = 0;
DOH *Swig_temp_result(DOH *x) {
int i;
if (!results_init) {
for (i = 0; i < MAX_RESULT; i++) results[i] = 0;
results_init = 1;
}
/* Printf(stdout,"results_index = %d, %x, '%s'\n", results_index, x, x); */
if (results[results_index]) Delete(results[results_index]);
results[results_index] = x;
results_index = (results_index + 1) % MAX_RESULT;
return x;
}