开发者

How do you call C functions from MacRuby?

开发者_开发问答I'd like to try to use MacRuby with CoreAudio on OS X, but most of these APIs are C functions. Do I have to use Ruby DL, or does MacRuby offer another way?


According to the Macruby site, you should be able to call C functions directly

Accessing Static APIs

Many Mac OS X framework APIs are not introspectable because they are static, but thanks to the BridgeSupport project, static APIs can be called from MacRuby.

The following API types are available:

  • List item
  • CoreFoundation types (CFType)
  • C structures
  • C opaque types
  • C enumerations
  • C and Objective-C constants (including preprocessor-defined constants)
  • C functions (including inline functions)
  • Objective-C informal protocols

http://www.macruby.org/documentation/tutorial.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜