summaryrefslogtreecommitdiff
path: root/Lib/chicken/chickenrun.swg
diff options
context:
space:
mode:
authorJohn Lenz <jlenz2@math.uiuc.edu>2004-11-02 02:50:30 +0000
committerJohn Lenz <jlenz2@math.uiuc.edu>2004-11-02 02:50:30 +0000
commit68372c5c2f3150244f566be90a3e06253e5f9d46 (patch)
tree7619ad1fa7a80427023cb5fd0a7d252acf2566e5 /Lib/chicken/chickenrun.swg
parentbd1743157b63c1392797d781613329433075f74a (diff)
downloadswig-68372c5c2f3150244f566be90a3e06253e5f9d46.tar.gz
More work on the chicken module. The test suite, zlib, and overload examples are still broken.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6610 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Lib/chicken/chickenrun.swg')
-rw-r--r--Lib/chicken/chickenrun.swg20
1 files changed, 15 insertions, 5 deletions
diff --git a/Lib/chicken/chickenrun.swg b/Lib/chicken/chickenrun.swg
index 6706a02f3..b4a94f8c3 100644
--- a/Lib/chicken/chickenrun.swg
+++ b/Lib/chicken/chickenrun.swg
@@ -38,6 +38,7 @@ extern "C" {
#define C_swig_is_pair(x) (C_truep (C_blockp(x)) && C_truep (C_pairp(x)))
#define C_swig_is_ptr(x) (C_truep (C_blockp (x)) && C_truep (C_pointerp (x)))
#define C_swig_is_swigpointer(x) (C_truep (C_blockp(x)) && C_truep (C_swigpointerp(x)))
+#define C_swig_is_closurep(x) (C_truep (C_blockp(x)) && C_truep(C_closurep(x)))
#define SWIG_APPEND_VALUE(object) \
if (resultobj == C_SCHEME_UNDEFINED) \
@@ -60,9 +61,9 @@ enum {
SWIG_BARF1_ARGUMENT_NULL /* 1 arg */
};
-struct swig_chicken_clientdata {
+typedef struct swig_chicken_clientdata {
C_word clos_class;
-};
+} swig_chicken_clientdata;
static char *
SWIG_Chicken_MakeString(C_word str) {
@@ -161,13 +162,22 @@ SWIG_Chicken_Barf(int code, C_char *msg, ...)
}
}
-static SWIGINLINE C_word
+static C_word
SWIG_Chicken_NewPointerObj(void *ptr, swig_type_info *type, int owner, C_word **data)
{
+ swig_chicken_clientdata *cdata = (swig_chicken_clientdata *) type->clientdata;
+
if (ptr == NULL)
return C_SCHEME_FALSE;
- else
- return C_swigmpointer(data, ptr, type);
+ else {
+ C_word cptr = C_swigmpointer(data, ptr, type);
+ if (cdata && cdata->clos_class && C_swig_is_closurep(cdata->clos_class)) {
+ C_save(cptr);
+ return C_callback(cdata->clos_class, 1);
+ } else {
+ return cptr;
+ }
+ }
}
/* Return 0 if successful. */