summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikel Bancroft <mikel@franz.com>2007-11-21 21:33:42 +0000
committerMikel Bancroft <mikel@franz.com>2007-11-21 21:33:42 +0000
commitca9c273546b87652362a1bd4b51441529c362623 (patch)
tree518428071544e91bbf74ab40f8e1fb786c646277
parentd74122395901e5d844c27969041559b7a1e1414e (diff)
downloadswig-ca9c273546b87652362a1bd4b51441529c362623.tar.gz
[allegrocl] multiple small fixes to interface. have const std::string *'s automacitally marshalled to lisp strings.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10162 626c5289-ae23-0410-ae9c-e8d60b6d4f22
-rw-r--r--CHANGES.current9
-rwxr-xr-xLib/allegrocl/std_string.i12
-rw-r--r--Source/Modules/allegrocl.cxx28
3 files changed, 38 insertions, 11 deletions
diff --git a/CHANGES.current b/CHANGES.current
index 8cc400c3a..463bc6d46 100644
--- a/CHANGES.current
+++ b/CHANGES.current
@@ -1,6 +1,15 @@
+2007-11-21 Mikel Bancroft <mikel@franz.com>
+
Version 1.3.33 (in progress)
============================
+11/21/2007: mikel
+ [allegrocl] omit private slot type info in the classes/types
+ defined on the lisp side. Fix bug in mapping of C/++ types
+ to lisp types. Fix typo in modules generated defpackage form.
+ Have std::string *'s automatically marshalled between foreign
+ and lisp strings.
+
11/20/2007: olly
[Python] Fill in Python Dictionary functions list (patch from
Jelmer Vernooij posted to swig-devel).
diff --git a/Lib/allegrocl/std_string.i b/Lib/allegrocl/std_string.i
index c70532f7a..4da0148fe 100755
--- a/Lib/allegrocl/std_string.i
+++ b/Lib/allegrocl/std_string.i
@@ -102,6 +102,12 @@ namespace std {
%typemap(lisptype) string "cl:string";
%typemap(lout) string "(cl::setq ACL_ffresult $body)";
+ %typemap(ctype) const string *"char *";
+ %typemap(in) const string * "$1.assign($input);";
+ %typemap(out) const string * "$result = (char *)($1)->c_str();";
+ %typemap(lisptype) const string * "cl:string";
+ %typemap(lout) const string * "(cl::setq ACL_ffresult $body)";
+
%typemap(ctype) wstring "wchar_t *";
%typemap(in) wstring "$1.assign($input);";
%typemap(out) wstring "$result = (wchar_t *)(&$1)->c_str();";
@@ -109,6 +115,12 @@ namespace std {
%typemap(lout) wstring "(cl::setq ACL_ffresult (excl:native-to-string $body
:external-format #+little-endian :fat-le #-little-endian :fat))";
+ %typemap(ctype) const wstring *"char *";
+ %typemap(in) const wstring * "$1.assign($input);";
+ %typemap(out) const wstring * "$result = (char *)($1)->c_str();";
+ %typemap(lisptype) const wstring * "cl:string";
+ %typemap(lout) const wstring * "(cl::setq ACL_ffresult $body)";
+
/* Overloading check */
// %typemap(in) string {
// if (caml_ptr_check($input))
diff --git a/Source/Modules/allegrocl.cxx b/Source/Modules/allegrocl.cxx
index 11c332dd7..773766c38 100644
--- a/Source/Modules/allegrocl.cxx
+++ b/Source/Modules/allegrocl.cxx
@@ -735,22 +735,21 @@ String *internal_compose_foreign_type(SwigType *ty) {
String *compose_foreign_type(SwigType *ty, String *id = 0) {
+ Hash *lookup_res = Swig_typemap_search("ffitype", ty, id, 0);
#ifdef ALLEGROCL_TYPE_DEBUG
Printf(stderr, "compose_foreign_type: ENTER (%s)...\n ", ty);
String *id_ref = SwigType_str(ty, id);
- Hash *lookup_res = Swig_typemap_search("ffitype", ty, id, 0);
Printf(stderr, "looking up typemap for %s, found '%s'(%x)\n",
id_ref, lookup_res ? Getattr(lookup_res, "code") : 0, lookup_res);
#endif
/* should we allow named lookups in the typemap here? YES! */
- if(id) { /* and we should probably allow unnamed lookups here as well */
- Hash *lookup_res = Swig_typemap_search("ffitype", ty, id, 0);
- if(lookup_res) {
+ /* unnamed lookups should be found in get_ffi_type, called
+ by internal_compose_foreign_type(), below. */
+ if(id && lookup_res) {
#ifdef ALLEGROCL_TYPE_DEBUG
Printf(stderr, "compose_foreign_type: EXIT-1 (%s)\n ", Getattr(lookup_res, "code"));
#endif
- return NewString(Getattr(lookup_res, "code"));
- }
+ return NewString(Getattr(lookup_res, "code"));
}
SwigType *temp = SwigType_strip_qualifiers(ty);
@@ -1155,9 +1154,17 @@ void emit_full_class(Node *n) {
if (!Strcmp(childDecl, "0"))
childDecl = NewString("");
- SwigType *childType = NewStringf("%s%s", childDecl,
- Getattr(c, "type"));
- String *cname = (access && Strcmp(access, "public")) ? NewString("nil") : Copy(Getattr(c, "name"));
+ SwigType *childType;
+ String *cname;
+
+ // don't include types for private slots (yet). spr33959.
+ if(access && Strcmp(access,"public")) {
+ childType = NewStringf("int");
+ cname = NewString("nil");
+ } else {
+ childType = NewStringf("%s%s", childDecl, Getattr(c, "type"));
+ cname = Copy(Getattr(c, "name"));
+ }
if (!SwigType_isfunction(childType)) {
// Printf(slotdefs, ";;; member functions don't appear as slots.\n ");
@@ -1559,7 +1566,7 @@ int ALLEGROCL::top(Node *n) {
"(defpackage :%s\n"
" (:use :common-lisp :ff :excl)\n"
" (:export #:*swig-identifier-converter* #:*swig-module-name*\n"
- " #:*void* #:*swig-expoert-list*))\n"
+ " #:*void* #:*swig-export-list*))\n"
"(in-package :%s)\n\n"
"(eval-when (compile load eval)\n"
" (defparameter *swig-identifier-converter* '%s)\n"
@@ -2912,7 +2919,6 @@ int ALLEGROCL::typedefHandler(Node *n) {
#endif
Delete(ff_type);
- if (lookup) Delete(lookup);
return SWIG_OK;
}