- 论坛徽章:
- 0
|
想为一个C库函数写个Perl接口,试了很久都不会用,perlxstut等文章看了一遍又一遍,学多问题还是找不到答案。
例如,size_t在typemap中有定义,但是为什么不能识别?
$ h2xs -x -O -n eSpeak espeak.h
...
Writing eSpeak/ppport.h
Scanning typemaps...
Scanning /usr/share/perl/5.8/ExtUtils/typemap
Scanning espeak.h for functions...
Expecting parenth after identifier in `size_t size'
after `size_t ' at /usr/local/share/perl/5.8.8/C/Scan.pm line 797.
涉及size_t的那段代码如下:
espeak_ERROR espeak_Synth(const void *text,
size_t size,
unsigned int position,
espeak_POSITION_TYPE position_type,
unsigned int end_position,
unsigned int flags,
unsigned int* unique_identifier,
void* user_data);
这些不解的问题还有很多,有没有更好的介绍如何做C语言binding的资料呢?不胜感激!! |
|