Class Inline::C
In: lib/inline.rb
Parent: Object

Inline::C is the default builder used and the only one provided by Inline. It can be used as a template to write builders for other languages. It understands type-conversions for the basic types and can be extended as needed.

Methods

Constants

MAGIC_ARITY_THRESHOLD = 15
MAGIC_ARITY = -1

Attributes

flags  [RW] 
libs  [RW] 
mod  [R] 
mod  [RW] 
rb_file  [R] 
sig  [RW] 
src  [RW] 

Public Class methods

Public Instance methods

Adds compiler options to the compiler command line. No preprocessing is done, so you must have all your dashes and everything.

Adds linker flags to the link command line. No preprocessing is done, so you must have all your dashes and everything.

Adds custom content to the end of the init function.

Registers C type-casts +r2c+ and +c2r+ for type.

Builds the source file, if needed, and attempts to compile it.

Adds a C function to the source, including performing automatic type conversion to arguments and the return value. The Ruby method name can be overridden by providing method_name. Unknown type conversions can be extended by using add_type_converter.

Adds a raw C function to the source. This version does not perform any type conversion and must conform to the ruby/C coding conventions. The Ruby method name can be overridden by providing method_name.

Same as c_raw, but adds a class function.

Same as c, but adds a class function.

Returns extra compilation flags for windoze platforms. Ugh.

Adds an include to the top of the file. Don‘t forget to use quotes or angle brackets.

Specifies that the the ruby.h header should be included after custom header(s) instead of before them.

Loads the generated code back into ruby

Attempts to load pre-generated code returning true if it succeeds.

Maps a C constant to ruby (with the same name). names_and_types is a hash that maps the name of the constant to its C type.

Maps a ruby constant to C (with the same name)

Adds any amount of text/code to the source

Protected Instance methods

[Validate]