Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you call C functions from MacRuby?

Tags:

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?

like image 449
dan Avatar asked Jun 17 '26 10:06

dan


1 Answers

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

like image 103
Marcel M. Avatar answered Jun 21 '26 10:06

Marcel M.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!