Hi Ervin,
Thank you for your answer, my issue was indeed to have a different argument name (*s Vs. *str).
The SWIG 2.0 documentation might need to be updated though, because I took the example from there:
-----------------------------------------------------
34.12.2 Buffer interface
%include <pybuffer.i>
%pybuffer_mutable_string(char *str);
void get_path(char *s);
-----------------------------------------------------
Regards,
Simon
-----Original Message-----
From: Ervin Hegedüs [mailto:
[hidden email]]
Sent: Wednesday, February 15, 2017 2:02 PM
To: Simon Dumortier
Cc:
[hidden email]
Subject: Re: [Swig-user] Buffer interface issue
EXTERNAL EMAIL
Hi Simon,
On Wed, Feb 15, 2017 at 03:33:16PM +0000, Simon Dumortier wrote:
> Hello,
>
> # test.i ------------------------------------------------------
> /* File: test.i */
> %module example
> %include "pybuffer.i"
>
> %{
> #include "test.h"
> %}
>
> %pybuffer_mutable_string(char *str);
> void get_path(char *s);
> int print_stuff(void);
>
> ---------------------------------------------------------------
the right form of the lines above:
%pybuffer_mutable_string(char *s);
%{
#include "test.h"
%}
void get_path(char *s);
* may be that's not important, but I've placed the
pybuffer_mutable_string macro _before_ the header
* but that's important, that the argument name _must_be_ same
as you're using in your method; I mean, "char *str" in
your macro is not equal with "char *s" in your method.
Regards,
a.
--
I � UTF-8
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org!
http://sdm.link/slashdot_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user