可以返回一个ptr或ptrobj
On Tuesday, October 16, 2012 3:35:45 AM UTC-4, twcai wrote:
>
> 在XS中,像test_struct(定义如下)这样用户定义的结构体,要怎么样以一个Hash的形式返回给Perl代码呢?
> 浏览了下perlxstypemap,不过因为时间略急,没能找到答案,只好同时在线等大牛解惑。
>
> typedef enum TEST_BOOLEAN {
> TEST_FALSE,
> TEST_TRUE
> }TEST_BOOLEAN;
>
> typedef struct test_struct {
> int id;
> double radio;
> const char *name;
> TEST_BOOLEAN exist;
> }test_struct;
>
> extern test_struct *foo (int id, double radio, const char *name);
>
>
--
您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
要在网络上查看此讨论,请访问 https://groups.google.com/d/msg/perlchina/-/292R1SnH3oQJ。
要向此网上论坛发帖,请发送电子邮件至 [email protected]。
要取消订阅此网上论坛,请发送电子邮件至 [email protected]。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。