<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>junichim</author_name>
  <author_url>https://blog.hatena.ne.jp/junichim/</author_url>
  <blog_title>プログラマーのメモ書き</blog_title>
  <blog_url>https://blog.mori-soft.com/</blog_url>
  <categories>
    <anon>プログラム関連</anon>
    <anon>python</anon>
  </categories>
  <description>C/C++のライブラリをPythonから呼び出す方法として、SWIGを使った方法をとっているものがありました。このライブラリを呼び出す際に、引数としてvoid*をとる関数の場合にうまくPythonのデータを渡せないことがありました。今回はこのような場合の回避策を考えてみました。 なお、以下のサンプルは、 Python 2.6.2 SWIG 1.3.36 Ubuntu 9.04 デスクトップ 日本語 Remix で試しました。 問題の再現 今回問題となったケースと同じような振る舞いをするサンプルコードを示します。まずは、C/C++ライブラリに該当するコードです。 test_api.h #incl…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.mori-soft.com%2Fentry%2F%253Fp%253D105&quot; title=&quot;【Python】【SWIG】Python文字列をvoid*引数に渡す方法 - プログラマーのメモ書き&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/j/junichim/20160825/20160825153949.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2010-02-20 04:47:21</published>
  <title>【Python】【SWIG】Python文字列をvoid*引数に渡す方法</title>
  <type>rich</type>
  <url>https://blog.mori-soft.com/entry/%3Fp%3D105</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
