这种程度的XS应该不用涉及内部数据类型,看了perlxstut的第二个例子就应该能实现这个功能了
2011/3/24 胡松涛 <[email protected]>: > > 建议可以在perl中过虑文本,毕竟这是perl的专长。 > > 狐狸 > > 在 Thu, 24 Mar 2011 16:22:16 +0800,cnhack TNT <[email protected]> 写道: > >> 请问为啥不直接在 perl 中进行清理呢? >> >> 2011/3/24 长歌门-肖头 [CGM]sgxiao <[email protected]> >> >>> 假设我目前有一个perl里面的字符串 >>> >>> my $str = 'blablabla blabla blablabalbalb lbabla '; >>> >>> >>> >>> 里面存在某些不可见的字符。我目前考虑用一个xs模块将,希望将这个字符串作为参数传给一个C语言写的函数进行清理。然后再返回一个处理后的字符串给perl程序。 >>> >>> >>> >>> 查询过部分文档。里面将这个XS的类型定义为一个AV类型(刚开始看到这个类型着实汗了一把)。那么这个字符串的类型,究竟是作为AV类型回传呢?还是简单的作为一个SV类型回传呢? >>> >>> -- >>> 您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。 >>> 要向此网上论坛发帖,请发送电子邮件至 [email protected]。 >>> 要取消订阅此网上论坛,请发送电子邮件至 [email protected]。 >>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。 >>> >> > > > -- > 使用 Opera 革命性的电子邮件客户程序: http://www.opera.com/mail/ > > -- > 您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。 > 要向此网上论坛发帖,请发送电子邮件至 [email protected]。 > 要取消订阅此网上论坛,请发送电子邮件至 [email protected]。 > 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。 > > -- 您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。 要向此网上论坛发帖,请发送电子邮件至 [email protected]。 要取消订阅此网上论坛,请发送电子邮件至 [email protected]。 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
