From 0e75ebbc341f5d9067540d0953822a99ca5cfe31 Mon Sep 17 00:00:00 2001 From: Leif Middelschulte Date: Wed, 1 Aug 2012 12:52:17 +0000 Subject: [PATCH] Update to reflect changes (additional typemaps) in the C backend. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-c@13481 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/c/std_string.i | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Lib/c/std_string.i b/Lib/c/std_string.i index 8be2455fb..f3c6d8a3a 100644 --- a/Lib/c/std_string.i +++ b/Lib/c/std_string.i @@ -13,11 +13,22 @@ class string; %typemap(ctype) string * "char *" %typemap(ctype) string & "char *" %typemap(ctype) const string & "char *" +%typemap(proxy) string "char *" +%typemap(proxy) string * "char *" +%typemap(proxy) string & "char *" +%typemap(proxy) const string & "char *" %typemap(couttype) string "char *" -%typemap(couttype) const string & "char *" %typemap(couttype) string * "char *" +%typemap(couttype) string & "char *" +%typemap(couttype) const string & "char *" +%typemap(proxycouttype) string "char *" +%typemap(proxycouttype) string * "char *" +%typemap(proxycouttype) string & "char *" +%typemap(proxycouttype) const string & "char *" %typemap(cppouttype, retobj="1") string "std::string*" -%typemap(cppouttype) const string &, string * "std::string*" +%typemap(cppouttype) const string &, string *, string & "std::string*" +%typemap(wrap_call) string "" +%typemap(wrap_call) const string &, string*, string& "" %typemap(in) string { if ($input) { @@ -38,12 +49,12 @@ class string; } } -%typemap(freearg) const string &, string * { +%typemap(freearg) const string &, string *, string & { if ($1) delete $1; } -%typemap(out) string, const string &, string * { +%typemap(out) string, const string &, string *, string & { const char *str = cppresult->c_str(); size_t len = strlen(str); $result = (char *) malloc(len + 1);