SWIG:%pointer_class和%pointer_functions有什么区别?

时间:2013-03-04 06:06:07

标签: python c swig

这是我的C接口:

typedef uint16_t my_type1;
typedef uint8_t my_type2;
int my_func(my_type1 * arg1, my_type2 * arg2) {
   *arg1 = *arge + 1;
}

现在,如果我像这样定义我的接口文件,它会起作用:

%include "stdini.i"
%include "cpointer.i"
typedef uint16_t my_type1;
typedef uint8_t my_type2;
%pointer_functions(my_type1, my_type1_p);
%pointer_functions(my_type2, my_type2_p);

但我似乎无法使用%pointer_class。它总是给我错误:

  

TypeError:无法将opaque Python指针转换为C指针。

0 个答案:

没有答案