Merged MzScheme changes contributed by John Lenz.

Minor build changes to fix MzScheme/C++ test cases.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4880 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Matthias Köppe 2003-06-10 21:54:01 +00:00
commit 568be8990a
12 changed files with 345 additions and 508 deletions

View file

@ -1,5 +1,31 @@
Version 1.3.20 (In progress)
============================
06/10/2003: mkoeppe (Matthias Koeppe)
[MzScheme] Applied MzScheme module updates contributed by
John Lenz <jelenz@students.wisc.edu>.
- Updated mzscheme to use SWIG's common runtime type
system from common.swg.
- The Lib/mzscheme directory has been reorganized to
standardize names across the language modules:
mzscheme.i was moved to mzscheme.swg, mzscheme.swg and
mzschemedec.swg have been removed, mzrun.swg (which
contains the runtime code) has been added.
- The swig_proxy structure was renamed to swig_mz_proxy.
swig_mz_proxy now contains a pointer to a swig_type_info
structure.
- Added varin and varout typemaps for SWIGTYPE [] and
SWIGTYPE &.
- Garbage collection by calling scheme_add_finalizer() has
been added.
*** NEW FEATURE [MzScheme] ***
06/10/2003: cheetah (William Fulton)
[Java] New typemaps: javadestruct_base and javadestruct_derived
for the C++ destructor wrapper. The _base version gets used by
@ -12,7 +38,7 @@ Version 1.3.20 (In progress)
typemaps designed for the Dispose method.
New typemaps: csfinalize for finalizers.
06/10/2002: Tiger
06/10/2003: Tiger
Modified contract code for error message output.
Contract code can now print out simple error message.
Modified contract code to prepare for inheritance

View file

@ -494,6 +494,7 @@ java_clean:
##################################################################
MZC = test -n "@MZC@" && @MZC@
MZDYNOBJ = @MZDYNOBJ@
# ----------------------------------------------------------------
# Build a C/C++ dynamically loadable module
@ -507,7 +508,7 @@ mzscheme: $(SRCS)
mzscheme_cpp: $(SRCS)
$(SWIG) -mzscheme -c++ $(SWIGOPT) $(INTERFACE)
$(MZC) ++ccf "$(INCLUDES)" --cc $(ICXXSRCS) $(SRCS) $(CXXSRCS)
$(MZC) --ld $(TARGET)$(SO) $(OBJS) $(IOBJS) $(CPP_DLLIBS)
$(CXXSHARED) -o $(TARGET)$(SO) $(OBJS) $(IOBJS) $(MZDYNOBJ) $(CPP_DLLIBS)
# ----------------------------------------------------------------
# Build a dynamically loadable module, linked against SWIG runtime
@ -523,7 +524,7 @@ mzscheme_multi: $(SRCS)
mzscheme_multi_cpp: $(SRCS)
$(SWIG) -c -mzscheme -c++ $(SWIGOPT) $(INTERFACE)
$(MZC) ++ccf "$(INCLUDES)" --cc $(ICXXSRCS) $(SRCS) $(CXXSRCS)
$(MZC) --ld $(TARGET)$(SO) $(OBJS) $(IOBJS) $(MZSCHEME_RUNTIME) $(CPP_DLLIBS)
$(CXXSHARED) -o $(TARGET)$(SO) $(OBJS) $(IOBJS) $(MZSCHEME_RUNTIME) $(MZDYNOBJ) $(CPP_DLLIBS)
# -----------------------------------------------------------------
# Cleaning the mzscheme examples

134
Lib/mzscheme/mzrun.swg Normal file
View file

@ -0,0 +1,134 @@
/* -*- c -*-
* -----------------------------------------------------------------------
* swig_lib/mzscheme/mzrun.swg
*
* Author: John Lenz <jelenz@students.wisc.edu>
* ----------------------------------------------------------------------- */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <escheme.h>
#ifdef __cplusplus
extern "C" {
#endif
#define MAXVALUES 6
#define swig_make_boolean(b) (b ? scheme_true : scheme_false)
#ifdef SWIG_NOINCLUDE
SWIGIMPORT(void) SWIG_Mzscheme_Init();
/* If there is a type-mismatch, return nonzero; on success, return 0. */
SWIGIMPORT(int) SWIG_Mzscheme_ConvertPtr(Scheme_Object *s, void **result, swig_type_info *type, int flags);
/* If there is a type-mismatch, signal a wrong-type-arg error for the given argument number. */
SWIGIMPORT(void *) SWIG_Mzscheme_MustGetPtr(Scheme_Object *s, swig_type_info *type,
int argnum, int flags, const char *func_name,
int argc, Scheme_Object **argv);
SWIGIMPORT(Scheme_Object *) SWIG_Mzscheme_NewPointerObj(void *ptr, swig_type_info *type, int owner);
SWIGIMPORT(void *) SWIG_Mzscheme_Malloc(size_t size, const char *func_name);
SWIGIMPORT(Scheme_Object *) SWIG_Mzscheme_PackageValues(int num, Scheme_Object **values);
#else
struct swig_mz_proxy {
Scheme_Type mztype;
swig_type_info *type;
void *object;
};
static Scheme_Type swig_type;
static int swig_mz_initialized = 0;
static void mz_free_swig(void *p, void *data) {
struct swig_mz_proxy *proxy = (struct swig_mz_proxy *) p;
if (SCHEME_NULLP((Scheme_Object*)p) || SCHEME_TYPE((Scheme_Object*)p) != swig_type)
return;
if (proxy->type) {
if (proxy->type->clientdata) {
((Scheme_Prim *)proxy->type->clientdata)(1, (Scheme_Object **)&proxy);
}
}
}
SWIGRUNTIME(Scheme_Object *)
SWIG_Mzscheme_NewPointerObj(void *ptr, swig_type_info *type, int owner) {
struct swig_mz_proxy *new_proxy;
new_proxy = (struct swig_mz_proxy *) scheme_malloc(sizeof(struct swig_mz_proxy));
new_proxy->mztype = swig_type;
new_proxy->type = type;
new_proxy->object = ptr;
if (owner) {
scheme_add_finalizer(new_proxy, mz_free_swig, NULL);
}
return (Scheme_Object *) new_proxy;
}
SWIGRUNTIME(int)
SWIG_Mzscheme_ConvertPtr(Scheme_Object *s, void **result, swig_type_info *type, int flags) {
swig_type_info *cast;
if (SCHEME_NULLP(s)) {
*result = NULL;
return 0;
} else if (SCHEME_TYPE(s) == swig_type) {
struct swig_mz_proxy *proxy = (struct swig_mz_proxy *) s;
if (type) {
cast = SWIG_TypeCheck((char *)proxy->type->name, type);
if (cast) {
*result = SWIG_TypeCast(cast, proxy->object);
return 0;
} else {
return 1;
}
} else {
*result = proxy->object;
return 0;
}
}
return 1;
}
SWIGRUNTIME(void *)
SWIG_Mzscheme_MustGetPtr(Scheme_Object *s, swig_type_info *type,
int argnum, int flags, const char *func_name,
int argc, Scheme_Object **argv) {
void *result;
if (SWIG_Mzscheme_ConvertPtr(s, &result, type, flags)) {
scheme_wrong_type(func_name, type->str ? type->str : "void *", argnum, argc, argv);
}
return result;
}
SWIGRUNTIME(void)
SWIG_Mzscheme_Init() {
if (!swig_mz_initialized) {
swig_type = scheme_make_type((char *)"swig");
swig_mz_initialized = 1;
}
}
SWIGRUNTIME(void *)
SWIG_Mzscheme_Malloc(size_t size, const char *func_name) {
void *p = malloc(size);
if (p == NULL) {
scheme_signal_error("swig-memory-error");
} else return p;
}
SWIGIMPORT(Scheme_Object *)
SWIG_Mzscheme_PackageValues(int num, Scheme_Object **values) {
/* ignore first value if void */
if (num > 0 && SCHEME_VOIDP(values[0]))
num--, values++;
if (num == 0) return scheme_void;
else if (num == 1) return values[0];
else return scheme_values(num, values);
}
#endif
#ifdef __cplusplus
}
#endif

View file

@ -1,26 +0,0 @@
/* SWIG Configuration File for MzScheme. -*-c-*-
This file is parsed by SWIG before reading any other interface
file. */
/* Include headers */
%insert(runtime) "mzschemedec.swg"
/*#ifndef SWIG_NOINCLUDE*/
%insert(runtime) "mzscheme.swg"
/*#endif*/
%define SWIG_APPEND_VALUE(value)
values[lenv++] = value
%enddef
/* Definitions */
#define SWIG_malloc(size) swig_malloc(size, FUNC_NAME)
#define SWIG_free(mem) free(mem)
/* Guile compatibility kludges */
#define SCM_VALIDATE_VECTOR(argnum, value) (void)0
#define SCM_VALIDATE_LIST(argnum, value) (void)0
/* Read in standard typemaps. */
%include "typemaps.i"

View file

@ -1,270 +1,46 @@
/* -*-c-*- */
/* SWIG Configuration File for MzScheme. -*-c-*-
This file is parsed by SWIG before reading any other interface
file. */
/* SWIG pointer structure */
%runtime %{
#define SWIG_malloc(size) SWIG_Mzscheme_Malloc(size, FUNC_NAME)
#define SWIG_free(mem) free(mem)
#define SWIG_ConvertPtr(s, result, type, flags) \
SWIG_Mzscheme_ConvertPtr(s, result, type, flags)
#define SWIG_MustGetPtr(s, type, argnum, flags) \
SWIG_Mzscheme_MustGetPtr(s, type, argnum, flags, FUNC_NAME, argc, argv)
#define SWIG_NewPointerObj(ptr, type, owner) \
SWIG_Mzscheme_NewPointerObj((void *)ptr, type, owner)
%}
#ifdef __cplusplus
extern "C" {
#endif
/* Include headers */
%runtime "common.swg"
%runtime "mzrun.swg"
struct SwigCast {
struct SwigPtrType *type; /* Type in SwigPtrTbl */
void *(*cast)(void *); /* Pointer casting function */
struct SwigCast *next; /* Linked list pointer */
};
%define SWIG_APPEND_VALUE(value)
values[lenv++] = value
%enddef
struct SwigPtrType {
const char *name; /* Datatype name */
const char *prettyname; /* Pretty datatype name */
struct SwigCast *cast; /* List of compatible types */
};
/* Definitions */
#define SWIG_malloc(size) swig_malloc(size, FUNC_NAME)
#define SWIG_free(mem) free(mem)
struct swig_proxy {
Scheme_Type type;
SwigPtrType *ptrtype;
void *object;
};
/* Guile compatibility kludges */
#define SCM_VALIDATE_VECTOR(argnum, value) (void)0
#define SCM_VALIDATE_LIST(argnum, value) (void)0
/* Pointer table */
static SwigPtrType **SwigPtrTbl = 0; /* Sorted table */
static int SwigPtrMax = 64; /* Max entries that can be held */
/* (may be adjusted dynamically) */
static int SwigPtrN = 0; /* Current number of entries */
static int SwigPtrSort = 0; /* Status flag indicating sort */
/* Read in standard typemaps. */
%include "typemaps.i"
/* Sort comparison function */
static int
swigsort (const void *data1, const void *data2)
{
SwigPtrType *type1 = * (SwigPtrType **) data1;
SwigPtrType *type2 = * (SwigPtrType **) data2;
return strcmp(type1->name, type2->name);
}
%init %{
static int _swig_init = 0;
/* Register a new datatype with the type-checker */
SWIGSTATIC SwigPtrType *
SWIG_RegisterType (const char *type, const char *prettyname)
{
int i;
struct SwigPtrType **t;
/* Allocate the pointer table if necessary */
if (!SwigPtrTbl) {
SwigPtrTbl = (SwigPtrType **) malloc(SwigPtrMax*sizeof(SwigPtrType *));
SwigPtrN = 0;
}
/* Grow the table if necessary */
if (SwigPtrN >= SwigPtrMax) {
SwigPtrMax = 2*SwigPtrMax;
SwigPtrTbl = (SwigPtrType **) realloc((char *) SwigPtrTbl,
SwigPtrMax*sizeof(SwigPtrType *));
}
/* Look up type */
for (i = 0; i < SwigPtrN; i++)
if (strcmp(SwigPtrTbl[i]->name,type) == 0) {
if (prettyname!=NULL)
SwigPtrTbl[i]->prettyname = prettyname;
return SwigPtrTbl[i];
}
t = SwigPtrTbl + SwigPtrN;
*t = (SwigPtrType *) malloc(sizeof(SwigPtrType));
(*t)->name = type;
(*t)->prettyname = prettyname;
(*t)->cast = NULL;
SwigPtrN++;
SwigPtrSort = 0;
return *t;
}
/* Register two data types and their mapping with the type checker. */
SWIGSTATIC void
SWIG_RegisterMapping (const char *origtype, const char *newtype, void *(*cast)(void *))
{
struct SwigPtrType *t = SWIG_RegisterType(origtype, NULL);
if (newtype!=NULL) {
struct SwigPtrType *t1 = SWIG_RegisterType(newtype, NULL);
struct SwigCast *c;
/* Check for existing cast */
for (c = t->cast; c && c->type!=t1; c=c->next) /* nothing */;
if (c) {
if (cast) c->cast = cast;
}
else {
c = (struct SwigCast *) malloc(sizeof(struct SwigCast));
c->type = t1;
c->cast = cast;
c->next = t->cast;
t->cast = c;
if (!_swig_init) {
int i;
for (i = 0; swig_types_initial[i]; i++) {
swig_types[i] = SWIG_TypeRegister(swig_types_initial[i]);
}
_swig_init = 1;
}
}
/* Sort table */
static void
SWIG_SortTable (void)
{
qsort ((void *) SwigPtrTbl, SwigPtrN, sizeof(struct SwigPtrTbl *), swigsort);
/* Indicate that everything is sorted */
SwigPtrSort = 1;
}
/* Look up pointer-type entry in table */
static int
swigcmp (const void *key, const void *data)
{
char *k = (char *) key;
SwigPtrType *t = *(SwigPtrType **) data;
return strcmp(k, t->name);
}
static SwigPtrType *
SWIG_GetPtrType (const char *_t)
{
SwigPtrType **result;
if (!SwigPtrSort) SWIG_SortTable();
result = (SwigPtrType **) bsearch(_t, SwigPtrTbl, SwigPtrN,
sizeof(SwigPtrType *), swigcmp);
if (result!=NULL) return *result;
else return NULL;
}
/* Cast a pointer if possible; returns 1 if successful */
static int
SWIG_Cast (void *source, SwigPtrType *source_type,
void **ptr, SwigPtrType *dest_type)
{
if (dest_type != source_type) {
/* We have a type mismatch. Will have to look through our type
mapping table to figure out whether or not we can accept this
datatype. */
struct SwigCast *c;
for (c = dest_type->cast;
c && c->type!=source_type; c = c->next) /* nothing */;
if (c) {
/* Get pointer value. */
if (c->cast) *ptr = (*(c->cast))(source);
else *ptr = source;
return -1;
}
/* Didn't find any sort of match for this data.
Get the pointer value and return false. */
*ptr = source;
return 0;
} else {
/* Found a match on the first try. Return pointer value. */
*ptr = source;
return -1;
}
}
/* Function for getting a pointer value */
static Scheme_Type swig_type;
int swig_initialized_p = 0;
SWIGSTATIC Scheme_Object *
SWIG_MakePtr(void *c_pointer, swig_type_info *type) {
struct swig_proxy *new_proxy;
new_proxy = (struct swig_proxy *) scheme_malloc(sizeof(struct swig_proxy));
new_proxy->type = swig_type;
new_proxy->ptrtype = type->ptrtype;
new_proxy->object = (void *) c_pointer;
return (Scheme_Object *) new_proxy;
}
/* Return 0 if successful. */
SWIGSTATIC int
SWIG_GetPtr(Scheme_Object *s, void **result, swig_type_info *type)
{
if (SCHEME_NULLP(s)) {
*result = NULL;
return 0;
}
else if (SCHEME_TYPE(s) == swig_type) {
struct swig_proxy *proxy = (struct swig_proxy *) s;
if (type) {
return !SWIG_Cast(proxy->object, proxy->ptrtype,
result, type->ptrtype);
}
else {
*result = proxy->object;
return 0;
}
}
return -1;
}
SWIGSTATIC void *
SWIG_MustGetPtr_ (Scheme_Object *s, swig_type_info *type,
int argnum, const char *func_name,
int argc, Scheme_Object **argv)
{
void *result;
if (SWIG_GetPtr(s, &result, type) != 0) {
/* type mismatch */
scheme_wrong_type(func_name, type->str ? type->str : "void *", argnum, argc, argv);
}
return result;
}
SWIGSTATIC
void SWIG_RegisterTypes(swig_type_info **table,
swig_type_info **init)
{
if (!swig_initialized_p) {
swig_type = scheme_make_type((char *) "swig");
swig_initialized_p = 1;
}
for (; *init; table++, init++) {
swig_type_info *type = *table = *init;
const char *origname = type->name;
/* Register datatype itself and store pointer back */
type->ptrtype = SWIG_RegisterType(origname, type->str);
/* Register compatible types */
for (type++; type->name; type++)
SWIG_RegisterMapping(origname, type->name, type->converter);
}
}
/* Dynamic pointer casting. Down an inheritance hierarchy */
SWIGSTATIC swig_type_info *
SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr)
{
swig_type_info *lastty = ty;
if (!ty || !ty->dcast) return ty;
while (ty && (ty->dcast)) {
ty = (*ty->dcast)(ptr);
if (ty) lastty = ty;
}
return lastty;
}
static Scheme_Object *
swig_package_values(int num, Scheme_Object **values)
{
/* ignore first value if void */
if (num > 0 && SCHEME_VOIDP(values[0]))
num--, values++;
if (num == 0) return scheme_void;
else if (num == 1) return values[0];
else return scheme_values(num, values);
}
static void *
swig_malloc(size_t size, const char *func_name)
{
void *p = malloc(size);
if (p == NULL) {
scheme_signal_error("swig-memory-error");
}
else return p;
}
#ifdef __cplusplus
}
#endif
SWIG_Mzscheme_Init();
%}

View file

@ -1,84 +0,0 @@
/* -*-c-*-
* -----------------------------------------------------------------------
* swig_lib/mzscheme/mzschemedec.swg
* Copyright (C) 2000, 2001 Matthias Koeppe
*
* MzScheme runtime code -- declarations
* ----------------------------------------------------------------------- */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <escheme.h>
#if defined(SWIG_NOINCLUDE)
# define SWIGSTATIC
#elif defined(SWIG_GLOBAL)
# define SWIGSTATIC
#else
# define SWIGSTATIC static
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define MAXVALUES 6
static Scheme_Object *
swig_make_boolean(int b)
{
if (b) return scheme_true;
else return scheme_false;
}
static Scheme_Object *
swig_package_values(int num, Scheme_Object **values);
typedef struct SwigPtrType SwigPtrType;
typedef struct swig_type_info *(*swig_dycast_func)(void **);
typedef struct swig_type_info {
const char *name;
void *(*converter)(void *);
const char *str;
void *clientdata;
SwigPtrType *ptrtype;
swig_dycast_func dcast;
} swig_type_info;
SWIGSTATIC SwigPtrType *
SWIG_RegisterType (const char *type, const char *prettyname);
SWIGSTATIC void
SWIG_RegisterMapping (const char *origtype, const char *newtype, void *(*cast)(void *));
/* Dynamic pointer casting. Down an inheritance hierarchy */
SWIGSTATIC swig_type_info *
SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr);
SWIGSTATIC Scheme_Object *
SWIG_MakePtr(void *c_pointer, swig_type_info *type);
SWIGSTATIC int
SWIG_GetPtr(Scheme_Object *s, void **result, swig_type_info *type);
SWIGSTATIC void *
SWIG_MustGetPtr_ (Scheme_Object *s, swig_type_info *type,
int argnum, const char *func_name,
int argc, Scheme_Object **argv);
#define SWIG_MustGetPtr(s, type, argnum) \
SWIG_MustGetPtr_(s, type, argnum, FUNC_NAME, argc, argv)
SWIGSTATIC
void SWIG_RegisterTypes(swig_type_info **table,
swig_type_info **init);
#ifdef __cplusplus
}
#endif
/* mzschemedec.swg ends here */

View file

@ -74,20 +74,20 @@ namespace std {
SWIG_exception(SWIG_TypeError,"alist expected");
key = scheme_car(entry);
val = scheme_cdr(entry);
k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum);
if (SWIG_GetPtr(val,(void**) &x,
$descriptor(T *)) == -1) {
k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0);
if (SWIG_ConvertPtr(val,(void**) &x,
$descriptor(T *), 0) == -1) {
if (!SCHEME_PAIRP(val))
SWIG_exception(SWIG_TypeError,"alist expected");
val = scheme_car(val);
x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum);
x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0);
}
(($1_type &)$1)[*k] = *x;
alist = scheme_cdr(alist);
}
} else {
$1 = *(($&1_type)
SWIG_MustGetPtr($input,$&1_descriptor,$argnum));
SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0));
}
}
%typemap(in) const map<K,T>& (std::map<K,T> temp,
@ -110,19 +110,19 @@ namespace std {
SWIG_exception(SWIG_TypeError,"alist expected");
key = scheme_car(entry);
val = scheme_cdr(entry);
k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum);
if (SWIG_GetPtr(val,(void**) &x,
$descriptor(T *)) == -1) {
k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0);
if (SWIG_ConvertPtr(val,(void**) &x,
$descriptor(T *), 0) == -1) {
if (!SCHEME_PAIRP(val))
SWIG_exception(SWIG_TypeError,"alist expected");
val = scheme_car(val);
x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum);
x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0);
}
temp[*k] = *x;
alist = scheme_cdr(alist);
}
} else {
$1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum);
$1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0);
}
}
%typemap(out) map<K,T> {
@ -131,8 +131,8 @@ namespace std {
i!=$1.rend(); ++i) {
K* key = new K(i->first);
T* val = new T(i->second);
Scheme_Object* k = SWIG_MakePtr(key,$descriptor(K *));
Scheme_Object* x = SWIG_MakePtr(val,$descriptor(T *));
Scheme_Object* k = SWIG_NewPointerObj(key,$descriptor(K *), 1);
Scheme_Object* x = SWIG_NewPointerObj(val,$descriptor(T *), 1);
Scheme_Object* entry = scheme_make_pair(k,x);
alist = scheme_make_pair(entry,alist);
}
@ -151,17 +151,17 @@ namespace std {
if (SCHEME_PAIRP(head)) {
Scheme_Object* key = scheme_car(head);
Scheme_Object* val = scheme_cdr(head);
if (SWIG_GetPtr(key,(void**) &k,
$descriptor(K *)) == -1) {
if (SWIG_ConvertPtr(key,(void**) &k,
$descriptor(K *), 0) == -1) {
$1 = 0;
} else {
if (SWIG_GetPtr(val,(void**) &x,
$descriptor(T *)) != -1) {
if (SWIG_ConvertPtr(val,(void**) &x,
$descriptor(T *), 0) != -1) {
$1 = 1;
} else if (SCHEME_PAIRP(val)) {
val = scheme_car(val);
if (SWIG_GetPtr(val,(void**) &x,
$descriptor(T *)) != -1)
if (SWIG_ConvertPtr(val,(void**) &x,
$descriptor(T *), 0) != -1)
$1 = 1;
else
$1 = 0;
@ -175,8 +175,8 @@ namespace std {
} else {
/* wrapped map? */
std::map<K,T >* m;
if (SWIG_GetPtr($input,(void **) &m,
$&1_descriptor) != -1)
if (SWIG_ConvertPtr($input,(void **) &m,
$&1_descriptor, 0) != -1)
$1 = 1;
else
$1 = 0;
@ -196,17 +196,17 @@ namespace std {
if (SCHEME_PAIRP(head)) {
Scheme_Object* key = scheme_car(head);
Scheme_Object* val = scheme_cdr(head);
if (SWIG_GetPtr(key,(void**) &k,
$descriptor(K *)) == -1) {
if (SWIG_ConvertPtr(key,(void**) &k,
$descriptor(K *), 0) == -1) {
$1 = 0;
} else {
if (SWIG_GetPtr(val,(void**) &x,
$descriptor(T *)) != -1) {
if (SWIG_ConvertPtr(val,(void**) &x,
$descriptor(T *), 0) != -1) {
$1 = 1;
} else if (SCHEME_PAIRP(val)) {
val = scheme_car(val);
if (SWIG_GetPtr(val,(void**) &x,
$descriptor(T *)) != -1)
if (SWIG_ConvertPtr(val,(void**) &x,
$descriptor(T *), 0) != -1)
$1 = 1;
else
$1 = 0;
@ -220,8 +220,8 @@ namespace std {
} else {
/* wrapped map? */
std::map<K,T >* m;
if (SWIG_GetPtr($input,(void **) &m,
$1_descriptor) != -1)
if (SWIG_ConvertPtr($input,(void **) &m,
$1_descriptor, 0) != -1)
$1 = 1;
else
$1 = 0;
@ -268,7 +268,7 @@ namespace std {
for (std::map<K,T >::reverse_iterator i=$1.rbegin();
i!=$1.rend(); ++i) {
K* key = new K(i->first);
Scheme_Object* k = SWIG_MakePtr(key,$descriptor(K *));
Scheme_Object* k = SWIG_NewPointerObj(key,$descriptor(K *), 1);
result = scheme_make_pair(k,result);
}
return result;
@ -299,19 +299,19 @@ namespace std {
if (!CHECK(key))
SWIG_exception(SWIG_TypeError,
"map<" #K "," #T "> expected");
if (SWIG_GetPtr(val,(void**) &x,
$descriptor(T *)) == -1) {
if (SWIG_ConvertPtr(val,(void**) &x,
$descriptor(T *), 0) == -1) {
if (!SCHEME_PAIRP(val))
SWIG_exception(SWIG_TypeError,"alist expected");
val = scheme_car(val);
x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum);
x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0);
}
(($1_type &)$1)[CONVERT_FROM(key)] = *x;
alist = scheme_cdr(alist);
}
} else {
$1 = *(($&1_type)
SWIG_MustGetPtr($input,$&1_descriptor,$argnum));
SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0));
}
}
%typemap(in) const map<K,T>& (std::map<K,T> temp,
@ -336,18 +336,18 @@ namespace std {
if (!CHECK(key))
SWIG_exception(SWIG_TypeError,
"map<" #K "," #T "> expected");
if (SWIG_GetPtr(val,(void**) &x,
$descriptor(T *)) == -1) {
if (SWIG_ConvertPtr(val,(void**) &x,
$descriptor(T *), 0) == -1) {
if (!SCHEME_PAIRP(val))
SWIG_exception(SWIG_TypeError,"alist expected");
val = scheme_car(val);
x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum);
x = (T*) SWIG_MustGetPtr(val,$descriptor(T *),$argnum, 0);
}
temp[CONVERT_FROM(key)] = *x;
alist = scheme_cdr(alist);
}
} else {
$1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum);
$1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0);
}
}
%typemap(out) map<K,T> {
@ -356,7 +356,7 @@ namespace std {
i!=$1.rend(); ++i) {
T* val = new T(i->second);
Scheme_Object* k = CONVERT_TO(i->first);
Scheme_Object* x = SWIG_MakePtr(val,$descriptor(T *));
Scheme_Object* x = SWIG_NewPointerObj(val,$descriptor(T *), 1);
Scheme_Object* entry = scheme_make_pair(k,x);
alist = scheme_make_pair(entry,alist);
}
@ -377,13 +377,13 @@ namespace std {
if (!CHECK(key)) {
$1 = 0;
} else {
if (SWIG_GetPtr(val,(void**) &x,
$descriptor(T *)) != -1) {
if (SWIG_ConvertPtr(val,(void**) &x,
$descriptor(T *), 0) != -1) {
$1 = 1;
} else if (SCHEME_PAIRP(val)) {
val = scheme_car(val);
if (SWIG_GetPtr(val,(void**) &x,
$descriptor(T *)) != -1)
if (SWIG_ConvertPtr(val,(void**) &x,
$descriptor(T *), 0) != -1)
$1 = 1;
else
$1 = 0;
@ -397,8 +397,8 @@ namespace std {
} else {
// wrapped map?
std::map<K,T >* m;
if (SWIG_GetPtr($input,(void **) &m,
$&1_descriptor) != -1)
if (SWIG_ConvertPtr($input,(void **) &m,
$&1_descriptor, 0) != -1)
$1 = 1;
else
$1 = 0;
@ -420,13 +420,13 @@ namespace std {
if (!CHECK(key)) {
$1 = 0;
} else {
if (SWIG_GetPtr(val,(void**) &x,
$descriptor(T *)) != -1) {
if (SWIG_ConvertPtr(val,(void**) &x,
$descriptor(T *), 0) != -1) {
$1 = 1;
} else if (SCHEME_PAIRP(val)) {
val = scheme_car(val);
if (SWIG_GetPtr(val,(void**) &x,
$descriptor(T *)) != -1)
if (SWIG_ConvertPtr(val,(void**) &x,
$descriptor(T *), 0) != -1)
$1 = 1;
else
$1 = 0;
@ -440,8 +440,8 @@ namespace std {
} else {
// wrapped map?
std::map<K,T >* m;
if (SWIG_GetPtr($input,(void **) &m,
$1_descriptor) != -1)
if (SWIG_ConvertPtr($input,(void **) &m,
$1_descriptor, 0) != -1)
$1 = 1;
else
$1 = 0;
@ -512,7 +512,7 @@ namespace std {
SWIG_exception(SWIG_TypeError,"alist expected");
key = scheme_car(entry);
val = scheme_cdr(entry);
k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum);
k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0);
if (!CHECK(val)) {
if (!SCHEME_PAIRP(val))
SWIG_exception(SWIG_TypeError,"alist expected");
@ -526,7 +526,7 @@ namespace std {
}
} else {
$1 = *(($&1_type)
SWIG_MustGetPtr($input,$&1_descriptor,$argnum));
SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0));
}
}
%typemap(in) const map<K,T>& (std::map<K,T> temp,
@ -548,7 +548,7 @@ namespace std {
SWIG_exception(SWIG_TypeError,"alist expected");
key = scheme_car(entry);
val = scheme_cdr(entry);
k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum);
k = (K*) SWIG_MustGetPtr(key,$descriptor(K *),$argnum, 0);
if (!CHECK(val)) {
if (!SCHEME_PAIRP(val))
SWIG_exception(SWIG_TypeError,"alist expected");
@ -561,7 +561,7 @@ namespace std {
alist = scheme_cdr(alist);
}
} else {
$1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum);
$1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0);
}
}
%typemap(out) map<K,T> {
@ -569,7 +569,7 @@ namespace std {
for (std::map<K,T >::reverse_iterator i=$1.rbegin();
i!=$1.rend(); ++i) {
K* key = new K(i->first);
Scheme_Object* k = SWIG_MakePtr(key,$descriptor(K *));
Scheme_Object* k = SWIG_NewPointerObj(key,$descriptor(K *), 1);
Scheme_Object* x = CONVERT_TO(i->second);
Scheme_Object* entry = scheme_make_pair(k,x);
alist = scheme_make_pair(entry,alist);
@ -588,8 +588,8 @@ namespace std {
if (SCHEME_PAIRP(head)) {
Scheme_Object* key = scheme_car(head);
Scheme_Object* val = scheme_cdr(head);
if (SWIG_GetPtr(val,(void **) &k,
$descriptor(K *)) == -1) {
if (SWIG_ConvertPtr(val,(void **) &k,
$descriptor(K *), 0) == -1) {
$1 = 0;
} else {
if (CHECK(val)) {
@ -610,8 +610,8 @@ namespace std {
} else {
// wrapped map?
std::map<K,T >* m;
if (SWIG_GetPtr($input,(void **) &m,
$&1_descriptor) != -1)
if (SWIG_ConvertPtr($input,(void **) &m,
$&1_descriptor, 0) != -1)
$1 = 1;
else
$1 = 0;
@ -630,8 +630,8 @@ namespace std {
if (SCHEME_PAIRP(head)) {
Scheme_Object* key = scheme_car(head);
Scheme_Object* val = scheme_cdr(head);
if (SWIG_GetPtr(val,(void **) &k,
$descriptor(K *)) == -1) {
if (SWIG_ConvertPtr(val,(void **) &k,
$descriptor(K *), 0) == -1) {
$1 = 0;
} else {
if (CHECK(val)) {
@ -652,8 +652,8 @@ namespace std {
} else {
// wrapped map?
std::map<K,T >* m;
if (SWIG_GetPtr($input,(void **) &m,
$1_descriptor) != -1)
if (SWIG_ConvertPtr($input,(void **) &m,
$1_descriptor, 0) != -1)
$1 = 1;
else
$1 = 0;
@ -700,7 +700,7 @@ namespace std {
for (std::map<K,T >::reverse_iterator i=$1.rbegin();
i!=$1.rend(); ++i) {
K* key = new K(i->first);
Scheme_Object* k = SWIG_MakePtr(key,$descriptor(K *));
Scheme_Object* k = SWIG_NewPointerObj(key,$descriptor(K *), 1);
result = scheme_make_pair(k,result);
}
return result;
@ -742,7 +742,7 @@ namespace std {
}
} else {
$1 = *(($&1_type)
SWIG_MustGetPtr($input,$&1_descriptor,$argnum));
SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0));
}
}
%typemap(in) const map<K,T>& (std::map<K,T> temp,
@ -778,7 +778,7 @@ namespace std {
alist = scheme_cdr(alist);
}
} else {
$1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum);
$1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0);
}
}
%typemap(out) map<K,T> {
@ -824,8 +824,8 @@ namespace std {
} else {
// wrapped map?
std::map<K,T >* m;
if (SWIG_GetPtr($input,(void **) &m,
$&1_descriptor) != -1)
if (SWIG_ConvertPtr($input,(void **) &m,
$&1_descriptor, 0) != -1)
$1 = 1;
else
$1 = 0;
@ -864,8 +864,8 @@ namespace std {
} else {
// wrapped map?
std::map<K,T >* m;
if (SWIG_GetPtr($input,(void **) &m,
$1_descriptor) != -1)
if (SWIG_ConvertPtr($input,(void **) &m,
$1_descriptor, 0) != -1)
$1 = 1;
else
$1 = 0;

View file

@ -80,7 +80,7 @@ namespace std {
(($1_type &)$1)[i] =
*((T*) SWIG_MustGetPtr(items[i],
$descriptor(T *),
$argnum));
$argnum, 0));
}
} else if (SCHEME_NULLP($input)) {
$1 = std::vector<T >();
@ -93,11 +93,11 @@ namespace std {
tail = scheme_cdr(tail);
$1.push_back(*((T*)SWIG_MustGetPtr(head,
$descriptor(T *),
$argnum)));
$argnum, 0)));
}
} else {
$1 = *(($&1_type)
SWIG_MustGetPtr($input,$&1_descriptor,$argnum));
SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0));
}
}
%typemap(in) const vector<T>& (std::vector<T> temp),
@ -110,7 +110,7 @@ namespace std {
for (unsigned int i=0; i<size; i++) {
temp[i] = *((T*) SWIG_MustGetPtr(items[i],
$descriptor(T *),
$argnum));
$argnum, 0));
}
} else if (SCHEME_NULLP($input)) {
temp = std::vector<T >();
@ -125,10 +125,10 @@ namespace std {
tail = scheme_cdr(tail);
temp.push_back(*((T*) SWIG_MustGetPtr(head,
$descriptor(T *),
$argnum)));
$argnum, 0)));
}
} else {
$1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum);
$1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0);
}
}
%typemap(out) vector<T> {
@ -136,7 +136,7 @@ namespace std {
Scheme_Object** els = SCHEME_VEC_ELS($result);
for (unsigned int i=0; i<$1.size(); i++) {
T* x = new T((($1_type &)$1)[i]);
els[i] = SWIG_MakePtr(x,$descriptor(T *));
els[i] = SWIG_NewPointerObj(x,$descriptor(T *), 1);
}
}
%typecheck(SWIG_TYPECHECK_VECTOR) vector<T> {
@ -150,8 +150,8 @@ namespace std {
/* check the first element only */
T* x;
Scheme_Object** items = SCHEME_VEC_ELS($input);
if (SWIG_GetPtr(items[0],(void**) &x,
$descriptor(T *)) != -1)
if (SWIG_ConvertPtr(items[0],(void**) &x,
$descriptor(T *), 0) != -1)
$1 = 1;
else
$1 = 0;
@ -163,16 +163,16 @@ namespace std {
/* check the first element only */
T* x;
Scheme_Object *head = scheme_car($input);
if (SWIG_GetPtr(head,(void**) &x,
$descriptor(T *)) != -1)
if (SWIG_ConvertPtr(head,(void**) &x,
$descriptor(T *), 0) != -1)
$1 = 1;
else
$1 = 0;
} else {
/* wrapped vector? */
std::vector<T >* v;
if (SWIG_GetPtr($input,(void **) &v,
$&1_descriptor) != -1)
if (SWIG_ConvertPtr($input,(void **) &v,
$&1_descriptor, 0) != -1)
$1 = 1;
else
$1 = 0;
@ -190,8 +190,8 @@ namespace std {
/* check the first element only */
T* x;
Scheme_Object** items = SCHEME_VEC_ELS($input);
if (SWIG_GetPtr(items[0],(void**) &x,
$descriptor(T *)) != -1)
if (SWIG_ConvertPtr(items[0],(void**) &x,
$descriptor(T *), 0) != -1)
$1 = 1;
else
$1 = 0;
@ -203,16 +203,16 @@ namespace std {
/* check the first element only */
T* x;
Scheme_Object *head = scheme_car($input);
if (SWIG_GetPtr(head,(void**) &x,
$descriptor(T *)) != -1)
if (SWIG_ConvertPtr(head,(void**) &x,
$descriptor(T *), 0) != -1)
$1 = 1;
else
$1 = 0;
} else {
/* wrapped vector? */
std::vector<T >* v;
if (SWIG_GetPtr($input,(void **) &v,
$1_descriptor) != -1)
if (SWIG_ConvertPtr($input,(void **) &v,
$1_descriptor, 0) != -1)
$1 = 1;
else
$1 = 0;
@ -292,7 +292,7 @@ namespace std {
}
} else {
$1 = *(($&1_type)
SWIG_MustGetPtr($input,$&1_descriptor,$argnum));
SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0));
}
}
%typemap(in) const vector<T>& (std::vector<T> temp),
@ -328,7 +328,7 @@ namespace std {
$argnum, argc, argv);
}
} else {
$1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum);
$1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0);
}
}
%typemap(out) vector<T> {
@ -361,8 +361,8 @@ namespace std {
} else {
/* wrapped vector? */
std::vector<T >* v;
$1 = (SWIG_GetPtr($input,(void **) &v,
$&1_descriptor) != -1) ? 1 : 0;
$1 = (SWIG_ConvertPtr($input,(void **) &v,
$&1_descriptor, 0) != -1) ? 1 : 0;
}
}
%typecheck(SWIG_TYPECHECK_VECTOR) const vector<T>&,
@ -390,8 +390,8 @@ namespace std {
} else {
/* wrapped vector? */
std::vector<T >* v;
$1 = (SWIG_GetPtr($input,(void **) &v,
$1_descriptor) != -1) ? 1 : 0;
$1 = (SWIG_ConvertPtr($input,(void **) &v,
$1_descriptor, 0) != -1) ? 1 : 0;
}
}
public:

View file

@ -11,32 +11,50 @@
/* Pointers */
%typemap(in) SWIGTYPE * {
$1 = ($ltype) SWIG_MustGetPtr($input, $descriptor, $argnum);
$1 = ($ltype) SWIG_MustGetPtr($input, $descriptor, $argnum, 0);
}
%typemap(in) void * {
$1 = SWIG_MustGetPtr($input, NULL, $argnum);
$1 = SWIG_MustGetPtr($input, NULL, $argnum, 0);
}
%typemap(varin) SWIGTYPE * {
$1 = ($ltype) SWIG_MustGetPtr($input, $descriptor, 1);
$1 = ($ltype) SWIG_MustGetPtr($input, $descriptor, 1, 0);
}
%typemap(varin) SWIGTYPE & {
$1 = *(($1_ltype)SWIG_MustGetPtr($input, $descriptor, 1, 0));
}
%typemap(varin) SWIGTYPE [ANY] {
void *temp;
int ii;
$1_basetype *b = 0;
temp = SWIG_MustGetPtr($input, $1_descriptor, 1, 0);
b = ($1_basetype *) $1;
for (ii = 0; ii < $1_size; ii++) b[ii] = *(($1_basetype *) temp + ii);
}
%typemap(varin) void * {
$1 = SWIG_MustGetPtr($input, NULL, 1);
$1 = SWIG_MustGetPtr($input, NULL, 1, 0);
}
%typemap(out) SWIGTYPE * {
$result = SWIG_MakePtr ($1, $descriptor);
$result = SWIG_NewPointerObj ($1, $descriptor, $owner);
}
%typemap(out) SWIGTYPE *DYNAMIC {
swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor,(void **) &$1);
$result = SWIG_MakePtr ($1, ty);
$result = SWIG_NewPointerObj ($1, ty, $owner);
}
%typemap(varout) SWIGTYPE * {
$result = SWIG_MakePtr ($1, $descriptor);
%typemap(varout) SWIGTYPE *, SWIGTYPE [] {
$result = SWIG_NewPointerObj ($1, $descriptor, 0);
}
%typemap(varout) SWIGTYPE & {
$result = SWIG_NewPointerObj((void *) &$1, $1_descriptor, 0);
}
/* C++ References */
@ -44,45 +62,29 @@
#ifdef __cplusplus
%typemap(in) SWIGTYPE &, const SWIGTYPE & {
$1 = ($ltype) SWIG_MustGetPtr($input, $descriptor, $argnum);
$1 = ($ltype) SWIG_MustGetPtr($input, $descriptor, $argnum, 0);
if ($1 == NULL) scheme_signal_error("swig-type-error (null reference)");
}
%typemap(out) SWIGTYPE &, const SWIGTYPE & {
$result = SWIG_MakePtr ($1, $descriptor);
$result = SWIG_NewPointerObj ($1, $descriptor, $owner);
}
%typemap(out) SWIGTYPE &DYNAMIC {
swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor,(void **) &$1);
$result = SWIG_MakePtr ($1, ty);
$result = SWIG_NewPointerObj ($1, ty, $owner);
}
#endif
%typemap(out) SWIGTYPE
#ifdef __cplusplus
{
$&1_ltype resultptr;
resultptr = new $1_ltype(($1_ltype &) $1);
$result = SWIG_MakePtr (resultptr, $&1_descriptor);
}
#else
{
$&1_ltype resultptr;
resultptr = ($&1_ltype) malloc(sizeof($1_type));
memmove(resultptr, &$1, sizeof($1_type));
$result = SWIG_MakePtr(resultptr, $&1_descriptor);
}
#endif
/* Arrays */
%typemap(in) SWIGTYPE[] {
$1 = ($ltype) SWIG_MustGetPtr($input, $descriptor, $argnum);
$1 = ($ltype) SWIG_MustGetPtr($input, $descriptor, $argnum, 0);
}
%typemap(out) SWIGTYPE[] {
$result = SWIG_MakePtr ($1, $descriptor);
$result = SWIG_NewPointerObj ($1, $descriptor, $owner);
}
/* Enums */
@ -105,13 +107,13 @@
/* Pass-by-value */
%typemap(in) SWIGTYPE($&1_ltype argp) {
argp = ($&1_ltype) SWIG_MustGetPtr($input, $&1_descriptor, $argnum);
argp = ($&1_ltype) SWIG_MustGetPtr($input, $&1_descriptor, $argnum, 0);
$1 = *argp;
}
%typemap(varin) SWIGTYPE {
$&1_ltype argp;
argp = ($&1_ltype) SWIG_MustGetPtr($input, $&1_descriptor, 1);
argp = ($&1_ltype) SWIG_MustGetPtr($input, $&1_descriptor, 1, 0);
$1 = *argp;
}
@ -121,14 +123,14 @@
{
$&1_ltype resultptr;
resultptr = new $1_ltype(($1_ltype &) $1);
$result = SWIG_MakePtr (resultptr, $&1_descriptor);
$result = SWIG_NewPointerObj (resultptr, $&1_descriptor, 1);
}
#else
{
$&1_ltype resultptr;
resultptr = ($&1_ltype) malloc(sizeof($1_type));
memmove(resultptr, &$1, sizeof($1_type));
$result = SWIG_MakePtr(resultptr, $&1_descriptor);
$result = SWIG_NewPointerObj(resultptr, $&1_descriptor, 1);
}
#endif
@ -137,14 +139,14 @@
{
$&1_ltype resultptr;
resultptr = new $1_ltype(($1_ltype &) $1);
$result = SWIG_MakePtr (resultptr, $&1_descriptor);
$result = SWIG_NewPointerObj (resultptr, $&1_descriptor, 0);
}
#else
{
$&1_ltype resultptr;
resultptr = ($&1_ltype) malloc(sizeof($1_type));
memmove(resultptr, &$1, sizeof($1_type));
$result = SWIG_MakePtr(resultptr, $&1_descriptor);
$result = SWIG_NewPointerObj(resultptr, $&1_descriptor, 0);
}
#endif
@ -316,7 +318,7 @@ REF_MAP(double, SCHEME_REALP, scheme_real_to_double,
%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] {
void *ptr;
if (SWIG_GetPtr($input, (void **) &ptr, $1_descriptor)) {
if (SWIG_ConvertPtr($input, (void **) &ptr, $1_descriptor, 0)) {
$1 = 0;
} else {
$1 = 1;
@ -325,7 +327,7 @@ REF_MAP(double, SCHEME_REALP, scheme_real_to_double,
%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE {
void *ptr;
if (SWIG_GetPtr($input, (void **) &ptr, $&1_descriptor)) {
if (SWIG_ConvertPtr($input, (void **) &ptr, $&1_descriptor, 0)) {
$1 = 0;
} else {
$1 = 1;
@ -334,7 +336,7 @@ REF_MAP(double, SCHEME_REALP, scheme_real_to_double,
%typecheck(SWIG_TYPECHECK_VOIDPTR) void * {
void *ptr;
if (SWIG_GetPtr($input, (void **) &ptr, 0)) {
if (SWIG_ConvertPtr($input, (void **) &ptr, 0, 0)) {
$1 = 0;
} else {
$1 = 1;

2
README
View file

@ -36,7 +36,7 @@ Major contributors include:
Loic Dachary (Perl5)
Masaki Fukushima (Ruby)
James Michael DuPont(mdupont777@yahoo.com) (C#/PNet Support with the original code from Neil Cawse)
John Lenz (Guile updates)
John Lenz (Guile, MzScheme updates)
Past contributors include:
Clark McGrew, Dustin Mitchell, Ian Cooke, Catalin Dumitrescu, Baran

View file

@ -181,7 +181,7 @@ libchicken.c: $(SWIG_TYPECHECK) $(CHICKEN_RUNTIME)
# MzScheme run-time library
# ----------------------------------------------------------------------
MZSCHEME_RUNTIME = $(SWIGLIB)/mzscheme/mzschemedec.swg $(SWIGLIB)/mzscheme/mzscheme.swg
MZSCHEME_RUNTIME = $(SWIG_TYPECHECK) $(SWIGLIB)/mzscheme/mzrun.swg
MZC = @MZC@
SO = @SO@
RELEASESUFFIX = @release_suffix@

View file

@ -835,6 +835,14 @@ AC_SUBST(GUILE_SCM_INTERFACE)
#----------------------------------------------------------------
AC_PATH_PROG(MZC, mzc)
AC_PATH_PROG(MZSCHEME, mzscheme)
if test -n "$MZSCHEME"; then
AC_MSG_CHECKING(for MzScheme dynext object)
MZDYNOBJ=`$MZSCHEME --mute-banner --version --eval '(begin (require (lib "link.ss" "dynext"))(for-each (lambda (x) (display x) (display " ")) ((current-make-standard-link-libraries))))'`
AC_MSG_RESULT($MZDYNOBJ)
fi
AC_SUBST(MZDYNOBJ)
#----------------------------------------------------------------
# Look for Ruby